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(
{"x","y","z","width","depth","tileSize","minY","maxY","random","noiseLevel",
"heightTable","img","scaleFactor","heightMaps","noiseStep"},arg)
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.