Parametric mapgen part 4: Support mapgen parameters for most mapgen ids #50853
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Infrastructure "Support mapgen parameters for most mapgen ids"
Purpose of change
Prior to this PR mapgen parameters only worked for terrain. This was simply a limitation to simplify the initial implementation. We want them to work for all the other things in mapgen also.
Continuing the work from #48529, #49980, #50681.
Describe the solution
Extend mapgen parameter support to most other mapgen ids. The few things that are not supported are:
jmapgen_gaspump
's fuel typejmapgen_item_group
's item groupjmapgen_loot
's result_groupjmapgen_monster
's monster idsjmapgen_sealed_item
's furniture idThose are trickier cases which will need more careful attention, so I have left them for now.
Other changes that come along in this PR:
cata_variant
(for each of the ids we are parametrizing).Describe alternatives you've considered
Trying to cover more of the awkward cases I chose to leave out.
Testing
Unit tests verify that the JSON still loads OK.
Some walking around in-world suggests that I haven't broken mapgen too comprehensively. I certainly haven't tested all the code I've changed, but I'm hoping the changes were similar enough that they should all behave similarly.
Debug-spawned the
lab_mutagen_6_floor
and verified that the vents seem to be behaving as desired.Additional context
The way errors are reported for JSON mapgen will have changed as a result of this. Some errors should be improved while others have probably become worse (in particular, some now won't provide the nice line and column number with an extract of the problematic JSON), but overall I hope it's a net win. I'd like to figure out how to restore the previous error experience, but it's not obvious to me how, so I'm not attempting to do it in this PR.