Simple World Gen
Posted: Wed May 08, 2013 3:28 am
I'm trying to use the onchunkgenerated event and having slight issues lol.
Also I find it a bit strange that instead of topleft and bottomright it uses lefttop and rightbottom lol. Anyways, I am/was trying to use so that it places a spawner randomly within the loaded chunk...and keep getting a "bad argument #2 to 'random' (interval is empty)" error.
This shows what I would expect to see, so i'm not sure what's going on lol
typing it into the console using the numbers printed from the print statement like so works perfectly
Also I find it a bit strange that instead of topleft and bottomright it uses lefttop and rightbottom lol. Anyways, I am/was trying to use
Code: Select all
game.createentity{name="creeper-spawner-2", position={math.random(event.area.lefttop.x,event.area.rightbottom.x),math.random(event.area.lefttop.y,event.area.rightbottom.y)}}
This
Code: Select all
game.player.print(event.area.lefttop.x.." "..event.area.lefttop.y.." "..event.area.rightbottom.x.." "..event.area.rightbottom.y)
typing it into the console using the numbers printed from the print statement like so
Code: Select all
game.createentity{name="creeper-spawner-2", position={math.random(704,736),math.random(96,128)}}