From 0e19992b820158f8e9c0fc16ddc372a5ea596f53 Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle Date: Sat, 14 Sep 2019 00:30:05 -0400 Subject: Lua can now modify world size and world data --- Scripts/world.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Scripts/world.lua') diff --git a/Scripts/world.lua b/Scripts/world.lua index 655cdab..f87f108 100644 --- a/Scripts/world.lua +++ b/Scripts/world.lua @@ -26,14 +26,15 @@ world = { Generate = function(self) math.randomseed(self.Seed) + xsize, ysize, zsize = self:setSize(250, 128, 3) --self.data = {} - for Z = 0,self.Layers do + for Z = 0,zsize-1 do --self.data[Z] = {} - for X = 0,250 do + for X = 0,xsize-1 do --self.data[Z][X] = {} YGen = math.floor(6*math.sin(X/20) + Z) + 64 YDepth = math.random(2,5) - for Y = 0,128 do + for Y = 0,ysize-1 do if Y == YGen then --self.data[Z][X][Y] = 0 self:setData(X, Y, Z, "grass"); @@ -48,6 +49,7 @@ world = { end end end + self:setData(1000, 1345, 5, "grass"); -- Test error checking print("Done with world gen"); end } -- cgit v1.2.3