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

[NPCMapLocations] Doesn't respect dynamic configuration changes. #85

Open
Yagisan opened this issue Oct 29, 2021 · 0 comments
Open

[NPCMapLocations] Doesn't respect dynamic configuration changes. #85

Yagisan opened this issue Oct 29, 2021 · 0 comments

Comments

@Yagisan
Copy link

Yagisan commented Oct 29, 2021

I'm trying to support several NPCs that need more dynamic support.

Generally this involved disabling their map markers until some event or flag has been set, then enabling them.

According to the patch summary command, it is dynamically changing conditions, however NPCMapLocations only respects the very first match.

For example with NPC Juna ( https://www.nexusmods.com/stardewvalley/mods/8606 ) I have the following snippet

        // NPC Juna - https://www.nexusmods.com/stardewvalley/mods/8606
        // Juna should not be visible before her into event 86060001 and the flag PlayerChoseParents has not been set
        {
            "LogName": "Juna - Before event 86060001",
            "Action": "EditData",
            "Target": "Mods/Bouhm.NPCMapLocations/NPCs",
            "When": {
                "HasMod: |contains=elhrvy.NPCJuna": true,
                "HasFlag |contains=PlayerChoseParents": false,
                "HasSeenEvent |contains=86060001": false,
                "HasSeenEvent |contains=86060043": false

            },
            "Entries": {
                "Juna": {
                    "Exclude": true
                },
            }
        },
        // Juna should be visible after her into event 86060001 and the flag PlayerChoseParents has not been set
        {
            "LogName": "Juna - After event 86060001",
            "Action": "EditData",
            "Target": "Mods/Bouhm.NPCMapLocations/NPCs",
            "When": {
                "HasMod: |contains=elhrvy.NPCJuna": true,
                "HasFlag |contains=PlayerChoseParents": false,
                "HasSeenEvent |contains=86060001": true,
                "HasSeenEvent |contains=86060043": false

            },
            "Entries": {
                "Juna": {
                    "MarkerCropOffset": 1
                },
            }
        },

The initial condition ( Juna - Before event 86060001 ) is the only one that NPCMapLocations respects, and is the one that is written into the log file.

The expected behaviour was that NPCMaplocations would update it's configuration when the conditions changed.

If needed, the full source code is available at -> https://github.com/Yagisan/Stardew_Valley/tree/main/Custom%20NPCs%20for%20NPC%20Map%20Locations

Thank you for your assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant