Page 1 of 1

No command performed by triggering PlayerCommandTrigger at startup

Posted: Sat Apr 14, 2018 6:42 pm
by JakSparro98
First case

If a PlayerSpawnTrigger has an ID greater then the PlayerCommandTrigger, no actions will be triggered if the PlayerCommand trigger is triggered on startup.

Second case

PlayerCommandTrigger has an ID greater than PlayerSpawnTrigger (in a few words they works) but if one of this two tiles are changed of arrangement (rendering depth on the same layer or even on two different layers) they won't be triggered anymore.

Example map

Re: No command performed by triggering PlayerCommandTrigger at startup

Posted: Sat Apr 14, 2018 8:17 pm
by Gurt
Haven't looked at the map but based on the description the order in which triggers are triggered on startup is not guaranteed - it depends.
If you need a sequence of triggers being triggered in a specific order - like A, B and last C then you must let A trigger B and let B trigger C. Only A must be set to activate on startup. If all triggers activate on startup you may get one of the following orders: ABC, ACB, BAC, BCA, CAB, CBA. If trigger B is dependent upon trigger A then you can not let both A and B activate on startup as the order in which they activate are undefined/random from a map makers point of view.
Hope that makes some sense.

Re: No command performed by triggering PlayerCommandTrigger at startup

Posted: Sat Apr 14, 2018 9:16 pm
by JakSparro98
Gurt wrote:
Sat Apr 14, 2018 8:17 pm
Haven't looked at the map but based on the description the order in which triggers are triggered on startup is not guaranteed - it depends.
If you need a sequence of triggers being triggered in a specific order - like A, B and last C then you must let A trigger B and let B trigger C. Only A must be set to activate on startup. If all triggers activate on startup you may get one of the following orders: ABC, ACB, BAC, BCA, CAB, CBA. If trigger B is dependent upon trigger A then you can not let both A and B activate on startup as the order in which they activate are undefined/random from a map makers point of view.
Hope that makes some sense.
This is perfectly what I was aware, some years ago I experimented that "race condition-like" issue, but this is a bit different.

I assume that game tiles are spawned in progressive order from 0 to the last generated ID and when a PlayerCommandTrigger with ID 2 is spawned it is immediately triggered if the startup option is set to true and let's say that his target was a PlayerSpawnTrigger with ID 13, this will result in a ghost action since the tile with ID 13 was not spawned yet (or at least this is what it seems).
Same problem when PlayerSpawnTrigger and PlayerCommandTrigger are on a different layer/ different render depth, the command is not performed at all, it's not a race condition effect.

I want to make notice that this is only related to the PlayerCommandTrigger and maybe other player related triggers, all other trigger are normally triggered regardless their triggering order.