Game Development Community

Changing movement physics?

by Eric South · in Torque 3D Professional · 04/15/2012 (8:36 pm) · 4 replies

I've got movement setup like the RTS tutorial, where users will leftclick and the player will move to that location. That works, however there are some things about movement that I would like to remove.

When clicking, the player moves slowly then accelerates to top speed until it gets to the marker and while it approaches the marker, it slows down and "slides" a little. Is it possible/what would be required to remove the acceleration, slowing and sliding so that the player moves at max speed to that point and stops abruptly?

#1
04/16/2012 (2:06 am)
I think you can fix that by setting a boolean parameter on the setMoveDestinatino function.. If that is what you use ofc. Digged this up for you:
Quote:setMoveDestination( goal [ , slowDown ] )

Purpose
Use the setMoveDestination method to set the bot's current move destination top goal. This will cause the bot to start moving immediately towards that destination.

Syntax
goal - An XYZ vector containing the position for the bot to move to.
slowDown - A boolean value. If set to true, the bot will slow down when it gets within 5-meters of its move destination. If false, the bot will stop abruptly when it reaches the move destination. By default, this is true.

Returns
No return value.

Notes
Upon reaching a move destination, the bot will clear its move destination and calls to getMoveDestination will return a NULL string.

See Also
getMoveDestination, setMoveSpeed, stop

Hope it helps.
#2
04/16/2012 (10:21 am)
That was very helpful, indeed. Could I ask where you got that? I can't seem to find any documentation that goes into the functions THAT well.
#3
04/16/2012 (1:21 pm)
Oh yeah ofc! Well, i just google [function name] torque.
And looks for the sites hosted by garage games like this one:
docs.garagegames.com/tge/official/content/documentation/Reference/Console%20Obje...
That is the third result when googling:
setmovedestination torque

If it doesn't come up with anything try adding more keyword like Reference or script :P

I haven't found another way to access those pages but they are pretty useful. You could also check out the TDN
or the Documentation for TGE
Or the T3D documentation
Although i find the T3D one confusing, and seems to favor the coders. Which i don't blame them! Since coders need more insight to the engine than a scripter does :)
Edit: Oh yeah should probably place a warning here. Although the documentation in those links is mostly fine, it is from all the way back at TGE so do keep in mind that some of the documentation might be outdated. E.g. the containerraycast function has an additional parameter in T3D specifying whether to search on server or clientside. :)
#4
04/16/2012 (1:29 pm)
Found the script reference which is IMO the most valuable one:
Torque console objects