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

NPC faction camps #73372

Merged
merged 23 commits into from
May 30, 2024
Merged

NPC faction camps #73372

merged 23 commits into from
May 30, 2024

Conversation

RenechCDDA
Copy link
Member

@RenechCDDA RenechCDDA commented Apr 29, 2024

Summary

Content "Static NPC factions have their own camps and food stores"

Purpose of change

(Ruin the game by) Continuing to expand our NPCs and NPC factions

Describe the solution

Add a new camp and camp_name field to map specials which capture the desired OMT placement, faction, and camp name for the resulting camp.

✅ Spawns a camp and assigns those values as expected.

✅ Make sure players and NPCs can't interact improperly with camps they don't own (e.g. can't eat out of their food stores)

✅ Define camps for our existing vanilla and in-repo mods

✅ Define reasonable food stores for our factions that they eat out of

✅ Handle lone wolf factions, somehow. (I have decided this is out of scope)

✅ Handle water needs for camps, by editing existing mapgen and otherwise giving camps access to the water_well provides

✅ Save compatibility by inserting new camps into existing versions of these specials

✅ For the basic implementation, the food stores will regenerate or otherwise gain food over time, and they'll never eat themselves out of a home. But...

(Future PR) Implement refugee center's questline of them actually being starving.

Describe alternatives you've considered

IDK, like ten billion EOCs?

Testing

image

Additional context

Big thanks to @Procyonae for some very good suggestions regarding the save migration issues

See next message for some known issues

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Player Faction Base / Camp All about the player faction base/camp/site labels Apr 29, 2024
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions and removed json-styled JSON lint passed, label assigned by github actions labels Apr 29, 2024
@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership json-styled JSON lint passed, label assigned by github actions and removed json-styled JSON lint passed, label assigned by github actions labels May 9, 2024
@github-actions github-actions bot added Mods Issues related to mods or modding Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Aftershock Anything to do with the Aftershock mod Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) json-styled JSON lint passed, label assigned by github actions labels May 10, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 10, 2024
@Maleclypse
Copy link
Member

So is this ready for merge?

@RenechCDDA
Copy link
Member Author

So is this ready for merge?

Should be, unless there are any objections.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 26, 2024
@Maleclypse
Copy link
Member

Blerg looks like I broke something when I resolved conflicts. Sorry

@RenechCDDA
Copy link
Member Author

RenechCDDA commented May 29, 2024

Blerg looks like I broke something when I resolved conflicts. Sorry

No worries, that was a messy rebase. Issue was actually some of the previous code.

Also fixed u_has_camp while I was here. Forgot that existed!

@github-actions github-actions bot added the EOC: Effects On Condition Anything concerning Effects On Condition label May 29, 2024
@RenechCDDA
Copy link
Member Author

Hmmm yes it is now correctly failing the text changes analyzer. I will have to get some help on that one.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 29, 2024
Copy link
Contributor

@Procyonae Procyonae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this is everything needed to make it work with translation

src/omdata.h Outdated Show resolved Hide resolved
src/overmap.cpp Outdated Show resolved Hide resolved
src/overmap.cpp Outdated Show resolved Hide resolved
src/overmap.cpp Outdated Show resolved Hide resolved
@Procyonae
Copy link
Contributor

Hmmm yes it is now correctly failing the text changes analyzer. I will have to get some help on that one.

You want a overmap_special.py in Cataclysm-DDA\lang\string_extractor\parsers that looks something like

from ..write_text import write_text

def parse_overmap_special(json, origin):
    for overmap in json["overmaps"]:
        if "camp_name" in overmap:
            write_text(overmap["camp_name"], origin,
                   comment="Name of NPC faction camp")

unless you want to extract them in the C++ instead and then to change Cataclysm-DDA\lang\string_extractor\parser.py like this except alphabetical still like

- "overmap_special": dummy_parser,
+ "camp_migration": dummy_parser,
+ "overmap_special": overmap_special,

@github-actions github-actions bot added Translation I18n [Python] Code made in Python labels May 29, 2024
@RenechCDDA RenechCDDA force-pushed the NPC_camps branch 4 times, most recently from 55ecada to d995a1f Compare May 29, 2024 23:53
@RenechCDDA
Copy link
Member Author

The text changes test passed now 👀

I hope that means the translation stuff works properly!

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 30, 2024
@dseguin dseguin merged commit fc666f5 into CleverRaven:master May 30, 2024
23 of 27 checks passed
@RenechCDDA RenechCDDA deleted the NPC_camps branch May 30, 2024 04:45
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 30, 2024
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 Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs Mods: Aftershock Anything to do with the Aftershock mod Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mods: Magiclysm Anything to do with the Magiclysm mod Mods Issues related to mods or modding NPC / Factions NPCs, AI, Speech, Factions, Ownership Player Faction Base / Camp All about the player faction base/camp/site [Python] Code made in Python Translation I18n
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants