[Lua] help needed with ore generated on water/void
Posted: Mon Dec 17, 2018 4:03 pm
I am creating a scenario with a grid based world where the grids are separated by voids.
So far it works well except that my ores are also generated on top of the water and voids. I tried the get_tile entity to check for existing surfaces but it fails.
then i get error ID12: attempt to call field 'get_tile' (a nil value)
So far it works well except that my ores are also generated on top of the water and voids. I tried the get_tile entity to check for existing surfaces but it fails.
Code: Select all
if (not game.surfaces.get_tile(x,y).collides_with("water-tile")) then
game.surfaces["nauvis"].create_entity({name=ore, amount=ore_amount, position={x,y}})
end