Error in @ignatz code

Hi All,

Can anyone help me, I have encountered a problem several times which is @Ignatz code. It involves passing parameters including a table in the following line:

function AddTerrain(...)
    local x,y,z,w,d,p,f,h,r,n,tbl,img,sc,hm,ns=Params(
    local nw,nd=math.floor(w/p),math.floor(d/p) --number of tiles in each direction
    --if no table of heights provided, generate one with noise
    if tbl==nil then

It reports an error as ‘attempt to index a nil value (local ‘tbl’)’. and refers to the last line in the above code. The code is checking to see if the table is occupied or not. The code is part of an early 3D terrain demo made by Ignatz.

This could be from the update to lua5.3 which handles parameters to functions slightly differently. Try putting {...} in place of arg at the end of the Params call (note: it might need some similar work in the Params function itself).

@LoopSpace - thanks for that, spot on resolved that issue and you were also correct in the parameters that all need reducing to integers. Always thought Lua needed an integer type, makes everything tidier. And more precise.