BIS fnc encodeFlags4: Difference between revisions

From Bohemia Interactive Community
m (Text replacement - "{{Function|= Comments " to "{{Function|Comments= ")
No edit summary
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function


| arma3 |Game name=
|game1= arma3
|version1= 1.00


|1.00|Game version=
|gr1= Bitwise


<!---|arg= local |Multiplayer Arguments=--->
|descr= Encodes array of unique 4-state flags (0,1,2,3) into a single number.


<!---|eff= local |Multiplayer Effects=--->
|s1= flags call [[BIS_fnc_encodeFlags4]]


| <pre>/*
|p1= flags: [[Array]] of [[Number]]s - collections of 4-state flags. Maximum number of flags is 12.
Encodes array of unique 4-state flags (0,1,2,3) into a single number.


Syntax:
|r1= [[Number]] - encoded flags
-------
_encodedFlags:scalar = _flags:array call bis_fnc_encodeFlags4;


Example:
|x1= <sqf>private _encodedFlags = [1, 0, 2, 3] call BIS_fnc_encodeFlags4; // 225</sqf>
--------
225 = [1,0,2,3] call bis_fnc_encodeFlags4;


Explanation:
|seealso= [[BIS_fnc_decodeFlags4]]
------------
[1,0,2,3] -> 11 10 00 01 -> 225
[0,0,0,0,0,0,0,1] -> 01 00 00 00 00 00 00 00 -> 0100 0000 0000 0000 -> 16384
*/</pre>{{placeholder}}<!-- Remove this after fill-in --> |Description=
 
|[] call [[BIS_fnc_encodeFlags4]]|Syntax=
 
|p1= parameter: Datatype - (Optional, default defValue) description |Parameter 1=
 
|Datatype - description|Return value=
 
|x1= <code></code>|Example 1=
 
| |See also=
}}
}}
[[Category:Function Group: Misc|{{uc:encodeFlags4}}]]
[[Category:Functions|{{uc:encodeFlags4}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:encodeFlags4}}]]

Latest revision as of 19:58, 24 June 2025

Hover & click on the images for description

Description

Description:
Encodes array of unique 4-state flags (0,1,2,3) into a single number.
Execution:
call
Groups:
Bitwise

Syntax

Syntax:
flags call BIS_fnc_encodeFlags4
Parameters:
flags: Array of Numbers - collections of 4-state flags. Maximum number of flags is 12.
Return Value:
Number - encoded flags

Examples

Example 1:
private _encodedFlags = [1, 0, 2, 3] call BIS_fnc_encodeFlags4; // 225

Additional Information

See also:
BIS_fnc_decodeFlags4

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