local: Difference between revisions
Jump to navigation
Jump to search
m (Extended note to prevent confusion in the change as current note seems like whole local command got moved into private) |
m (template:command argument fix) |
||
Line 14: | Line 14: | ||
<br><br>'''Note1:''' Map created objects (those placed in [[Terrain_Editing|Visitor]]) are local everywhere. | <br><br>'''Note1:''' Map created objects (those placed in [[Terrain_Editing|Visitor]]) are local everywhere. | ||
<br>'''Note2:''' Since Arma 3 v1.53.132932 keyword [[local]] has been renamed to [[private]] for consistency and to avoid any confusion. However, this just makes the third example obsolete. It's core functionality still remains. |= | <br>'''Note2:''' Since Arma 3 v1.53.132932 keyword [[local]] has been renamed to [[private]] for consistency and to avoid any confusion. However, this just makes the third example obsolete. It's core functionality still remains. |DESCRIPTION= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| '''local''' object |= | | '''local''' object |SYNTAX= | ||
|p1= object: [[Object]] or [[Group]] (since Arma 3 v1.31.127204) |= | |p1= object: [[Object]] or [[Group]] (since Arma 3 v1.31.127204) |PARAMETER1= | ||
| [[Boolean]] |= | | [[Boolean]] |RETURNVALUE= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= SQS:<code>?![[local]] _unitName : [[hint]] "remote"</code> |= | |x1= SQS:<code>?![[local]] _unitName : [[hint]] "remote"</code> |EXAMPLE1= | ||
|x2= SQF:<code>[[if]] (![[local]] _unitName) [[then]] { | |x2= SQF:<code>[[if]] (![[local]] _unitName) [[then]] { | ||
[[hint]] "remote"; | [[hint]] "remote"; | ||
};</code> |= | };</code> |EXAMPLE2= | ||
|x3= <code>_isLocalGroup = [[local]] [[group]] _unit;</code> |= | |x3= <code>_isLocalGroup = [[local]] [[group]] _unit;</code> |EXAMPLE3= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|pr= In MP remote objects are not initialised in functions called by initline or init eventhandlers.|= | |pr= In MP remote objects are not initialised in functions called by initline or init eventhandlers.|= | ||
| [[Arma_3:_Event_Handlers#Local|Local Event Handler]], [[owner]], [[setOwner]] |= | | [[Arma_3:_Event_Handlers#Local|Local Event Handler]], [[owner]], [[setOwner]] |SEEALSO= | ||
}} | }} |
Revision as of 14:43, 7 April 2019
Description
- Description:
- Check if given unit is local on the computer in Multiplayer games (see Locality in Multiplayer for general concepts).
This can be used when some activation fields or scripts need to be performed only on one computer. In Single player all objects are local.
Note1: Map created objects (those placed in Visitor) are local everywhere.
Note2: Since Arma 3 v1.53.132932 keyword local has been renamed to private for consistency and to avoid any confusion. However, this just makes the third example obsolete. It's core functionality still remains. - Problems:
- In MP remote objects are not initialised in functions called by initline or init eventhandlers.
- Groups:
- Uncategorised
Syntax
- Syntax:
- local object
- Parameters:
- object: Object or Group (since Arma 3 v1.31.127204)
- Return Value:
- Boolean
Examples
- Example 1:
- SQS:
?!local _unitName : hint "remote"
- Example 2:
- SQF:
if (!local _unitName) then { hint "remote"; };
- Example 3:
_isLocalGroup = local group _unit;
Additional Information
- See also:
- Local Event HandlerownersetOwner
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
Notes
- Posted on August 4, 2006 - 10:56
- hardrock
- Notes from before the conversion: In multiplayer, a game logic will always be local to the host computer. This works on both dedicated and player-hosted servers.
Bottom Section
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands OFP 1.99
- Scripting Commands OFP 1.96
- Scripting Commands OFP 1.46
- Scripting Commands ArmA
- Command Group: Multiplayer
- Command Group: Object Information
- Scripting Commands ArmA2
- Scripting Commands Arma 3
- Scripting Commands Take On Helicopters