Fandom

World in Conflict Tool for ArmA2 Wiki

Double trigger method

32pages on
this wiki
Add New Page
Comments0 Share

This is excellent solution for making mission for MP from thread Dedicated Server - text broadcast to all?.

Shk made a comment and I am quoting him here with some remarks and highlights:

Triggers are local to each machine. All text display commands are local as well.

The secret to MP editing is command called publicVariable. It's used to sync stuff between server and clients.

Here is a generic example of a double trigger approach to make sure something gets triggered/ran on everyone:

Trigger 1
Condition: !alive dude
onAct: obj1 = true; publicvariable "obj1"
Trigger 2
Condition: obj1
onAct: task1 settaskstate "succeeded"

The basic idea is to have a trigger with the condition to suit whatever you are trying to wait for. Once that trigger is fired on any machines, it will set a variable as true and tell everyone else.

Trigger 2 is used to catch the true variable sent from someone. In it's onAct you run the code that should be ran for everyone. It can be anything, set taskstate, display text, end mission.

Another example, for the intel search. This covers only case where you put an area trigger over the intel and wait for a player to just come close enough.

Trigger 1
Condition: this (set trigger side/area etc normally)
onAct: intelFound = true; publicvariable "intelFound"
Trigger 2
Condition: intelFound
onAct: taskIntel settaskstate "succeeded"; hint "Intel was found, yay!";

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.