BIS fnc encodeFlags4: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category\:Function Group\: Misc(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\]" to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 1: Line 1:
{{Function|Comments=
{{Function


| arma3 |Game name=
| arma3


|1.00|Game version=
|1.00


|gr1 = Bitwise |GROUP1=
|gr1 = Bitwise


<!---|arg= local |Multiplayer Arguments=--->
<!---|arg= local |Multiplayer Arguments=--->
Line 26: Line 26:
[1,0,2,3] -> 11 10 00 01 -> 225
[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
[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=
*/</pre>{{placeholder}}<!-- Remove this after fill-in -->


|[] call [[BIS_fnc_encodeFlags4]]|Syntax=
|[] call [[BIS_fnc_encodeFlags4]]


|p1= parameter: Datatype - (Optional, default defValue) description |Parameter 1=
|p1= parameter: Datatype - (Optional, default defValue) description


|Datatype - description|Return value=
|Datatype - description


|x1= <code></code>|Example 1=
|x1= <code></code>


| |See also=
|
}}
}}



Revision as of 23:59, 17 January 2021

Hover & click on the images for description

Description

Description:
/*
	Encodes array of unique 4-state flags (0,1,2,3) into a single number.

	Syntax:
	-------
	_encodedFlags:scalar = _flags:array call bis_fnc_encodeFlags4;

	Example:
	--------
	225 = [1,0,2,3] call bis_fnc_encodeFlags4;

	Explanation:
	------------
	[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
*/
Template:placeholder
Execution:
call
Groups:
Bitwise

Syntax

Syntax:
[] call BIS_fnc_encodeFlags4
Parameters:
parameter: Datatype - (Optional, default defValue) description
Return Value:
Datatype - description

Examples

Example 1:

Additional Information

See also:
See also needed

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