Page 1 of 1

[solved] lua math.randomseed error

Posted: 04 Apr 2015, 14:45
by qray
I have a problem with a lua script: http://pastebin.com/P3pKCSkL
(used for example in the map core platform - to test: spawn via cheat a unit in the voidground/water area).

I use there in line 222 math.randomseed which works totally fine on my main computer. Today, I tested on another system (main difference: spring 96 instead of 98, in case it matters).
There, I get this error message:

Code: Select all

[f=0000451] Error: LuaRules::RunCallIn: error = 2, GameFrame, [string "LuaRules/Gadgets/void.lua"]:222: attempt to call field 'randomseed' (a nil value)
stack traceback:
	[string "LuaRules/Gadgets/void.lua"]:222: in function 'findVoidUnits'
	[string "LuaRules/Gadgets/void.lua"]:155: in function 'GameFrame'
	[string "LuaRules/gadgets.lua"]:838: in function <[string "LuaRules/gadgets.lua"]:836>
	(tail call): ?
Any idea why it works on one system and not on the other? In my ignorance I thought lua math functions would be available everywhere.

Re: lua math.randomseed error

Posted: 04 Apr 2015, 14:59
by FLOZi
spring 96 instead of 98, in case it matters
Yes

Added in 97

https://github.com/spring/spring/blob/d ... g.txt#L235

Re: lua math.randomseed error

Posted: 04 Apr 2015, 15:06
by qray
Ah! Thanks!

So I do not have to go bug hunting (just work on my ignorance) :wink: