Page 1 of 1

[0.16.XX] console commands not saved

Posted: Mon Jul 30, 2018 9:24 am
by Nexarius
I've written a command and it works but sadly it stops working if I save and then load the map.
Could those commands be saved as well in the savefile?

script.on_event(defines.events.on_chunk_generated, function(event)
--[[stuff]]
end)

Re: [0.16.XX] console commands not saved

Posted: Mon Jul 30, 2018 10:17 am
by Klonan
Thanks for the report,

Unfortunately due to the way script registrations work, we are not currently able (or willing) to make them persist through save and load

Re: [0.16.XX] console commands not saved

Posted: Mon Jul 30, 2018 8:51 pm
by TruePikachu
If you need it to keep working, add it to the `control.lua` file in the savegame itself, with proper guards so it only gets invoked during init.