Difference between revisions of "side"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|game([0-9]) ?= (.+) \|version([0-9]) ?= (.+) " to "|game$1= $2 |version$3= $4 ")
 
(42 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|= Comments
+
{{RV|type=command
____________________________________________________________________________________________
 
  
| ofp |= Game name
+
|game1= ofp
 +
|version1= 1.00
  
|1.00|= Game version
+
|game2= ofpe
____________________________________________________________________________________________
+
|version2= 1.00
  
| Returns the side of a unit or object.
+
|game3= arma1
 +
|version3= 1.00
  
Once dead, a unit will be on the [[civilian]] side. Query the side of the [[Group]] to get a reliable result.
+
|game4= arma2
 +
|version4= 1.00
  
When used in conjunction with a [[format]] statement (<tt>hint [[format]]["%1",side player]</tt>), the returned strings are: <tt>"[[west|WEST]]"</tt>, <tt>"[[east|EAST]]"</tt>, <tt>"[[resistance|GUER]]"</tt>, <tt>"[[civilian|CIV]]"</tt>, <tt>"[[sideLogic|LOGIC]]"</tt>, <tt>"[[sideEnemy|ENEMY]]"</tt> (eg: renegades), <tt>"[[ambient life|AMBIENT LIFE]]"</tt> or <tt>"UNKNOWN"</tt>.
+
|game5= arma2oa
|= Description
+
|version5= 1.50
____________________________________________________________________________________________
 
  
| [[Side]] <nowiki>=</nowiki> '''side''' unitName |= Syntax
+
|game6= tkoh
 +
|version6= 1.00
  
|p1= unitName: [[Object]] or [[Group]] |= Parameter 1
+
|game7= arma3
 +
|version7= 0.50
  
| [[Side]] |= Return value
+
|arg= global
____________________________________________________________________________________________
 
 
 
|x1= <code>? (side [[player]] <nowiki>==</nowiki> [[west]]) : [[hint]] "You are on the West side."</code> SQS |= Example 1
 
  
|x2= <code>if (side [[player]] <nowiki>==</nowiki> [[west]]) then {[[hint]] "You are on the West side.";};</code> SQF |= Example 2
+
|gr1= Sides
  
|x3= <code>_sideAlsoWorkingForDead <nowiki>=</nowiki> side (group [[player]]);</code> |= Example 3
+
|descr= Returns the side of a unit, vehicle, object or location.
____________________________________________________________________________________________
+
* side of a renegade soldier is [[sideEnemy]]
 +
* side of an empty vehicle is [[civilian]]
 +
* side of a crewed vehicle is, if present, commander's > gunner's > driver's or > cargo's side, in this order
 +
* side of a captive or dead unit is [[civilian]]. Use {{ic|[[side]] [[group]] _unit}} to get the underlying side (see '''Example 2''')
 +
* you can use [[playerSide]] to know the real player's side
  
| [[CfgVehicles_Config_Reference#side|CfgVehicles config side value]], [[Side]], [[playerSide]], [[west]], [[east]], [[resistance]], [[civilian]], [[sideLogic]], [[sideFriendly]], [[sideEnemy]], [[sideUnknown]], [[side location]], [[Side relations]]|= See also
+
{{Feature | Informative | Converting a side to string will '''not''' always return the side command text: e.g {{ic|[[str]] [[resistance]] {{cc|returns "GUER"}}}}.<br>
 +
See [[Side]] page to see the return value of all side commands.}}
  
}}
+
|s1= [[side]] target
 +
 
 +
|p1= target: [[Object]], [[Group]] or [[Location]]
  
<h3 style="display:none">Notes</h3>
+
|r1= [[Side]]
<dl class="command_description">
 
<!-- Note Section BEGIN -->
 
<dd class="notedate">
 
<dt class="note">'''[[User:Ceeeb|Ceeeb]]'''
 
<dd class="note">In '''ArmA''', the following objects are on side [[civilian]]: dead bodies and vehicles, empty vehicles, all mission editor placed objects (that do not have an inherit side), all objects with interactive components such as ladders and doors, man made structures such as buildings (including classless wrp placed objects), docks, high tension powerlines, see-saws, large rubbish bins, fountains. Basically if an object uses a non-simple damage or physics simulation it is likely to be on the civilian side.
 
  
NOTE: If you need to know the side of a dead body, you can use [[faction]] command as a workaround -- [[User:Killzone_Kid|Killzone_Kid]]
+
|x1= <code>[[if]] ([[side]] [[player]] == [[west]]) [[then]] { [[hint]] "Player is on the West side" };</code>
  
<dd class="notedate">
+
|x2= <code>_sideAlsoWorkingForDead = [[side]] [[group]] _deadUnit;</code>
<dt class="note">'''[[User:Bdfy|Bdfy]]'''
 
<dd class="note">In '''OFP 1.96''', side return value for empty vehicles will be [[civilian]].
 
  
<dd class="notedate">
+
|x3= <code>_sideLocation = [[side]] myLocation;</code>
<dt class="note">'''[[User:Ceeeb|Ceeeb]]'''
 
<dd class="note">
 
In '''OFP v1.96''', the side return value for a vehicle is based on the side of it's commander, then gunner, then driver, then cargo. It will retain it's side value until it is either empty, or a unit of another side takes over in a equal or higher role, irrespective of the side of other units still on board. This can be used to simulate friendly fire, as a vehicle can be made to appear to be an enemy even though all units on board are actually friendly.
 
  
 +
|x4= <code>[[if]] ([[side]] [[player]] != [[playerSide]]) [[then]] { [[hint]] "player is renegade or dead"; };</code>
  
<dd class="notedate">
+
|x5= Check the [[side]] of the vehicle: <code>_vehicleSide = [[side]] [[group]] _vehicle; {{cc|[[sideUnknown]] (CIV for Arma 3) if empty or dead [[crew]], otherwise the appropriate [[side]]}}</code>
<dt class="note">'''[[User:Crowe|Crowe]]'''
 
<dd class="note">
 
Units with negative score(rating) are [[sideEnemy]].
 
  
 +
|seealso= [[CfgVehicles Config Reference#side|CfgVehicles Config Side Value]], [[Side]], [[playerSide]], [[west]], [[east]], [[resistance]], [[civilian]], [[sideLogic]], [[sideFriendly]], [[sideEnemy]], [[sideUnknown]], [[sideEmpty]], [[sideAmbientLife]], [[Side relations]], [[BIS_fnc_sideID]], [[BIS_fnc_objectSide]]
 +
}}
  
 +
<dl class="command_description">
 
<dd class="notedate">
 
<dd class="notedate">
<dt class="note">'''[[User:Shuko|Shuko]]'''
+
<dt class="note">[[User:Ceeeb|Ceeeb]]</dt>
<dd class="note">
+
<dd class="note">In '''{{arma}}''', the following objects are on side [[civilian]]: dead bodies and vehicles, empty vehicles, all mission editor placed objects (that do not have an inherit side), all objects with interactive components such as ladders and doors, man made structures such as buildings (including classless wrp placed objects), docks, high tension powerlines, see-saws, large rubbish bins, fountains. Basically if an object uses a non-simple damage or physics simulation it is likely to be on the civilian side.<br>
The [[Side]] for civilians is [[civilian]] and the string name of the side is "CIV". For Resistance/Independent (Guerilla) they are [[resistance]] and "GUER".
+
'''NOTE:''' If you need to know the side of a dead body, you can use [[faction]] command as a workaround -- [[User:Killzone_Kid|Killzone_Kid]]
 
+
<dt><dt>
 
<dd class="notedate">
 
<dd class="notedate">
<dt class="note">'''[[User:Tankbuster|Tankbuster]]'''
+
<dt class="note">[[User:Ceeeb|Ceeeb]]</dt>
<dd class="note">As CEEB says above, in '''ArmA2''', side for a vehicle often depends on who the command or driver is, for example, A KA52, piloted by a USMC guy will have side WEST. For an accurate result of what 'where the vehicle was made', use [[faction]]. This ignores the pilot/commander, so in my example here, this KA52 will always return faction "RU". Note that faction returns different values to side though.
 
 
 
<dd class="February 4, 2011">
 
<dt class="note">'''[[User:RKurtzDmitriyev|RKurtzDmitriyev]]'''
 
 
<dd class="note">
 
<dd class="note">
Side values for ambient life (animals) are bizarre. ''side _unit'' returns "CIV", but [[playerSide]] returns "AMBIENT LIFE" when the player is an animal. In that case, ''playerSide == side player'' returns false!
+
In '''{{ofp}} v1.96''', the side return value for a vehicle is based on the side of its commander, then gunner, then driver, then cargo. It will retain its side value until it is either empty, or a unit of another side takes over in a equal or higher role, irrespective of the side of other units still on board. This can be used to simulate friendly fire, as a vehicle can be made to appear to be an enemy even though all units on board are actually friendly.
 
+
<dt><dt>
Fortunately, you can easily check if a unit is an animal with ''_unit [[isKindOf]] "ANIMAL"'
 
 
 
 
 
 
<dd class="notedate">
 
<dd class="notedate">
<dt class="note">'''[[User:Lester|Lester]]'''
+
<dt class="note">[[User:Tankbuster|Tankbuster]]</dt>
 +
<dd class="note">As Ceeeb says above, in '''{{arma2}}''', side for a vehicle often depends on who the command or driver is, for example, A KA52, piloted by a USMC guy will have side WEST. For an accurate result of what 'where the vehicle was made', use [[faction]]. This ignores the pilot/commander, so in my example here, this KA52 will always return faction "RU". Note that faction returns different values to side though.
 +
<dt><dt>
 +
<dd class="notedate">February 4, 2011
 +
<dt class="note">[[User:RKurtzDmitriyev|RKurtzDmitriyev]]</dt>
 
<dd class="note">
 
<dd class="note">
Units who set via 'this setcaptive true' are always on side [[civilian]].
+
Side values for ambient life (animals) are bizarre. {{ic|[[side]] _unit}} returns "CIV", but [[playerSide]] returns "AMBIENT LIFE" when the player is an animal. In that case, {{ic|[[playerSide]] {{=}}{{=}} [[side]] player''}} returns false!
  
 +
Fortunately, you can easily check if a unit is an animal with {{ic|_unit [[isKindOf]] "ANIMAL"}}
  
 
<!-- Note Section END -->
 
</dl>
 
 
<h3 style="display:none">Bottom Section</h3>
 
[[Category:Scripting Commands|SIDE]]
 
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands OFP 1.96|SIDE]]
 
[[Category:Scripting Commands OFP 1.46|SIDE]]
 
[[Category:Scripting Commands ArmA|SIDE]]
 
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
 
 
<!-- CONTINUE Notes -->
 
<dl class="command_description">
 
<dd class="notedate">Posted on July 30, 2015 - 09:23 (UTC)</dd>
 
<dt class="note">[[User:IT07|IT07]]</dt>
 
<dd class="note">
 
This is probably the most confusing section of the wiki so here I give my clarification: <br>
 
In ArmA3 1.48, forEach'ing playableUnits to find certain players from certain sides, you will need to do it like this: <br>
 
<code>if (side _x isEqualTo EAST) then { diag_log format["%1's side is %2", name _x, side _x];</code><br>
 
Instead, this page might trick you into thinking that you will need to check for player's side like this: <br>
 
<code>side _x isEqualTo "EAST"</code> ^^^^^ That does NOT work.
 
</dd>
 
 
</dl>
 
</dl>
<!-- DISCONTINUE Notes -->
 

Latest revision as of 16:50, 3 May 2021

Hover & click on the images for descriptions

Description

Description:
Returns the side of a unit, vehicle, object or location.
  • side of a renegade soldier is sideEnemy
  • side of an empty vehicle is civilian
  • side of a crewed vehicle is, if present, commander's > gunner's > driver's or > cargo's side, in this order
  • side of a captive or dead unit is civilian. Use side group _unit to get the underlying side (see Example 2)
  • you can use playerSide to know the real player's side
Converting a side to string will not always return the side command text: e.g str resistance // returns "GUER".
See Side page to see the return value of all side commands.

Syntax

Syntax:
side target
Parameters:
target: Object, Group or Location
Return Value:
Side

Examples

Example 1:
if (side player == west) then { hint "Player is on the West side" };
Example 2:
_sideAlsoWorkingForDead = side group _deadUnit;
Example 3:
_sideLocation = side myLocation;
Example 4:
if (side player != playerSide) then { hint "player is renegade or dead"; };
Example 5:
Check the side of the vehicle: _vehicleSide = side group _vehicle; // sideUnknown (CIV for Arma 3) if empty or dead crew, otherwise the appropriate side

Additional Information

See also:
CfgVehicles Config Side ValueSideplayerSidewesteastresistanceciviliansideLogicsideFriendlysideEnemysideUnknownsideEmptysideAmbientLifeSide relationsBIS_fnc_sideIDBIS_fnc_objectSide
Groups:
Sides

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
Ceeeb
In Arma, the following objects are on side civilian: dead bodies and vehicles, empty vehicles, all mission editor placed objects (that do not have an inherit side), all objects with interactive components such as ladders and doors, man made structures such as buildings (including classless wrp placed objects), docks, high tension powerlines, see-saws, large rubbish bins, fountains. Basically if an object uses a non-simple damage or physics simulation it is likely to be on the civilian side.
NOTE: If you need to know the side of a dead body, you can use faction command as a workaround -- Killzone_Kid
Ceeeb
In Operation Flashpoint v1.96, the side return value for a vehicle is based on the side of its commander, then gunner, then driver, then cargo. It will retain its side value until it is either empty, or a unit of another side takes over in a equal or higher role, irrespective of the side of other units still on board. This can be used to simulate friendly fire, as a vehicle can be made to appear to be an enemy even though all units on board are actually friendly.
Tankbuster
As Ceeeb says above, in Arma 2, side for a vehicle often depends on who the command or driver is, for example, A KA52, piloted by a USMC guy will have side WEST. For an accurate result of what 'where the vehicle was made', use faction. This ignores the pilot/commander, so in my example here, this KA52 will always return faction "RU". Note that faction returns different values to side though.
February 4, 2011
RKurtzDmitriyev
Side values for ambient life (animals) are bizarre. side _unit returns "CIV", but playerSide returns "AMBIENT LIFE" when the player is an animal. In that case, playerSide == side player returns false! Fortunately, you can easily check if a unit is an animal with _unit isKindOf "ANIMAL"