This commit is contained in:
Brevven 2025-01-01 22:48:17 -08:00
parent a2b6c83333
commit 353d8cfed1
2 changed files with 24 additions and 4 deletions

View file

@ -122,6 +122,7 @@ function util.warptorio2_expansion_helper()
end
local usage_regenerate = [[
Recommend saving the game before running this command.
Usage: /bz-regenerate all
or /bz-regenerate <planet> <resource> [<frequency> <size> <richness>]
planet must be an internal name like nauvis
@ -130,10 +131,9 @@ or /bz-regenerate <planet> <resource> [<frequency> <size> <richness>]
Regenerates ore patches. If frequency/size/richness are provided, the planet will use those settings from now on, as well.
- Separate arguments with spaces, do not use < >, [ ], quotes or other symbols
- This action can take a while for larger maps!
- Ores can sometimes overlap on regeneration.
- Ores can sometimes overlap on regeneration. This can sometimes hide ore patches. If none seem to be made for a resource, regenerate just that resource and tweak frequency/size.
]]
function util.add_regenerate_command_handler()
log("I am here ".. util.me.name)
script.on_event(defines.events.on_console_command, regenerate_ore)
if not commands.commands[regenerate_command] then
@ -143,7 +143,6 @@ end
function regenerate_ore(event)
if event.command == regenerate_command then
game.print("I am trying ".. util.me.name)
local params = {}
for w in event.parameters:gmatch("%S+") do table.insert(params, w) end
if #params == 1 and params[1] == "all" then
@ -159,7 +158,6 @@ function regenerate_ore(event)
end
local planet = params[1]
for _, resource in pairs(me.resources) do
game.print("I am trying ".. util.me.name .. " " .. resource)
if not game.surfaces[planet] then
game.print("Could not find surface for "..planet..". May not exist, or may not yet be explored.")
return