[Rseding91] [for 0.17] [0.16.36] LUA map_gen_settings for Nauvis become invalid

This subforum contains all the issues which we already resolved.
staviq
Fast Inserter
Fast Inserter
Posts: 129
Joined: Wed Jun 29, 2016 1:22 pm
Contact:

[Rseding91] [for 0.17] [0.16.36] LUA map_gen_settings for Nauvis become invalid

Post by staviq »

The problem does not seem to be version specific, i just found a way to reproduce it.

If a mod adds any entity that modifies autoplace_controls, like a new kind of ore, and you create a new game, play it for a while, and then mod gets updated in a way that removes, or changes the name of an ore, Nauvis surface still remembers the old autoplace_controls. and the autoplace controlls become invalid and soft crash the game if you try to create a surface copy.

The real world example is:

1. Get Angels refining so you get some new ore types.
2. Get NiceFill mod.
3. Create new game, default settings, and then save the game.
4. Disable Angel's mods to simulate ore entity change ( ignore the fact it will screw up the ores on the map, it's just to trigger the problem in a simple way )
5. Load the saved game
6. Give player some landfill, and try to use it on a water tile.

At this point, on_player_built_tile event will fire, and NiceFill will generate a copy of the nauvis surface since it's the first time it was used.

Factorio will throw an error "X is not a valid autoplace control name", X being some angel's ore.

The core of the problem is, NiceFill mod has no way of knowing which parts of the autoplace_controlls are valid and which are not. In fact every mod that creates a copy of the nauvis, would soft crash at this point.


How it should work in my opinion:

When the Factorio loads game save and does the migration things, map_gen_settings for nauvis should get updated ,and invalid autoplace_controls should get removed.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16471
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.36] LUA map_gen_settings for Nauvis become invalid

Post by Rseding91 »

Thanks for the report. Mods can check http://lua-api.factorio.com/latest/LuaG ... prototypes to see if a given autoplace control is valid.

I'll change it for 0.17 so invalid autoplace controls are removed from map_gen_settings on loading a map.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”