I am attempting to read individual bits from a string of binary data. Everything works up until the point I call anything in the bit32 library. Calling this library produces the following error:
[Error] (Script) - lua scripts/def file classes/defsymbol.lua:20: attempt to index global 'bit32' (a nil value)
---------- START STACK TRACE ----------
I am aware that this bitwise operators library was originally shipped in Lua 5.2, backported to 5.1, and removed in 5.3 (replaced with <<, &, | and the like). Since this came up as an autocomplete option in the Lua Editor (it turned what appears to be purple when I completed the method call), and the documentation points to the 5.1 reference, I am guessing that Lumberyard is using a version of Lua 5.1 that should have this library backported into it.
My question is as follows:
- Is this library actually available in Lumberyard’s version of Lua?
- If so, how do I access it? Is this a problem with my LUA_PATH/LUA_CPATH environment variables, or some other configuration thing?
The only workaround I can think of so far is to make the operations myself. I already checked the 5.3 operators, and those symbols aren’t recognized.
- If so, how do I access it? Is this a problem with my LUA_PATH/LUA_CPATH environment variables, or some other configuration thing?
The offending line of code that I used to test:
a = bit32.bor(1,4)