Search found 5 matches

by posfan12
Thu Sep 12, 2013 1:04 am
Forum: Libraries and Tools
Topic: RandomLua Library
Replies: 31
Views: 33558

Re: RandomLua Library

OK, thanks. I got it working.
by posfan12
Wed Sep 11, 2013 12:57 pm
Forum: Libraries and Tools
Topic: RandomLua Library
Replies: 31
Views: 33558

Re: RandomLua Library

This one works! No duplicate values after 10000 iterations. I just need to figure out how to rewrite all my scripts. Currently I just pass the seeds to whatever functions need them. For instance, local my_seed_1 = {977322} function srandom(seedobj, fVal1, fVal2) seedobj[1] = mod(seedobj[1] * 1103515...
by posfan12
Tue Sep 10, 2013 4:55 pm
Forum: Libraries and Tools
Topic: RandomLua Library
Replies: 31
Views: 33558

Re: RandomLua Library

I ran TestLuaNumberFormat() and got "Feels like single-precision floating-point number".
by posfan12
Tue Sep 10, 2013 3:18 am
Forum: Libraries and Tools
Topic: RandomLua Library
Replies: 31
Views: 33558

Re: RandomLua Library

I'm working on a game called Homeworld 2 which was released in 2003 and uses Lua 4.0.

I had another person test my script and it worked OK in Lua 4.0.1, so I am SOL I guess unless someone has a better suggestion... :(
by posfan12
Mon Sep 09, 2013 9:31 pm
Forum: Libraries and Tools
Topic: RandomLua Library
Replies: 31
Views: 33558

Re: RandomLua Library

I'm trying to use these scripts in Lua 4.0. Here's my attempt of doing the translation. Lua 4 doesn't have a "setmetatable" function, so I made a guess at what to do in my case. function lcg(s, r) local temp = {} function temp:random(a, b) local y = mod(self.a * self.x + self.c, self.m) se...