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

EOCs don't validate effects inside the eoc until the eoc is run #65446

Open
Maleclypse opened this issue May 3, 2023 · 4 comments
Open

EOCs don't validate effects inside the eoc until the eoc is run #65446

Maleclypse opened this issue May 3, 2023 · 4 comments
Labels
EOC: Effects On Condition Anything concerning Effects On Condition (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Maleclypse
Copy link
Member

Describe the bug

On PR #65311 commit 957026e40390ff9b80205ae5f9ffbb758b012cf5 passed github CI all green and the game loaded normally on my local device until I achieved the conditions that activated the following eoc

{
    "type": "effect_on_condition",
    "id": "EOC_ALCHEMY1",
    "condition": { "and": [ { "u_has_trait": "perk_ALCHEMY1" }, { "not": { "u_has_effect": "mental_exhaustion" } } ] },
    "effect": [
      {
        "u_roll_remainder": [ "extra_str_aspirin", "blackout_rage_drink", "sevendust", "small_blessing_brigit" ],
        "type": "recipe"
      },
      { "u_add_effect": "mental_exhaustion", "intensity": 1, "duration": "24 hours" }
    ]
  }

At which point the following errors appeared.

18:51:55.261 ERROR : C:\Users\colli\Documents\GitHub\Cataclysm-DDA\src\effect.cpp:94 [obj] invalid effect type id mental_exhaustion
18:52:07.391 ERROR : C:\Users\colli\Documents\GitHub\Cataclysm-DDA\src\creature.cpp:1368 [add_effect] Invalid effect, ID: mental_exhaustion

Both github actions and at world start validation should have caught this ahead of time.

Attach save file

Test Xedra Perks-trimmed.tar.gz

Steps to reproduce

Compile a world based on the listed commit above. Load into this save game. Gain 100 XP, select Basic Alchemical Knowledge perk, activate said perk in mutations, watch the error fly and the roll_remainder not happen either.

Expected behavior

CI or load validation to catch this.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.22621.1555 (22H2)
  • Game Version: 0.G-1612-g957026e403 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Portal Storms Ignore NPCs [personal_portal_storms],
    No Fungal Growth [no_fungal_growth],
    Bionic Professions [package_bionic_professions],
    Xedra Evolved [xedra_evolved],
    Bombastic Perks [bombastic_perks]
    ]

Additional context

No response

@Maleclypse Maleclypse added (S2 - Confirmed) Bug that's been confirmed to exist EOC: Effects On Condition Anything concerning Effects On Condition labels May 3, 2023
@andrei8l
Copy link
Contributor

andrei8l commented May 3, 2023

The code supports this syntax too (after the bugfix in #65444)

{ "u_add_effect": { "global_val": "runtime_target_effect" }, "intensity": 1, "duration": "24 hours" }

So the effect type is read from a variable and that's impossible to validate during JSON loading.

@Maleclypse
Copy link
Member Author

The code supports this syntax too (after the bugfix in #65444)

{ "u_add_effect": { "global_val": "runtime_target_effect" }, "intensity": 1, "duration": "24 hours" }

So the effect type is read from a variable and that's impossible to validate during JSON loading.

So should I close this as unsolvable?

@andrei8l
Copy link
Contributor

andrei8l commented May 3, 2023

No, keep it. We should be able to validate the simple case with a string (like in your example) during the Verifying/check_consistency phase.

@Ramza13
Copy link
Contributor

Ramza13 commented May 3, 2023

I don't think its that simple. The problem with validating this stuff is that by the verifying check consistency phase we don't have anything other than a function. It would take a lot of work and changes to keep around the original value to verify after the fact. Its one of the tradeoffs that happened when I abandoned my original version of EOCs to use the dialog system. Unless I'm missing something and you have an idea for how to handle this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EOC: Effects On Condition Anything concerning Effects On Condition (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

3 participants