BIS fnc objectSide: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "Side relations" to "Side Relations")
 
(42 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|Comments=
|game1= arma3
____________________________________________________________________________________________
|version1= 1.00


| arma3 |Game name=
|gr1= Sides


| 1.00 |Game version=
|descr= Returns object side as defined in config (i.e. not affected by dynamic changing like rating)
____________________________________________________________________________________________


| Returns object side as defined in config (i.e. not affected by dynamic changing like rating) |DESCRIPTION=
|s1= [target, boolean] call [[BIS_fnc_objectSide]]
____________________________________________________________________________________________


| [target, boolean] call [[BIS_fnc_objectSide]] |SYNTAX=
|p1= target: [[Object]] - the object to be tested


|p1= target: [[Object]] - the object to be tested |PARAMETER1=
|p2= boolean: [[Boolean]] (optional) - false (default) to return actual object side, true to return the default config value


|p2= boolean: [[Boolean]] (optional) - false (default) to return actual object side, true to return the default config value |PARAMETER2=
|r1= [[Side]]


| [[Side]] |RETURNVALUE=
|s2= target call [[BIS_fnc_objectSide]]
 
|s2= target call [[BIS_fnc_objectSide]] |Alternative Syntax=


|p21= target: [[Object]] - the object to be tested. This syntax is equal to calling the method with [[false]] as a second parameter.
|p21= target: [[Object]] - the object to be tested. This syntax is equal to calling the method with [[false]] as a second parameter.


|r2= [[Side]] |= Alternative return value
|r2= [[Side]]
 
____________________________________________________________________________________________
 
|x1= <code>_realVehicleSide = [<nowiki/>[[vehicle]] [[player]], [[true]]] [[call]] [[BIS_fnc_objectSide]];</code> |EXAMPLE1=


|x2= <code>_unknownSide = [<nowiki/>'''[[objNull]]''', [[false]]] [[call]] [[BIS_fnc_objectSide]]; {{codecomment|// will return [[sideUnknown]]}}
|x1= <sqf>private _realVehicleSide = [vehicle player, true] call BIS_fnc_objectSide;</sqf>
_eastSide    = [<nowiki/>'''[[objNull]]''', [[true]]] [[call]] [[BIS_fnc_objectSide]]; {{codecomment|// will return [[east]]}}</code> |EXAMPLE2=


|x3= <code>{{codecomment|// same results}}
|x2= <sqf>
_result1 = myVehicle [[call]] [[BIS_fnc_objectSide]];
private _unknownSide = [objNull, false] call BIS_fnc_objectSide; // will return sideUnknown
_result2 = [myVehicle] [[call]] [[BIS_fnc_objectSide]];
private _eastSide    = [objNull, true] call BIS_fnc_objectSide; // will return east
_result3 = [myVehicle, false] [[call]] [[BIS_fnc_objectSide]];</code> |EXAMPLE3=
</sqf>
____________________________________________________________________________________________


| [[side]], [[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]] |SEEALSO=
|x3= <sqf>
// same results
_result1 = myVehicle call BIS_fnc_objectSide;
_result2 = [myVehicle] call BIS_fnc_objectSide;
_result3 = [myVehicle, false] call BIS_fnc_objectSide;
</sqf>


|seealso= [[side]] [[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]]
}}
}}


<h3 style="display:none">Notes</h3>
{{Note
<dl class="command_description">
|user= Tankbuster
<!-- Note Section BEGIN -->
|timestamp= 20200401172500
 
|text= When using this to get the side of vehicle drivers, be aware that when the boolean parameter is true, empty vehicles will return their driver as east.
<!-- Note Section END -->
</dl>
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Sides|{{uc:objectSide}}]]
[[Category:Functions|{{uc:objectSide}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:objectSide}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on April 1, 2020 - 17:25 (UTC)</dd>
<dt class="note">[[User:Tankbuster|Tankbuster]]</dt>
<dd class="note">
When using this to get the side of vehicle drivers, be aware that when the boolean parameter is true, empty vehicles will return their driver as east.
The same vehicle, when the boolean parameter is false, will return "UNKNOWN"
The same vehicle, when the boolean parameter is false, will return "UNKNOWN"
</dd>
}}
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 21:02, 12 June 2023

Hover & click on the images for description

Description

Description:
Returns object side as defined in config (i.e. not affected by dynamic changing like rating)
Execution:
call
Groups:
Sides

Syntax

Syntax:
[target, boolean] call BIS_fnc_objectSide
Parameters:
target: Object - the object to be tested
boolean: Boolean (optional) - false (default) to return actual object side, true to return the default config value
Return Value:
Side

Alternative Syntax

Syntax:
target call BIS_fnc_objectSide
Parameters:
target: Object - the object to be tested. This syntax is equal to calling the method with false as a second parameter.
Return Value:
Side

Examples

Example 1:
private _realVehicleSide = [vehicle player, true] call BIS_fnc_objectSide;
Example 2:
private _unknownSide = [objNull, false] call BIS_fnc_objectSide; // will return sideUnknown private _eastSide = [objNull, true] call BIS_fnc_objectSide; // will return east
Example 3:
// same results _result1 = myVehicle call BIS_fnc_objectSide; _result2 = [myVehicle] call BIS_fnc_objectSide; _result3 = [myVehicle, false] call BIS_fnc_objectSide;

Additional Information

See also:
side CfgVehicles config side value Side playerSide west east resistance civilian sideLogic sideFriendly sideEnemy sideUnknown sideEmpty sideAmbientLife Side Relations BIS_fnc_sideID

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
Tankbuster - c
Posted on Apr 01, 2020 - 17:25 (UTC)
When using this to get the side of vehicle drivers, be aware that when the boolean parameter is true, empty vehicles will return their driver as east. The same vehicle, when the boolean parameter is false, will return "UNKNOWN"