Jump to content

Is the Documentation Complete?


RichL
 Share

Recommended Posts

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

Link to comment
Share on other sites

If it's undocumented, it's not an officially supported feature. This can mean it's subject to change, or it may be just too complicated that we don't want it part of the API. There are many classes in Leadwerks that are considered to be for internal use only.

 

At this time, the terrain is meant to be created in the editor, not with code.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Thanks Josh.

 

Is it likely that other Terrain commands (not for creation) will become part of the documented API? Like GetElevation for scripted object placement?

What I have been doing is referring back to the older LE2 docs concerning terrain. Terrain:GetElevation() - the command name has changed but the parameters are very much like the previous version.

  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...