Triggers - Chained "Value of Real Variable" events bug

Hello,

With much testing I discovered a bug with “Value of Real Variable” events in custom maps.

In short: the listener for “Value of Real Variable” events cannot be chained, because the 2nd listener will abort the first event, firing another event with a different real value instead.

To produce the bug you need the following triggers (in order):

  • A trigger1 that fires a sets the variable Real1 = 5.
  • A trigger2 that listens “Value of Real Variable” Real1 = 5, and then sets the variable Real2 = 10.
  • A trigger3 that listens “Value of Real Variable” Real1 = 5, and for example displays a log.
  • A trigger4 that listens “Value of Real Variable” Real2 = 10, and for example displays a log.
  • A trigger5 that listens an even THAT SHOULD NOT HAPPEN: “Value of Real Variable” Real1 = 10, and displays a log.

Then you will see the following behavior:

  • trigger1 fires the event “Real1 = 5”.
  • trigger2 detectes the event “Real1 = 5”, and fires an event “Real2 = 10”
  • trigger4 detects the event “Real2 = 10”.
  • trigger3 is never called: event “Real1 = 5” HAS BEEN ABORTED.
  • trigger5 is called: a NOT EXPECTED event “Real1 = 10” happens.

The issue disappears if there is no trigger4 . Probably because the listeners use a static reference ? Or if you add a “Wait 0.00s” before emitting the second event, so that it’s not chained but on 2 different frames.

Below is a copy of the necessary triggers:

Fire Event1 equal 5 on init
    Events
        Map initialization
    Conditions
    Actions
        Game - Display to (All players) the text: Firing "Event1 = 5....
        Set VariableSet Event1 = 5.00

Chain Events
    Events
        Game - Event1 becomes Equal to 5.00
    Conditions
    Actions
        Game - Display to (All players) the text: "Event1 = 5" detect...
        Set VariableSet Event2 = 10.00

Listener Event1 equals 5
    Events
        Game - Event1 becomes Equal to 5.00
    Conditions
    Actions
        Game - Display to (All players) the text: Log: "Event1 = 5" d...

Listener Event1 equals 10
    Events
        Game - Event1 becomes Equal to 10.00
    Conditions
    Actions
        Game - Display to (All players) the text: Log: "Event1 = 10" ...

Listener Event2 equals 10
    Events
        Game - Event2 becomes Equal to 10.00
    Conditions
    Actions
        Game - Display to (All players) the text: Log: "Event2 = 10" ...