Console command to find rare ore
Posted: Sat Nov 05, 2016 7:23 am
In my current game i just found out that i have no stone after the patch that was in the starting area. the map gen options were NOT set to 0 stone (it was probably low frequency small patches, migh even be poor ones).
Anyway in an attempt to salvage the 14 hours i've put into this map, i am cheating to find the stones i need. I would prefer to do this without turning of achievements as there are still a lot i can get.
Anyway i've revealed 3k*3k of the map, but failed to find stone. i am hoping that i'm just missing it ont the map (maybe being bitters or something).
so want the console to fnid the stone for me.
took the wiki's command for deleting all rocks (as it's gotta find them first, but i need to replace the destory with a print coordinates... how do i do that???
/c local surface = game.player.surface
for c in surface.get_chunks() do
for key, entity in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, name = "ORE/OBJECT"})) do
entity.destroy()
end
end
i replace the "ORE/OBJECT" with "stone-ore" and replace entity.destroy() with game.player.print(entity.pos) and its not giving me an error on execution, but i'm not sure i'm doing it right, and since i'm getting no result, i ask for help.
I want to find the ore that SHOULD be there, and then reload an older save to keep playing "without" console help. and go get the ore (have enough stone saved up from fist patch to build rails there i think).
changed stone-ore to iron-ore to test my comman, and now getting errors for the print command.... so i guess that means it never found any stone ore to get to the part of the code that tries to print.... this is discouraging.
Anyway in an attempt to salvage the 14 hours i've put into this map, i am cheating to find the stones i need. I would prefer to do this without turning of achievements as there are still a lot i can get.
Anyway i've revealed 3k*3k of the map, but failed to find stone. i am hoping that i'm just missing it ont the map (maybe being bitters or something).
so want the console to fnid the stone for me.
took the wiki's command for deleting all rocks (as it's gotta find them first, but i need to replace the destory with a print coordinates... how do i do that???
/c local surface = game.player.surface
for c in surface.get_chunks() do
for key, entity in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, name = "ORE/OBJECT"})) do
entity.destroy()
end
end
i replace the "ORE/OBJECT" with "stone-ore" and replace entity.destroy() with game.player.print(entity.pos) and its not giving me an error on execution, but i'm not sure i'm doing it right, and since i'm getting no result, i ask for help.
I want to find the ore that SHOULD be there, and then reload an older save to keep playing "without" console help. and go get the ore (have enough stone saved up from fist patch to build rails there i think).
changed stone-ore to iron-ore to test my comman, and now getting errors for the print command.... so i guess that means it never found any stone ore to get to the part of the code that tries to print.... this is discouraging.