Jump to content

Recommended Posts

I'm trying to implement a custom PRNG in Lua so that I can have seeds be cross-platform compatible, but DST doesn't recognize bit32. Does DST/DS have some other bitwise library, or am I just out of luck?

According to http://lua-users.org:

Quote

As of version 5.2, Lua ships with the library [bit32] that adds support for bitwise operations.Previous versions of Lua did not include bitwise operators, but bit32 has been backported to version 5.1.

And according to this:

Quote

For Don’t Starve and Don’t Starve Together, we are using a slightly modified version of LUA 5.1.4

 

Unfortunately they didn't expose bitwise operations.

 

See: Collision masks.

You'd need to clear the collision mask and then individually add each mask bit as the C-side handles the bitwise operations.

 

Something you'd need to do is either make your own bitwise operators in LUA, ask a dev to shove it in, or use one of the already made pure-LUA code samples found below.

http://lua-users.org/wiki/BitwiseOperators

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...