WohlSoft / Moondust-Project

Moondust Project by Wohlstand
https://wohlsoft.ru/projects/Moondust/
GNU General Public License v3.0
250 stars 39 forks source link

Merge config pack and global extra settings in-editor #567

Open Emral opened 1 year ago

Emral commented 1 year ago

Is your feature request related to a problem? Please describe. Currently it is not feasible for the config pack to contain a "global_npc" or "global_bgo" or "global_block" extra settings configuration. This is because if an episode has its own file, the config pack's file is not loaded at all.

Describe the solution you'd like The ideal solution would be if both files are loaded and merged before displaying. Ideally, if two fields have the same "name" field, a warning occurs in the extra settings box pointing this out.

Additional context Here is my setup to test this. image image image

Adding a global_npc.json in the episode folder produces this result: image image image

Note the absence of the sour setting. Thanks.

Wohlstand commented 1 year ago

The REPLACE way had been chosen because Moondust Engine allows to completely override any NPC-ID with a totally different algorithm (by a lua-script referred at an npc-*.ini file). Anyway, to address given issue, I'll add the option into the header of the extra settings file to tell parser "replace" or "mix" with global setup. So, both variants can be used as well depending on the goal of episode maker.

Emral commented 1 year ago

This issue concerns the global extra settings. Could you explain in a bit more detail how this relates to overrides of individual items in an episode context if the global extra settings are visible for all of them regardless of ID? In my mind, this shouldn't be related to individual NPC overrides. Episode creators have episode-wide global extra-settings if they want to expand on global settings beyond what the config pack offers. If mix can be disabled by the episode creator, we still cannot have a basegame global_ extra settings without risking some NPCs breaking if creators override the extra settings, so that would not fix the issue. If you want to support mix/replace for other branches, can this behaviour be configured by the config pack rather than the episode?

Wohlstand commented 1 year ago

Episode will be one OF multiple ways to configure. The config pack side will define the default behaviour. Possibly, if needed, add the option to "enforce global setup" that will make episode-wide option to give no effect.

Emral commented 1 year ago

Would love to enforce it, thanks.