Bitwise Lua?

  • Videogamer555
    12th Dec 2011 Member 0 Permalink
    I read online that default Lua doesn't have bitwise commands (and, or, xor), but I'm wondering if the version that used in TPT has the optional expansion pack I read about that DOES have bitwise ops? Please let me know. Something I'd like to make would be a LOT easier if it had bitwise ops.
  • MasterMind555
    12th Dec 2011 Member 0 Permalink
    @Videogamer555 (View Post)
    What is it? I can't figure how you would need bitwise Lua...
  • mniip
    12th Dec 2011 Developer 0 Permalink
    As far as i remember it has or,and,not
    im not sure about xor
  • Simon
    12th Dec 2011 Administrator 0 Permalink
    @mniip (View Post)
    Lua has logical OR and AND (||, &&), but not bitwise (|, &)
  • Videogamer555
    12th Dec 2011 Member 0 Permalink
    I'd have some uses for generating some very interesting patterns using for loops, and bitwise operations to control the paticles created in a grid pattern using the current x and y coordinates.

    TPT has standard Lua only.
    Read here for some ways to implement bitwise ops in Lua using addon packages to Lua.
    http://lua-users.org/wiki/BitwiseOperators

    Please consider implementing these Lua addons in TPT.