Game Development Community

mvTriggerCount0

by Eric Soyon · in Torque 3D Beginner · 08/25/2010 (1:58 am) · 4 replies

I am trying to script a function to fire the stateMachine so I don't have to do a bunch of extra work to get scripted melee weapons into Torque. I am just wondering exactly how $mvTriggerCount0 works and how I can simulate calling this.

#1
08/25/2010 (2:22 am)
mvtriggercount is hard coded into the source so you cant really modify what it does or add additional move triggers, but anywho that wasn't your question,the way the move triggers work is they are fed into the shapeBaseImage state machine, and if you make use of shapeBaseImages states to handle firing a gun or whatever, then those activate the appropriate states to fire said weapon. The issue for you however is setting up the state for a melee attack which you cant really do without the source, at least not any way that i am knowledgeable of. Personally i am just learning all of this right now as well, so perhaps someone else will be able to shed a little bit more light on the subject.

As just a bit more superfluous information the mvtrigger0 is hard coded to the left mouse which is set to the fire states in both the source and in default binds. mvtrigger1 is the alternate fire, trigger2 is jumping, trigger 3 and 4 or pose changes (crouch and prone, swimming etc)

I guess you could attempt to hijack one of these states, though that might not give you quite what you are looking for.
#2
08/26/2010 (1:30 pm)
In TGE, there is a function called onTrigger that is called on a Player's datablock when one of their triggers is set. You could use this function for melee weapons if you wanted (and if it's still in T3D - don't see why it wouldn't be!).
#3
08/26/2010 (4:44 pm)
The callback that Daniel mentions is still there and can be used as a script override for the various move triggers on a per player datablock basis. By default it doesn't do anything.
#4
08/28/2010 (3:57 pm)
Awesome thanks!