generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Efficient way to simulate bitwise operations in Lua

Previous Thread :: Next Thread 
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jul 2014 06:01 PM
Since Lua has no official support for these types of operations (or at least Lua 5.1) and I can't implement them C-sided since, well, I don't own Roblox (and I plan on making a GUI-based game on Roblox).

Anyways, to the point: How are some efficient ways to implement the OR and AND operations (bit-shifting was easy since all I needed was powers and division) without string manipulation?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jul 2014 06:16 PM
Bump
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
21 Jul 2014 06:19 PM
If I'm not mistaken, Lua 5.2 allows you to do this, correct?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jul 2014 06:21 PM
Yeah I believe there is a "bit32" table IIRC
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
21 Jul 2014 06:21 PM
I thought so.
I wonder why ROBLOX won't implement Lua 5.2.
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
21 Jul 2014 06:22 PM
From the Lua.org website:

Lua 5.2 was released on 16 Dec 2011. Its main new features are yieldable pcall and metamethods, new lexical scheme for globals, ephemeron tables, new library for bitwise operations, light C functions, emergency garbage collector, goto statement, and finalizers for tables.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jul 2014 06:23 PM
I assume their sandboxing includes functions not available in Lua 5.2 (setfenv, getfenv, newproxy, etc.) and they don't want to make it compatible and they don't want to make some scripts break.
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
21 Jul 2014 06:24 PM
They could just re-implement the built-in ROBLOX functions into Lua 5.2
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jul 2014 06:26 PM
Lua 5.3 yay
http://www.lua.org/work/doc/
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
21 Jul 2014 06:27 PM
What will Lua 5.3 include?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jul 2014 06:30 PM
support for integers (64-bit by default)
better support for small architectures ("Small Lua" with 32-bit numbers)
bitwise operators
basic utf-8 library
utf-8 escapes in literal strings
functions for packing/unpacking numbers
userdata can have any Lua value as uservalue
strip option in lua_dump/string.dump

BITWISE operators is the only thing I'm looking forward to (and if integers are actually 64-bit, can the bit operators be used on them O_o it's like something JavaScript hasn't done yet)
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
21 Jul 2014 06:42 PM
I picked up this model a while ago:
http://www.roblox.com/Bitwise-Operations-item?id=55099988

I haven't found any particular use for it; I'd be interested to hear what you're doing that requires bitwise operations.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jul 2014 06:51 PM
I'll take a look at it, thanks in advanced.

Also, it's just for a poker hand analyzer (as opposed to an older brute-force search that was terribly inefficient).
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jul 2014 06:52 PM
in advance* and I'm just remaking one I made a long time ago that required a gigantic lookup table.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Jul 2014 06:56 PM
That source seems to use string manipulation which is not really what I am aiming for. If last comes to last I guess I'll do it that way.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
22 Jul 2014 03:40 AM
Bump
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
22 Jul 2014 06:48 AM
Bump
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Jul 2014 10:08 PM
Bump
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
24 Jul 2014 12:55 AM
I know nothing about bitwise operators and should probably look them up, but here's a script that blocco made that maybe/probably won't be helpful:
http://www.roblox.com/Edge-Specific-Outlines-item?id=126404193

I only post it because it has some functions that look nifty.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Jul 2014 12:58 AM
I'll take a look at it, also they're not complicated and anyone can learn them in probably 10 minutes or less
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Jul 2014 01:23 AM
Oo thanks
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image