BIS fnc encodeFlags8: Difference between revisions

From Bohemia Interactive Community
m (Text replacement - " <!---|arg= local |Multiplayer Arguments=---> <!---|eff= local |Multiplayer Effects=---> " to " ")
No edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=function
{{RV|type=function


| arma3
|game1= arma3
|version1= 1.00


|1.00
|gr1= Bitwise


|gr1 = Bitwise
|descr= Encodes array of unique 8-state flags (0,1,2,3,4,5,6,7) into a single number.


| <pre>/*
|s1= flags call [[BIS_fnc_encodeFlags8]]
Encodes array of unique 8-state flags (0,1,2,3,4,5,6,7) into a single number.


Syntax:
|p1= flags: [[Array]] of [[Number]]s - collections of 8-state flags. Maximum number of flags is 12.
-------
_encodedFlags:scalar = _flags:array call bis_fnc_encodeFlags8;


Example:
|r1= [[Number]] - encoded flags
--------
4311 = [7,2,3,0,1] call bis_fnc_encodeFlags8;


Explanation:
|x1= <sqf>private _encodedFlags = [7, 2, 3, 0, 1] call BIS_fnc_encodeFlags8; // 4311</sqf>
------------
[7,2,3,0,1] -> 001 000 011 010 111 -> 0001 0000 1101 0111 -> 4311
*/</pre>{{placeholder}}<!-- Remove this after fill-in -->


|s1= [] call [[BIS_fnc_encodeFlags8]]
|seealso= [[BIS_fnc_decodeFlags8]]
 
|p1=
 
|r1=
 
|x1=
}}
}}
[[Category:{{Name|arma3}}: Functions|{{uc:encodeFlags8}}]]

Latest revision as of 21:05, 24 June 2025

Hover & click on the images for description

Description

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

Syntax

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

Examples

Example 1:
private _encodedFlags = [7, 2, 3, 0, 1] call BIS_fnc_encodeFlags8; // 4311

Additional Information

See also:
BIS_fnc_decodeFlags8

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