The locality of commands

By Spooner and Mandoble

The locality of a command covers two different concepts:

  • The locality of the unit that is affected by the command
  • The locality of the effects that result from the command

There are commands which require that the unit affected to be local to the machine where the command is executed. Other commands will affect any unit, local or not, from where they are executed. For example, if you set the velocity vector of a vehicle from a machine where this vehicle is not local, the command will have not effect at all, and not because the effects of the command are not global, but because the command requires that the affected unit must be local to the machine where the command is executed.

The effects of each command might also be local or global. If the effect of the command is not global, the effects will be "seen" only in the machine where the command has been executed. For example, titleText, since the text displayed will be seen only where the command is being executed. The same is true of say or playSound, or any of the chat commands. To ensure a global effect using local effect commands you need to transmit some info that triggers the same command in every machine; for that purpose you may use triggers and the publicVariable command. (Ah, before you ask, the drop, and other particle effect, commands may be executed on any machine, but the effects of it are local, so you should take care to execute particle scripts on every machine to have similar effects on all of them).

Check the BIS WIKI for more detailed information about which commands only affect local units and which commands have only a local effect.