RichL Posted November 9, 2014 Share Posted November 9, 2014 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 Quote Link to comment Share on other sites More sharing options...
RichL Posted November 10, 2014 Author Share Posted November 10, 2014 *bump* so have I got it wrong on the undocumented commands? (i.e. there are none?) Quote Link to comment Share on other sites More sharing options...
cassius Posted November 10, 2014 Share Posted November 10, 2014 As far as I know most of the documentation is there.Updates sometimes cause a lag however. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Haydenmango Posted November 11, 2014 Share Posted November 11, 2014 The Terrain functions have no documentation. I would like to see them documented because I can't get half of the functions to work and it is a pain trying to figure it out. Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
RichL Posted November 11, 2014 Author Share Posted November 11, 2014 That's specifically the area I am looking at as well. Taking the only terrain code I found (in C++ ) and flipping it to Lua is a challenge to say the least (half commands don't work, or more likely I am calling them incorrectly). Quote Link to comment Share on other sites More sharing options...
RichL Posted November 11, 2014 Author Share Posted November 11, 2014 so I wonder if we should raise the terrain functions not being documented as a bug (for visibility)? Quote Link to comment Share on other sites More sharing options...
Josh Posted November 11, 2014 Share Posted November 11, 2014 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. Quote 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 More sharing options...
RichL Posted November 11, 2014 Author Share Posted November 11, 2014 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? 1 Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 14, 2014 Share Posted November 14, 2014 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. 1 Quote 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 More sharing options...
Recommended Posts
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.