setSide: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
m (Text replacement - "Side relations" to "Side Relations")
 
(One intermediate revision by the same user not shown)
Line 21: Line 21:


|descr= Sets a location's [[Side|side]]. The default side is Unknown.
|descr= Sets a location's [[Side|side]]. The default side is Unknown.
{{Feature|important|To change a ''unit''<nowiki/>'s side, see {{Link|#Notes}}.}}


|s1= location [[setSide]] side
|s1= location [[setSide]] side
Line 32: Line 33:
|x1= <sqf>_myLocation setSide resistance;</sqf>
|x1= <sqf>_myLocation setSide resistance;</sqf>


|seealso= [[Side]] [[side]] [[west]] [[east]] [[resistance]] [[civilian]] [[sideUnknown]] [[sideFriendly]] [[sideEnemy]] [[playerSide]] [[Side relations]] [[independent]]
|seealso= [[Side]] [[side]] [[west]] [[east]] [[resistance]] [[civilian]] [[sideUnknown]] [[sideFriendly]] [[sideEnemy]] [[playerSide]] [[Side Relations]] [[independent]]
}}
}}


Line 38: Line 39:
|user= Ondřejkuzel
|user= Ondřejkuzel
|timestamp= 201312031600
|timestamp= 201312031600
|text= For units, vehicles you can use: {{ic|[[Array|array]] [[joinSilent]] [[createGroup]] [[Side]]}}, e.g. in init: "[this] joinSilent createGroup EAST;" ''described in the note below''
|text= For units, vehicles you can use: <sqf inline>_unitsArray joinSilent createGroup _side</sqf>, e.g. in init: <sqf inline>[this] joinSilent createGroup EAST;</sqf> ''described in the note below''
}}
}}


Line 44: Line 45:
|user= Jtgibson
|user= Jtgibson
|timestamp= 20090806190500
|timestamp= 20090806190500
|text= This is a frequent question on OFPEC, but produced here because it was difficult to find an answer to. '''setSide''' does not work for men, vehicles, etc.: it is intended for locations (''i.e.'', territory).  If you want to switch a unit's (''e.g.'', the player's) side in the middle of a battle, make the unit '''[[joinSilent]]''' a group on the given side instead.  If you want the unit to become the group leader after joining, use '''[[selectLeader]]'''.  I have not tested the idea of spawning a temporary unit of that side, assigning the player to that unit, setting the player as the leader, then deleting the original unit, but I don't see why it wouldn't work.  (It begs the question why we don't have a setSide object function, though.)
|text= This is a frequent question on OFPEC, but produced here because it was difficult to find an answer to. '''setSide''' does not work for men, vehicles, etc.: it is intended for locations (''i.e.'', territory).  If you want to switch a unit's (''e.g.'', the player's) side in the middle of a battle, make the unit '''[[joinSilent]]''' a group on the given side instead.  If you want the unit to become the group leader after joining, use '''[[selectLeader]]'''.  I have not tested the idea of spawning a temporary unit of that side, assigning the player to that unit, setting the player as the leader, then deleting the original unit, but I don't see why it wouldn't work.  (It begs the question why we don't have a setSide object function, though.)
}}
}}

Latest revision as of 21:02, 12 June 2023

Hover & click on the images for description

Description

Description:
Sets a location's side. The default side is Unknown.
To change a unit's side, see Notes.
Groups:
SidesLocations

Syntax

Syntax:
location setSide side
Parameters:
location: Location
side: Side
Return Value:
Nothing

Examples

Example 1:
_myLocation setSide resistance;

Additional Information

See also:
Side side west east resistance civilian sideUnknown sideFriendly sideEnemy playerSide Side Relations independent

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
Ondřejkuzel - c
Posted on Dec 03, 2013 - 16:00 (UTC)
For units, vehicles you can use: _unitsArray joinSilent createGroup _side, e.g. in init: [this] joinSilent createGroup EAST; described in the note below
Jtgibson - c
Posted on Aug 06, 2009 - 19:05 (UTC)
This is a frequent question on OFPEC, but produced here because it was difficult to find an answer to. setSide does not work for men, vehicles, etc.: it is intended for locations (i.e., territory). If you want to switch a unit's (e.g., the player's) side in the middle of a battle, make the unit joinSilent a group on the given side instead. If you want the unit to become the group leader after joining, use selectLeader. I have not tested the idea of spawning a temporary unit of that side, assigning the player to that unit, setting the player as the leader, then deleting the original unit, but I don't see why it wouldn't work. (It begs the question why we don't have a setSide object function, though.)