local: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \{\{GameCategory\|[a-z]+[0-9]?\|Scripting Commands\}\}" to "") |
Lou Montana (talk | contribs) m (Text replacement - "// since Arma 3" to "// since {{arma3}}") |
||
(23 intermediate revisions by the same user not shown) | |||
Line 26: | Line 26: | ||
|arg= global | |arg= global | ||
|descr= Check if given unit is local on the computer in | |descr= Check if given unit is local on the computer in multiplayer games - see {{Link|Multiplayer Scripting#Locality}}.<br> | ||
This can be used to determine on which computer some code must be run. In | This can be used to determine on which computer some code must be run. In single player all objects are local. | ||
|mp= A few things to note [[Multiplayer Scripting#General information about locality | |mp= A few things to note [[Multiplayer Scripting#General information about locality|amongst others]]: | ||
| | |||
* A game logic / module is always local to the server | * A game logic / module is always local to the server | ||
* Terrain objects are local to every machine | * Terrain objects are local to every machine | ||
|s1= | |s1= [[local]] object | ||
|p1= object: [[Object]] or [[Group]] (since | |p1= object: [[Object]] or [[Group]] (since {{GVI|arma3|1.32|size= 0.75}}) | ||
|r1= [[Boolean]] | |r1= [[Boolean]] | ||
|s2= [[local]] variable = value <span style="margin-left: 7em">{{Color|red|From {{arma2}} until {{arma3}} v1.54}} - see '''[[private]]''' for later versions</span> | |s2= [[local]] variable = value <span style="margin-left: 7em">'''{{Color|red|From {{arma2}} v1.00 until {{arma3}} v1.54}}''' - see '''[[private]]''' for later versions</span> | ||
|s2since= arma2 1.00 | |||
|r2= [[Nothing]] | |r2= [[Nothing]] | ||
|x1= < | |x1= <sqf> | ||
if (not local _unit) then | |||
};</ | { | ||
hint format ["%1 is remote", name _unit]; | |||
}; | |||
</sqf> | |||
|x2= < | |x2= <sqf>_isLocalGroup = local group _unit;</sqf> | ||
|x3= Sets variable's [[Variables#Scopes|scope]]:< | |x3= Sets variable's [[Variables#Scopes|scope]]: | ||
<sqf> | |||
// from Arma 2 v1.00 until Arma 3v1.54 | |||
local _myVariable = 42; | |||
// since {{arma3}} v1.54 | |||
private _myVariable = 42; | |||
</sqf> | |||
|seealso= | |seealso= [[Arma 3: Event Handlers#Local|"Local" Event Handler]] [[owner]] [[setOwner]] | ||
}} | }} |
Latest revision as of 18:02, 18 November 2023
Description
- Description:
- Check if given unit is local on the computer in multiplayer games - see Multiplayer Scripting - Locality.
This can be used to determine on which computer some code must be run. In single player all objects are local. - Multiplayer:
- A few things to note amongst others:
- A game logic / module is always local to the server
- Terrain objects are local to every machine
- Groups:
- Multiplayer
Syntax
Alternative Syntax
- Syntax:
- local variable = value From Arma 2 v1.00 until Arma 3 v1.54 - see private for later versions
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
- Example 3:
- Sets variable's scope:
Additional Information
- See also:
- "Local" Event Handler owner setOwner
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
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Multiplayer