Trigger firing order

Post Reply
Slayd
Posts: 102
Joined: Mon Jul 25, 2011 4:57 am

Trigger firing order

Post 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?

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Trigger firing order

Post 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...

Slayd
Posts: 102
Joined: Mon Jul 25, 2011 4:57 am

Re: Trigger firing order

Post by Slayd »

Thanks. It's a shame there is not a way to assign a priority in those cases where it matters.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Trigger firing order

Post 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.

Slayd
Posts: 102
Joined: Mon Jul 25, 2011 4:57 am

Re: Trigger firing order

Post by Slayd »

Thanks, Vadi. Physical ordering/firing priority works out great for me.

Post Reply