local: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
(MP argument, formatting, added see also)
Line 5: Line 5:


|1.00|= Game version
|1.00|= Game version
|arg= global |= Arguments in MP
____________________________________________________________________________________________
____________________________________________________________________________________________


| Check if given unit is local on the computer in Multiplayer games (see [[Locality in Multiplayer]] for general concepts).
| 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 Singleplayer all objects are local.  
<br>This can be used when some activation fields or scripts need to be performed only on one computer. In Singleplayer all objects are local.  


''Note:'' Map created objects (those placed in [[Terrain_Editing|Visitor]]) are local everywhere. |= Description
<br>''Note:'' Map created objects (those placed in [[Terrain_Editing|Visitor]]) are local everywhere. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[Boolean]] <nowiki>=</nowiki> '''local''' object |= Syntax
| '''local''' object |= Syntax


|p1= object: [[Object]] |= Parameter 1
|p1= object: [[Object]] |= Parameter 1
Line 21: Line 23:
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= SQS <code> ?!'''local''' _unitName : goto "multi"</code> |= Example 1
|x1= SQS:<code> ?![[local]] _unitName : [[goto]] "multi"</code> |= Example 1


|x2= SQF <code> If ('''local''' _unitName) then { <br>    hint "multi"; <br> }; </code> |= Example 2
|x2= SQF:<code> [[if]] ([[local]] _unitName) [[then]] {
    [[hint]] "multi";
};</code> |= Example 2


____________________________________________________________________________________________
____________________________________________________________________________________________
Line 29: Line 33:
|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.|=


| |= See also
| [[Arma_3:_Event_Handlers#Local|Local Event Handler]], [[owner]], [[setOwner]] |= See also


}}
}}

Revision as of 22:32, 21 April 2014

Hover & click on the images for description

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 Singleplayer all objects are local.
Note: Map created objects (those placed in Visitor) are local everywhere.
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
Return Value:
Boolean

Examples

Example 1:
SQS: ?!local _unitName : goto "multi"
Example 2:
SQF: if (local _unitName) then { hint "multi"; };

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