There is a lack of native bitwise operations within the scripting language, making these calculations can often become difficult and full of many unnecessary operations without native support from the engine. These operations are very simple and primitive to many programming languages and should be included in Arma.
Possible syntax:
OR: _z = _x | _y; if( surfaceIsWater position player ) then { _z = _z | 16 }; // Sets a flag AND: _z = _x & _y; if( _x & 32 > 0 ) then { /* blah */ }; // Tests a flag XOR: _msg = []; { _msg pushBack (_x xor _key) } // ^ symbol is taken forEach toArray _str; // Decrypt message hint toString _msg; NOT: if( player distance _object > 10 ) then { _x = _x & (~ 64) }; // Clears a flag
Thank you for reading