{"name":"setSide","operator":null,"title":"setSide","type":"command","url":"https://community.bistudio.com/wiki/setSide","revid":341632,"updated":"2023-06-12T19:02:54Z","groups":["Sides","Locations"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.08"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.08"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Sets a location's side. The default side is Unknown.\n\n> [!IMPORTANT]\n> To change a *unit*'s side, see #Notes.","syntaxes":[{"syntax":"location setSide side","since":null,"effect":null,"exec":null,"params":[{"name":"location","type":"Location","optional":false,"default":null,"description":null,"types":["Location"],"since":null,"text":"location: Location"},{"name":"side","type":"Side","optional":false,"default":null,"description":null,"types":["Side"],"since":null,"text":"side: Side"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"location","types":["Location"]},"right":{"text":"side","types":["Side"]}}],"examples":[{"text":"```sqf\n_myLocation setSide resistance;\n```","code":["_myLocation setSide resistance;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Side","side","west","east","resistance","civilian","sideUnknown","sideFriendly","sideEnemy","playerSide","Side Relations","independent"],"notes":[{"user":"Ondřejkuzel","date":"2013-12-03T16:00:00Z","text":"For units, vehicles you can use: `_unitsArray joinSilent createGroup _side`, e.g. in init: `[this] joinSilent createGroup EAST;` *described in the note below*"},{"user":"Jtgibson","date":"2009-08-06T19:05:00Z","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.)"}],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Locations","Command Group: Sides","Introduced with Armed Assault version 1.08","Scripting Commands","Take On Helicopters: Scripting Commands"]}