OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: beno_83au on 30 Jun 2009, 14:14:55
-
Will a publicvariable command work if it is used in an "On Activation" field of a trigger to make that trigger work on all computers in MP?
If so, would the command publicvariable "vel" be correct (trigger name being vel)?
If I have to put it in a script, could someone please show me how (incl. the "On Activation" field in the trigger if it's more than an exec "....sqs" command).
Cheers.
-
A trigger placed in the editor will always run on all machines, so there shouldn't be any need to use publicVariable to make them MP-compatible. A simple
vel = 12
in the activation will record the value on every machine.
The only time you need to use publicVariable with a trigger activation is if the activation calls a script that is only to be run on the server (e.g. has if (!isServer) exitWith {};
or ? !isServer : exit
at the top of it), which then publicVariables a value so that all machines can see it.
There are reasons for dealing with triggers in either way in MP. It really depends on the situation (but you might as well try the simpler method first and if it doesn't work as you'd like to, consider the latter one).
-
Hey cheers, that really cleared up the whole deal with the trigger. I'm not really one for scripting, I guess I'll get there someday, so it's good to know that the trigger will do the job.