Game Development Community

Trigger values not working properly

by xen · in Artist Corner · 02/19/2006 (11:59 pm) · 9 replies

In the blender to dts exporter (using latest version 0.9, and using blender 2.40), i put triggers with values 3 and 4 in a melee attack animation i made (which had 43 total frames):

[25] state=4(ON)
[18] state=3(ON)




in torque showtool pro, in the sequence info window, what it showed me instead:
No. State Invert Pos
4 On Off 0.405
8 On Off 0.571


my guess is that it turned the 3 to 4, and the 4 to 8.

how come? i certainly had myself scratching my head when i saw this. i also tried putting the default trigger values 1 and 2 in my model's running animation for the footsteps. the values in torque showtool pro were 1 and 2 as expected, but when loaded in the game, torque couldn't detect the 1 and 2 trigger values (there were no footpuffs, no footstep decals, and no footstep sounds)!

does this happen to you guys too? if anyone's willing, please export a test animation with trigger values and see how it ends up in torque showtool pro.

this is what my little test gave me:

i made an animation where frame 1 had a trigger value of 1, frame 2 had trigger value 2, and so on, up to 20

in the showtool, these were the trigger values listed:
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
131072
262144
524288

it was doubling itself. why, i had no idea. i certainly didn't see any "* 2" or "2^n" anywhere in the script files. perhaps a bug in the data type conversion or whatnot? i'm not very familiar with python coding that much..

#1
02/21/2006 (2:46 am)
Thanks! i'll try the new release candidate as soon as i can
#2
02/22/2006 (3:23 am)
@Joseph:
yup, the showtool shows the proper values... although the footpuffs still don't show up!

i've put some printf's for every state triggered. for the orc it shows up properly, but on my exported animation it doesn't!
#3
02/23/2006 (3:36 am)
Yup, i'm a programmer for my employer (Rainier Umali, you can search for his profile) he's the producer/owner of the company i work for and he bought the SDK for the programmer they were hiring, which incidentaly, is me. i don't know much about the legal stuff for it..

and yes, i was using the same PlayerBody datablock (although i was using a different dts and dsq's for the player of course).

hope you can help
#4
05/13/2006 (6:58 am)
Was this issue ever resolved? I still see the same behavior, and I'm not sure if it's on the exporter side of things, or on the Torque side of things. The code for trigger export seems to be using the bitwise operator to generate the power of 2 values, but I'm not sure why that is. Is ShowToolPro simply displaying the wrong value for Trigger number? Any explanation (more details the better) would be appreciated.

Thanks!
#5
05/13/2006 (7:04 am)
...
#6
05/13/2006 (9:35 am)
I made a post in a previous thread related to triggers but I'll post it here as well. This solve my problem with the triggers not working in-game. The exporter seems to be working correctly but the code that checks the triggers only get called for animations with a ground transform.

If you want to see the code, it's in TSThread::advancePos(F32 delta). Just check where it calls animateTriggers() and you'll see.

http://www.garagegames.com/mg/forums/result.thread.php?qt=12991
#7
05/13/2006 (9:40 am)
...
#8
05/13/2006 (11:28 am)
Hey Joseph, no problem. It was just luck on my side. When I was starting to look into this problem, I assumed the exporter was working correctly since they showed up in the Torque showtool. Plus, my Python experience is quite limited so I feel more comfortable diving into C++ code.

Great work on the exporter by the way. Works like a charm on my characters and static meshes. It made me drop using gameSpace altogether.
#9
05/13/2006 (12:22 pm)
So, should we get used to keyframing the bounds box, or will this be included in a next version of the exporter, Joseph?
I ask it because I am one of those who dont animate the model position...