That worked; now the ore grows! But it doesn't expand over time. This is the only part left that doesn't work; It fails when trying to find the uranium ore so it never reaches the line where it creates a new ore piece.Kynaro wrote:Try lower-case p instead of upper-case P? "ore.position"
Code: Select all
--add new ores to empty adjacent squares
orePositions = {{ ore.position.x + 1, ore.position.y }, { ore.position.x - 1, ore.position.y },
{ ore.position.x, ore.position.y + 1 }, { ore.position.x, ore.position.y - 1 }}
for i=0,3,1
do
local adjacentEntity = global.world.find_entities_filtered{position = orePositions[i], name = "uranium-ore"}
if not adjacentEntity then
--add new ore here
local newOre = global.world.create_entity{name = "uranium-ore", position = orePositions[i], amount = 5}
table.insert(global.oreList, newOre)
end
end