Hi,
I have started to play with Lua (on Linux) and terrain functions. Using some code that I copied and modified from the following post http://www.leadwerks.com/werkspace/topic/10978-procedural-terrain/page__hl__terrain
While I was changing the code to get it to work for me, I noticed some function do not come up as blue in the IDE, and most of the functions (in this case) can not be found in the online documentation but work.
Maybe I searched the wrong area, but I would assume it was in the Documentation link on the main website menu (full site search did not help anyway).
eg: SetLayerTexture, SetHeight, Terrain
Here's my code, that does not yet do anything than create a slightly raise block of terrain (specially only a 1/4 of the terrain is raised for testing purposes)
So I know most of the functions work, but it was a long trial an error process to get here. I would rather have some documentation tat exposed all the function/elements I can call/use)
function Script:Start()
local terrainSize = 128
terrain = Terrain:Create(terrainSize, true);
terrain:SetLayerTexture(0, Texture:Load("AddOns/mountain_grass.tex"), 0);
terrain:SetLayerTexture(0, Texture:Load("AddOns/mountain_grassdot3.tex"), 1);
for y = 0, 64 - 1, 1 do
for x = 0, 64 -1, 1 do
height = myFuncT_Interpolate(x / 100.0, y / 100.0, 1.0);
terrain:SetHeight(x,y,height);
terrain:SetScale(1.5, 1.5, 1.5);
end
end
end
cheers
rich