Problems with triggers
by Ivan Mandzhukov · in Artist Corner · 03/07/2011 (6:38 am) · 6 replies
Hi everyone,
I have some problems with the animation trigger sets on dts models.
function PlayerDts::onLoad(%this)
{
%this.addTrigger("run", "1", "1");
%this.addTrigger("run", "13", "2");
%this.addTrigger("back", "1", "1");
%this.addTrigger("back", "13", "2");
%this.addTrigger("side", "1", "1");
%this.addTrigger("side", "13", "2");
}
It seems that addTrigger() and respectivelly removeTrigger() are broken,they don't register anything on the shape instance at all.
I tried also with the stock Gideon model,but it looks like its triggers are set directly in track view,this is the reason why they work.
BTW setTriggerState() works.
I have some problems with the animation trigger sets on dts models.
function PlayerDts::onLoad(%this)
{
%this.addTrigger("run", "1", "1");
%this.addTrigger("run", "13", "2");
%this.addTrigger("back", "1", "1");
%this.addTrigger("back", "13", "2");
%this.addTrigger("side", "1", "1");
%this.addTrigger("side", "13", "2");
}
It seems that addTrigger() and respectivelly removeTrigger() are broken,they don't register anything on the shape instance at all.
I tried also with the stock Gideon model,but it looks like its triggers are set directly in track view,this is the reason why they work.
BTW setTriggerState() works.
#2
There are 32 available trigger sets (0-31) on each shape instance,so this could not be a reason.
03/23/2011 (1:51 am)
This is a bug (THREED-1508).There are 32 available trigger sets (0-31) on each shape instance,so this could not be a reason.
#3
I look in shapebase.h and see :
MaxScriptThreads = 4, ///< Should be a power of 2
I've found an old resource: http://www.garagegames.com/community/resources/view/6723 , think it will help.
Or am I wrong??
03/23/2011 (2:11 am)
I can't make bigger than 4 animation triggers, I can create a trigger, but if a number of a trigger is bigger than 3, Torque doesn't call trigger event. Am I wrong?I look in shapebase.h and see :
MaxScriptThreads = 4, ///< Should be a power of 2
I've found an old resource: http://www.garagegames.com/community/resources/view/6723 , think it will help.
Or am I wrong??
#4
Animation triggers has nothing to do with the animation threads.
03/23/2011 (2:39 am)
We talk about different problems.Animation triggers has nothing to do with the animation threads.
#5
If you want an animation 'trigger' to call some code; you'll need to edit C++ for that....IE, putting a trigger value of 3 in a sequence will do NOTHING...because there is no code for a 'trigger event 3'.
Do triggers in an animation sequence make a bit more sense now?....
Stock SDK has 2 triggers[events] coded....only. Trigger '1' is the Right Foot 'effect', Trigger '2' is the Left Foot 'effect'. You could input those values in ANY DSQ sequence[with Ground Transforms and trigger marker]...and when it plays you'll probably see footprints appear. This, likely, is not what you want; but demonstrates that the trigger values of 1 and 2[the only ones in Torque at present] in a DSQ sequence are tied to a specific 'event'...laying down footprints/puffs/stepSounds.
Hope this makes some sense....and my advice is to either directly export the trigger in your DSQ sequence or edit the DSQ file directly and put your trigger data in at that point. At BrokeassGames, we sell just such a piece of software DSQTweaker...makes editing animation sequences very quick....See how quick and easy it is...?!!
03/23/2011 (2:46 pm)
In the stock SDK build of T3D, there are only 2 animations 'triggers'/events coded. These are the Left/Right footstep/footpuff/footprint effect triggers.If you want an animation 'trigger' to call some code; you'll need to edit C++ for that....IE, putting a trigger value of 3 in a sequence will do NOTHING...because there is no code for a 'trigger event 3'.
Do triggers in an animation sequence make a bit more sense now?....
Stock SDK has 2 triggers[events] coded....only. Trigger '1' is the Right Foot 'effect', Trigger '2' is the Left Foot 'effect'. You could input those values in ANY DSQ sequence[with Ground Transforms and trigger marker]...and when it plays you'll probably see footprints appear. This, likely, is not what you want; but demonstrates that the trigger values of 1 and 2[the only ones in Torque at present] in a DSQ sequence are tied to a specific 'event'...laying down footprints/puffs/stepSounds.
Hope this makes some sense....and my advice is to either directly export the trigger in your DSQ sequence or edit the DSQ file directly and put your trigger data in at that point. At BrokeassGames, we sell just such a piece of software DSQTweaker...makes editing animation sequences very quick....See how quick and easy it is...?!!
#6
If I manually set and reset triggers runtime,they work.
I believe triggers work when being set in track view also.
That means the bug is in the shape loader or the shape constructor.
I don't have problems with the trigger setups, I have problems with addTrigger() and removeTrigger()
I traced the code and they seem to do nothing.
Any way this bug is already logged.
03/24/2011 (5:15 am)
Rex,triggers are actually working,the whole functionality is there.If I manually set and reset triggers runtime,they work.
I believe triggers work when being set in track view also.
That means the bug is in the shape loader or the shape constructor.
I don't have problems with the trigger setups, I have problems with addTrigger() and removeTrigger()
I traced the code and they seem to do nothing.
Any way this bug is already logged.
Torque 3D Owner genomegames
GenomeGames