Page MenuHomeFeedback Tracker

OMG, triggers are global!!!
Closed, ResolvedPublic


Oh BIS, what have you done this time???

If I create a trigger on a client assuming it will exist only on my client, I would be so wrong. The trrigger becomes global object just like createVehicle object. It will only trigger condition and statements will be local to the client even if I change trigger locality with set owner, however if I log out the trigger will automatically become local to the server just like any other MP object and will remain as such until the end. Any client that joins will be forced to synchronise and will also contain this trigger object.

This is nothing when you think of the implications. If you have 10 triggers set per client, after 20 people join, the server will have to sync 200 triggers, after 10 people leave and rejoin there will be 300 triggers. Run server for an hour with people constantly joining and leaving and... give yourself a facepalm :)


Legacy ID
No Bug
Steps To Reproduce

Start dedicated server and join

Create trigger on the client

_tr = createTrigger ["EmptyDetector", [0,0,0]];

run this on the server

diag_log [allMissionObjects "EmptyDetector", local ((allMissionObjects "EmptyDetector") select 0)];

The trigger is present on the server but it is not local to the server

Log out, log in run this again on the server

diag_log [allMissionObjects "EmptyDetector", local ((allMissionObjects "EmptyDetector") select 0)];

The trigger is still present but this time it is local to the server.

Feel free to rinse and repeat creating more triggers, they all will become server property when you log out.

Run on the client

hint str allMissionObjects "EmptyDetector"

Observe how all these dead triggers have been synced with your client and all JIP too.

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Multiplayer.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to No Bug.
Killzone_Kid set Legacy ID to 39333919.May 7 2016, 5:46 PM

This is intended behavior and it's consistent with those of other objects, like soldiers or vehicles.

createTrigger is analogous to createVehicle, not createVehicleLocal. It makes sense the trigger is created on every computer including server, but remains local to whoever created it. Once that machine disconnects, locality is naturally passed to the server.

As for trigger statements - one must remember that while trigger is created globally, setTriggerStatements and other trigger commands are local.

I don't think this issue is resolved at all.

  1. What is the point of keeping triggers global, why cant they be created similar to createvehiclelocal?
  1. Why keep dead triggers, those that become server property after client logs off, why keep syncing it with all clients?
  1. This means it is mission maker job to make sure all dead triggers are deleted, which calls for more clean up scripts, is this really necessary?

I'd like to hear a pro comment, as to what is good about having triggers created globally like this.


Server side triggers is the answer.