Page 1 of 1

Trigger firing order

Posted: Wed Apr 15, 2015 7:31 pm
by Slayd
What determines the order that triggers will fire, when more than one trigger finds a match on a line from the mud?

Is it just the order the triggers are shown in the editor? Related to trigger number?

Re: Trigger firing order

Posted: Thu Apr 16, 2015 8:51 pm
by SlySven
Well a quick look in (void)TriggerUnit::processDataStream(QString & data, int line), as well as revealing the use of a pointer returned from malloc(3) without a NULL-pointer check - which is NOT a good idea :twisted: :geek: :twisted: ; shows that the triggers are iterated through in some sort of order which could be the order in the editor - however I'm not confident I can say that the internal integer ID number that each trigger or trigger group has is preserved if the triggers are dragged around which is what I thought might be involved...

Re: Trigger firing order

Posted: Thu Apr 16, 2015 9:31 pm
by Slayd
Thanks. It's a shame there is not a way to assign a priority in those cases where it matters.

Re: Trigger firing order

Posted: Sat Apr 25, 2015 8:46 pm
by Vadi
The trigger order is the visual order of the editor, then all the temp triggers fire. You assign priority thus by moving triggers up and down in the editor.

If you need priority changing on the fly, I'd redo the design to capture the data with triggers and then do your processing as necessary.

Re: Trigger firing order

Posted: Sat Apr 25, 2015 8:50 pm
by Slayd
Thanks, Vadi. Physical ordering/firing priority works out great for me.