Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Placing an object with the mouse

Author
Message
baconboy2
17
Years of Service
User Offline
Joined: 30th Jul 2007
Location: Liverpool, UK
Posted: 11th Aug 2010 19:08
Hi all,

I am currently working on the building creation section of an RTS, and I have go to the stage that the camera is set, but now I need to be able to make a 3d object when I press a scan-key, and attach it (I guess), to the mouse until the user left clicks to 'build' in the desired location.
If I didn't explain myself clearly - in an RTS, when you want to create a building, you select the building from a menu, and the mouse then becomes the building. When you left-click, it builds where you clicked.

Cheers in advance!

My Portfolio Website - http://boomerang-studios.webs.com/
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 11th Aug 2010 19:58


This method is different from the one I showed you on msn, as this one takes the ground into account, and means you don't have to calculate the difference.

I hope everything I've said makes sense, and that you can incorporate it into your project.

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 11th Aug 2010 19:59 Edited at: 11th Aug 2010 20:00
Pick screen. There are a few commands based around this. I should search in the manual and have a read.
Oops, lol, an answer has been posted in the time it took to write this!

http://s6.bitefight.org/c.php?uid=103081
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 13th Aug 2010 20:06
With forum search : "3D mouse" i found this thread :

http://forum.thegamecreators.com/?m=forum_view&t=92386&b=6

Added few lines to the code.I hope it helps.



You can try similar concept for building in your game.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!

Login to post a reply

Server time is: 2024-11-23 10:50:09
Your offset time is: 2024-11-23 10:50:09