setSide: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "Side relations" to "Side Relations")
 
(61 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1
|version1= 1.08


|1.08|= Game version
|game2= arma2
|version2= 1.00


|arg= |= Arguments in MP
|game3= arma2oa
|version3= 1.50


|eff= |= Effects in MP
|game4= tkoh
____________________________________________________________________________________________
|version4= 1.00


| Sets a location's [[Side|side]]. The default side is Unknown.|= Description
|game5= arma3
____________________________________________________________________________________________
|version5= 0.50


| location '''setSide''' side |= Syntax
|gr1= Sides


|p1= location: [[Location]] |= Parameter 1
|gr2= Locations
|p2= side: [[Side]] |= Parameter 2


| [[Nothing]] |= Return value
|descr= Sets a location's [[Side|side]]. The default side is Unknown.
____________________________________________________________________________________________
{{Feature|important|To change a ''unit''<nowiki/>'s side, see {{Link|#Notes}}.}}
 
|x1= <pre>myLocation setSide resistance</pre> |= Example 1
____________________________________________________________________________________________


| [[Side]], [[side]], [[west]], [[east]], [[resistance]], [[civilian]], [[sideUnknown]], [[sideFriendly]], [[sideEnemy]], [[playerSide]], [[side location]], [[Side relations]] |= See also
|s1= location [[setSide]] side


}}
|p1= location: [[Location]]


<h3 style="display:none">Notes</h3>
|p2= side: [[Side]]
<dl class="command_description">
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on 16:00, 3 December 2013 (CEST)
<dt class="note">'''[[User:Ondrejkuzel|Ondrejkuzel]]'''
<dd class="note">For units, vehicles you can use: "'''[[Array|array]] [[joinSilent]] [[createGroup]] [[Side]]'''", e.g. in init: "[this] joinSilent createGroup EAST;"  ''described in the note below''
<!-- Note Section END -->
<dd class="notedate">Posted on 19:05, 6 August 2009 (CEST)
<dt class="note">'''[[User:Jtgibson|Jtgibson]]'''
<dd class="note">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 haven't 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.)
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
|r1= [[Nothing]]


|x1= <sqf>_myLocation setSide resistance;</sqf>


[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
|seealso= [[Side]] [[side]] [[west]] [[east]] [[resistance]] [[civilian]] [[sideUnknown]] [[sideFriendly]] [[sideEnemy]] [[playerSide]] [[Side Relations]] [[independent]]
[[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Command_Group:_Locations|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]


{{subst:Add new note/construct|
{{Note
<!--
|user= Ondřejkuzel
* Replace from here (including the arrow just above)
|timestamp= 201312031600
 
|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''
* Please add your note here, replacing these comments
}}
* Please '''PREVIEW YOUR ADDITION BEFORE SAVING'''
* Thank you
 
* Equal symbols "=" should be added as "{{subst:=}}" (excluding quotes)
* Pipes "|" should be added as "{{subst:!}}" (excluding quotes)
* New lines should be forced by the use of "<br>" tags
* Examples should be placed between tags <code>_like {{subst:=}} [[_this]];</code>
 
* Video Tutorial: How to properly add notes: https://www.youtube.com/watch?v=NtOl1gLz3Fo (copy and paste)


* Replace to here (including the arrow just below)
{{Note
The remaining problem is: Side automatically changes when boarding an empty (then civilian) vehicle, for the _unit boarding side. So, you keep this side even if disembarking. The empty vehicle is no more civilian && could lead to weird conditions (as count list of the units' side)! A "SetSide" function, taking this point into account, will be appreciated.
|user= Jtgibson
|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.)
}}
}}

Latest revision as of 20: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.)