User Tools

Site Tools


Dedicated server broadcasting

Multiplayer dedicated server broadcasting to all clients.

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!";

If you have a version of the intel pickup that uses an action. You can skip the first trigger and use only the 2nd. In the script that runs from the action, you just place: intelFound = true; publicvariable “intelFound”

arma2/scripting/dedicated_server_broadcasting.txt · Last modified: 2015-08-22 01:48 (external edit)