publicVariable: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
m (Text replacement - "{{Command " to "{{RV|type=command ")
Line 1: Line 1:
{{Command
{{RV|type=command


| ofp
| ofp

Revision as of 12:40, 23 January 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
MultiplayerVariables

Syntax

Syntax:
Syntax needed
Parameters:
varName: String - the global variable's Identifier
Return Value:
Return value needed

Examples

Example 1:
TAG_MyPublicVariable = 0; TAG_MyPublicVariable = 1; publicVariable "TAG_MyPublicVariable"; // other clients will receive the "TAG_MyPublicVariable" variable with a 1 value TAG_MyPublicVariable = 2; // needs to be broadcast again - synchronisation is not automatic
Example 2:
JIP example: if (isNil "TAG_CurrentTarget") then // has the variable already been set and broadcast? { TAG_CurrentTarget = objNull; // if not, set it on the local machine }; player doTarget TAG_CurrentTarget;
Example 3:
TAG_BossName = "EvilBigBoss"; publicVariable TAG_BossName; // wrong - will try to publicVariable "EvilBigBoss" variable, that does not exist publicVariable "TAG_BossName"; // correct - do not forget the quotes

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note