Game Development Community

T3D ability to run or auto-walk? or swim ?

by Jeff Yaskus · in Torque 3D Beginner · 03/02/2011 (4:18 pm) · 3 replies

It appears the engine itself chooses when to use the walk/run animations, at least as stated in other discussions.

How would I add a hotkey to turn auto-walk on and off ?

Or add another key, such as SHIFT which doubles the players speed while held down ?

Also, other posts mention that the code needed for swimming on top of water is part of T3D engine now.

What does it take to enable these features ?

I have already added "health bar" like object to track the players energy level ... which can be reduced when running ... just not sure what step to take next.

#1
03/02/2011 (4:31 pm)
You need to interrupt the player's move function in c++ as well as add more animations. There is some info on these sorts of things somewhere in the T3D(private) forums (also look in "useful threads" forum) - cos I posted asking questions about stuff like this there some time ago.

You can make a hack which alters the $setMoveSpeed in script but it won't update until the player's move method changes and won't have accompanying animations, he'll just run slower.
eg: "player runs -> player stops -> user toggles walk -> player walks" = okay hack
"player runs -> user toggles walk -> nothing happens -> player stops -> then walk starts" = not so good
#2
03/02/2011 (11:21 pm)
'Swimming' needs but the properly named sequences, just like 'run', and the proper Ground Transforms. The stock SDK player model, 'Gideon', has just such animations as DSQ's. I've done the 'swims' animation sequences myself and it works.
#3
03/03/2011 (7:51 am)
Torque is always 'running' ;)
Quote:Or add another key, such as SHIFT which doubles the players speed while held down ?
There is a Sprint Button Resource for TGE that can pretty *easily* be used in T3D. This can in turn be further modified to use the differing animations for run/walk with a little extra tinkering. Reason this wasn't implemented in T3D is the extra network overhead required in order for it to properly work.

Swim is pretty much automatic so long as you have the proper animation and in the water.