Oarcinae / FactorioScenarioMultiplayerSpawn

A custom scenario for Factorio which provides each player a unique starting spawn point in a multiplayer game.
MIT License
49 stars 30 forks source link

Use override files for settings #101

Closed bplein closed 5 years ago

bplein commented 5 years ago

Here's my situation:

I like to keep OARC up to date when starting a new game. If I "git pull" I risk losing my old settings. There are techniques with Git that can preserve your old files (git stash) and merging these differences (git stash apply) but there's risk that the changes are not mergable.

I'd like to see an override file, such that config.lua, control.lua etc are NOT to be altered, and the override file is read in last.

Then we could start knocking down settings. For me, I prefer to have the moat enabled by default, so I modify separate_spawns_guis.lua to enable that checkbox by default. Over time we could push all of these as variables up into the override files.

Another use case is the layout of the resources. You have some variables right now, but I basically went in and massively changed "Resource & Spawn Circle Options" in config.lua. It would be nice to simply override it externally.

This way one can "git pull" all day long and just change the behavior via the override files.

Oarcinae commented 5 years ago

My current system (in the 0.17 branch) is that the git repo ignores config.lua and it is up to the user to look at example_config.lua to make any changes if required. I know this is manual, but is there a better way that what I am currently doing?

Are you talking about the master (stable 0.16 branch) or the dev_0.17 one?

Oarcinae commented 5 years ago

Also, is "override files" a git feature or something? Not sure if you mean there is a specific thing called override files that I could be using?

bplein commented 5 years ago

My apologies, this is an enhancement request, not a bug report.

My thoughts come from the way Docker Compose works. The publisher of an application can give you their docker-compose.yaml file and you can override it with settings from an override file.

In my thoughts, everything that can be bubbled up to an environment variable should be. I guess that's config.lua (and you are right, in .17 you only provide an example. I forgot about that).

So I guess for now, let's close this, and I'll just ask for specific things to be bubbled up to config.lua, like the default state of the Moat GUI control (default enabled or disabled)