BluesyBuesy Posted July 16, 2016 Share Posted July 16, 2016 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 Link to comment https://forums.kleientertainment.com/forums/topic/68897-no-bitwise-operators-in-dsts-lua/ Share on other sites More sharing options...
CarlZalph Posted July 16, 2016 Share Posted July 16, 2016 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 Link to comment https://forums.kleientertainment.com/forums/topic/68897-no-bitwise-operators-in-dsts-lua/#findComment-793594 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now