differences between triggered and fast triggered

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Tue Jun 16, 2009 5:56 pm

long ExtObject::cMyCondition(LPVAL params)
{
if (x==5)
{return true;}
}

ok,
so
without any flags, the event sheet would go in order, and when it reached a cMyCondition if x was 5, it would return true and perform the actions, correct?

triggering triggers the condition at any time, and not just in linear order?
if so, what's the difference between triggered and fast triggered?

[code:2vg7fj7u]inline void CRunObject::TriggerEvent(int cndIndex)[/code:2vg7fj7u]
after adding the CND_TRIGGERED flag to the ACE, I suppose I use TriggerEvent for triggered in any ACE or custom member function, but what do I put for cndIndex
and how would I trigger a fast trigger
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Jun 16, 2009 7:50 pm

Don't bother with fast triggers, they were written to support an algorithmically efficient version of the 'on loop' conditions which didn't slow down when other unrelated 'on loop' conditions are present. To achieve this they cut a lot of corners ranging from not performing object picking to ignoring the first parameter... essentially, they're not useful for plugins.

To trigger a condition pass the index of the condition. ADDCND() in the ACE table adds the condition to a list, so it's the zero-based condition you have in your ACE table.

Triggering a condition does what you said pretty much, it executes all events with the trigger condition in top-to-bottom order in the event sheet immediately testing all conditions and running all actions and subevents, all done immediately within the function. As you'd expect if the trigger routine (cMyCondition) returns false, that trigger does not run. Note in your example not all control paths return a value, so you probably want a 'else return false' in there!

If you trigger an event from within an action, condition or expression, call pRuntime->NewSOL() before it and pRuntime->RestoreSOL() after it. Otherwise, conditions and picking in the trigger event will affect picking in the event that caused the trigger.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Tue Jun 16, 2009 8:17 pm

thanks ash
this didn't seem worthy of it's own thread,
but is it possible to make a combo parameter have "|" in one of the choice names?
for the bitmapped text, I want to include the entire ascii set as possible characters
but since | separates the options, I think I might just have to write "or" or something
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Jun 16, 2009 8:49 pm

No, sorry, there's no way to have | as an option... I think it's called the 'pipe' character though.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests