Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basecamp recipes can specify parameters and om_terrain_match_type #72642

Merged

Conversation

Procyonae
Copy link
Contributor

@Procyonae Procyonae commented Mar 26, 2024

Summary

None

Purpose of change

Needed for #72561, parameters can affects layouts of maps changing which basecamp recipes should be offered
om_match_type matching > just type matching

Describe the solution

Allows for parameter matching like "om_terrains": [ { "om_terrain": "omt1", "parameters": { "param_key1": [ "allowed_value1", "allowed_value2" ] } } ] to match omt1 if param_key1 is set to either allowed_value1 or allowed_value2

Allows for om_match_type matching like "om_terrains": [ { "om_terrain": "omt1", "om_terrain_match_type": "PREFIX" } ] tp match "omt1", "omt1_roof", "omt1_3_8" etc and applies it to existing recipes

Uses an overload instead of the defaulted "ANY" C++ argument in the function call so things don't get too hairy ("ANY" is still fine as a JSON om_terrain to match all omts)

Adds documentation for the new fields

Describe alternatives you've considered

Testing

Tested parameter specification using #72561:

The evac shelter we're at has layout 24x24_shelter_1:
image
Asking my good friend Gordon to start a camp offers the faction_base_shelter_1_0 camp and the bare bones camp but not faction_base_shelter_0 or faction_base_shelter_2_0 as expected
image

Tested om_match_terrain_type by verifying the same basecamp recipes were offered before and after 9595812 while on farmland_turn_inside

Additional context

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [C++] Changes (can be) made in C++. Previously named `Code` Player Faction Base / Camp All about the player faction base/camp/site EOC: Effects On Condition Anything concerning Effects On Condition labels Mar 26, 2024
@Procyonae Procyonae changed the title Basecamp recipes can specify parameters Basecamp recipes can specify parameters and om_terrain_match_type Mar 26, 2024
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Mar 26, 2024
@Procyonae Procyonae force-pushed the BasecampRecipesCanSpecifyParameters branch from 47ebd15 to 3463aa0 Compare April 4, 2024 10:18
@github-actions github-actions bot added the [JSON] Changes (can be) made in JSON label Apr 4, 2024
@Procyonae Procyonae marked this pull request as ready for review April 4, 2024 13:17
@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs labels Apr 4, 2024
@Procyonae Procyonae force-pushed the BasecampRecipesCanSpecifyParameters branch from 08a90f9 to 7c356ba Compare April 5, 2024 09:43
@Maleclypse Maleclypse merged commit 1b5c1bf into CleverRaven:master Apr 9, 2024
21 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Documentation> Design documents, internal info, guides and help. EOC: Effects On Condition Anything concerning Effects On Condition [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs NPC / Factions NPCs, AI, Speech, Factions, Ownership Player Faction Base / Camp All about the player faction base/camp/site
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants