Bilka2 / ChangeMapSettings

Factorio mod that allows to change map and map generation settings at any time
https://mods.factorio.com/mod/ChangeMapSettings
MIT License
7 stars 2 forks source link

Update to 1.1 #3

Closed catt0 closed 3 years ago

catt0 commented 3 years ago

All changes seem to be related to a change in 1.1 to only accept strings for the textfield.text property.

I tested this in the editor and the changes are visible in newly generated chunks. I tested resource generation, biter generation and land generation (trees, cliffs and water). I am also using it in my heavily modded savegame to tweak the evolution state and have not run into a problem. If there are any other tests I could do, feel free to suggest them.

Bilka2 commented 3 years ago

Missing for a complete 1.1 update is fixing util.get_possible_noise_expression_properties and making use of the newly added LuaGameScript::map_gen_presets. Additional test would be running it with https://mods.factorio.com/mod/fractured-world and making sure new game+ works with the changes (it reuses some util functions and gui files).

catt0 commented 3 years ago

Thanks for the pointers! I added support for loading a preset in the GUI. Also I added two special presets:

  1. state before changing anything with the mod, stored for each surface
  2. settings selected in the new game screen (little bit wonky with SpaceEx, because it modifies the surface settings directly)

I tested it with Fractured world (updated its json to allow loading in 1.1, no further change) and was able to change the generator on the fly. The custom properties are also displayed and loaded from the preset. I attached two screenshots showing the different generators and the new preset selection. I am not entirely happy with how the GUI looks atm, but it works (tm).

New game+ runs into the same error as this mod upon opening its GUI. A quick check of its code showed that it most likely can use the same fixes as this commit, but I have not applied them.

As for util.get_possible_noise_expression_properties: I am not sure what needs fixing. I understand that these are properties that should be displayed in the GUI to be modified. However from 1.0 to 1.1 nothing was changed there according to the wiki. Also the GUI shows the same options (minus planet size, which is explicitly disabled) as the new game screen. Any more information on this?

Edit: On a modding usability note: Converting a MapGenPreset into MapGenSettings is annoying and can break on updates to the game that change defaults or add new values. However the game already needs to do the same work when loading a preset. Exposing this as an API would save a lot of code in this change and prevent breakage on updates.

2020-12-21-192602_2560x1440_scrot 2020-12-21-192531_2560x1440_scrot

Aberro commented 3 years ago

Why it's not merged yet? Is there any other issues?

Bilka2 commented 3 years ago

Why it's not merged yet? Is there any other issues?

There were the following issues:

Unfortunately, due to these issues I could not use this pull request.