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

Fix some more dungeons #2449

Merged

Conversation

longfruit
Copy link
Contributor

  • Monds weapon mats domain: Fix time between kill not refreshing
  • Inaz husk domain: Fix broken domain challenge
    • EVENT_ANY_MONSTER_LIVE is likely sent on tick, not on create. See scene40801_group240801001.lua:
      1. condition_EVENT_ANY_MONSTER_LIVE_1023 checks for mob 1008 to spawn AND for variable challenge to be 1
      2. Mob 1008 spawns during action_EVENT_SELECT_OPTION_1003, at ScriptLib.AddExtraGroupSuite(context, 240801001, 2)
      3. This spawn triggers EVENT_ANY_MONSTER_LIVE for mob 1008 but still fails the condition because challenge is still 0.
      4. challenge is set to 1 at the end of action_EVENT_SELECT_OPTION_1003. By now, EVENT_ANY_MONSTER_LIVE for mob 1008 no longer fires, causing the domain challenge to fail to start.
gif gif

Description

Please carefully read the Contributing note and Code of conduct before making any pull requests.

Issues fixed by this PR

Type of changes

  • Bug fix
  • New feature
  • Enhancement
  • Documentation

Checklist:

  • My code follows the style guidelines of this project
  • My pull request is unique and no other pull requests have been opened for these changes
  • I have read the Contributing note and Code of conduct
  • I am responsible for any copyright issues with my code if it occurs in the future.

* Monds weapon mats domain: Fix time between kill not refreshing
* Inaz husk domain: Fix broken domain challenge
    * `EVENT_ANY_MONSTER_LIVE` is likely sent on tick, not on create. See scene40801_group240801001.lua:
        1. `condition_EVENT_ANY_MONSTER_LIVE_1023` checks for mob 1008 to spawn AND for variable `challenge` to be 1
        2. Mob 1008 spawns during `action_EVENT_SELECT_OPTION_1003`, at `ScriptLib.AddExtraGroupSuite(context, 240801001, 2)`
        3. This spawn triggers `EVENT_ANY_MONSTER_LIVE` for mob 1008 but still fails the condition because `challenge` is still 0.
        4. `challenge` is set to 1 at the end of `action_EVENT_SELECT_OPTION_1003`. By now, `EVENT_ANY_MONSTER_LIVE` for mob 1008 no longer fires, causing the domain challenge to fail to start.
@Hartie95
Copy link
Contributor

Hartie95 commented Dec 2, 2023

It's possible that this is correct, but it's also possible that instead the events from the spawn should be handled only after the initial lua execution finished, in which case it would be more something like a race condition instead of a wrong way to trigger the event.
We should probaly keep an eye on the live events.

@longfruit
Copy link
Contributor Author

longfruit commented Dec 2, 2023

the events from the spawn should be handled only after the initial lua execution finished

The thought crossed my mind as well. Perhaps each suite group should have only one lua execution in flight at a time, so that lua events from gadget state change or mob creation by the same trigger would queue up and fire afterwards.

I'll experiment more if onTick live events become a perf issue or we see the same race condition with gadget state changes or something similar to mob live event.

@KingRainbow44 KingRainbow44 merged commit c4402cc into Grasscutters:development Dec 14, 2023
2 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants