How the character move where mouse press?
by Kenny · in Torque Game Engine · 01/25/2007 (7:36 pm) · 6 replies
How do the character move to where the mouse pressed? just like most of online game control system.
when the user use mouse to press onto terrains,and the character move to that destination that i just pressed.
when the user use mouse to press onto terrains,and the character move to that destination that i just pressed.
#2
01/26/2007 (3:29 am)
Your conception is not bad,but the first thing is whenever i show mouse with cursorOn command, i can't rotate camera....nor do anything on terrains...
#3
Unless you have Starter.RTS (which has this functionality built in), you are going to have to change the engine. So, while you are there, fiddle around with the controls and camera to have the custom functionality you need.
Here are the links to the resources I mentioned earlier:
Object Selection v1.2
Advanced AI
You won't need all the code from these resources, just the important ones that pertain to the pseudo-code I wrote.
An alternative to using an AI resource is to take the endpoint of the created vector and implement a "Turn To" functionality, which rotates the player to face that direction. From there you need only apply the movement to the player, no other AI needed.
01/26/2007 (5:30 am)
The WorldEditor has functionality that allows you to rotate the camera when the right mouse button is held down, so you can add that to the GameTSCtrl in no time at all.Unless you have Starter.RTS (which has this functionality built in), you are going to have to change the engine. So, while you are there, fiddle around with the controls and camera to have the custom functionality you need.
Here are the links to the resources I mentioned earlier:
Object Selection v1.2
Advanced AI
You won't need all the code from these resources, just the important ones that pertain to the pseudo-code I wrote.
An alternative to using an AI resource is to take the endpoint of the created vector and implement a "Turn To" functionality, which rotates the player to face that direction. From there you need only apply the movement to the player, no other AI needed.
#4
05/26/2009 (12:05 am)
I'm looking at this now for Torque 3D (warning: new to torque).... I think maybe I just need to find out how to implement and export-to-TorqueScript get3DMousePos() and get3DMouseVec()
#5
05/26/2009 (12:55 am)
Well I implemented getMouse3dPos() and getMouse3dVec() based on www.garagegames.com/community/resource/view/7335/12#comments, but no luck so far...
#6
05/26/2009 (7:23 pm)
getMouse3dPos() and getMouse3dVec(), are always returning (0 0 0) :-(
Employee Michael Perry
ZombieShortbus
All functions listed have to be written by you, this is just a concept.
Search for these resources to get the code to complete those functions: Object Selection and Advanced AI.
Try that concept out, and let me know if you are still stumped.