[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Math.Random() always returns 0
- From: "Beric Holt" <beric@...>
- Date: Wed, 24 May 2006 22:02:59 +1200
I've just finished upgrading my TileEngine game platform to use Lua
Everything is working fine, in fact I've even added better error
handling while loading scripts instead of using the old lua_dofile
syntax. The only problem is that math.random() always returns zero,
even when called with parameters eg:
iResult = math.random(750,2000)
I use the random functionality for my Actor AI, so when it returns zero
all of the actors just stand there mutely.
I have randomised the seed with "math.randomseed( os.time())".
Does anyone have any suggestions on why this might be happening?