TriggerState problem
by Calibre · in Torque Game Engine · 01/24/2006 (10:11 am) · 1 replies
I inserted a new TriggerState in my animation (pickup_item) with a value 3, like used for the footstep sounds (the engine used triggerState 1 and 2, and I use value 3).
My problem is: with pickup_item animation work the callback create for the triggerState==3, but my anothers anims don't work.
help me...
sorry about my english.....
thx...
My problem is: with pickup_item animation work the callback create for the triggerState==3, but my anothers anims don't work.
help me...
sorry about my english.....
thx...
About the author
Torque 3D Owner Stephane Conde
I wasn't 100% clear on your question... Here is what I gathered from your post: You inserted a trigger in your 'pickup_item' animation at position 3 and that one works fine. You then tried to insert a trigger for another animation and that one didn't work.
Now, I have a few questions. Firstly, what trigger number are you using in the 'other' animations? Are you using 3 again? Also, how have you implemented the 'callback' in code? Did you put a call to getTriggerState(3); in your Player's updateActionThread() function?
Assuming that you are trying to use trigger 3 again in your second animation... how is it not working? Is it just not firing at all (ie. You've put echo statements or debug breaks in your updateActionThread and they aren't being called) or is it firing, but not doing what you want?
Anyway, to further help you with this problem, it would be good to get answers to those questions...
Here is some general guidelines that may help you: Make sure that you are using a unique trigger for each unique event that you want to occur. That means if you want event 1 to occur at a certain point in your pickup_item animation, and you want event 2 to occur at a certain point in another animation, it would be best to use a different trigger for each of those events (even though they may be in different animations, you still need to use different trigger numbers). There are ways around this (ie. By checking which animation is playing or by creating a new Player class that reacts differently to the same trigger) but they are probably beyond the scope of this post.
I hope some of that helps and I will be able to offer more help if you can answer some of those questions above.
Cheers,
Stephane