PMC websites shut down September 13th 2025 unless yearly web hosting fees are paid. Please Support PMC to help keep these websites online.

Enjoyed or found this pages content useful, please Support PMC to help me keep this web page online beyond september 13th 2025 when yearly web hosting fees are due.

User Tools

Site Tools


arma2:scripting:dedicated_server_broadcasting

This is an old revision of the document!


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”

Source.

arma2/scripting/dedicated_server_broadcasting.1279100166.txt.gz · Last modified: 2010/07/14 09:36 by snakeman