Skip to content

Better Scenario Hooks

cobaltcore requested to merge master into master

Some upgrades to make the scenario hooks more useful. This includes the following:

[Commit 1]: Adding a 'hooks' section to the scenerio.json that can take in multiple entry points and descriptions. Supports both null descriptions (current behavior) and strings. Existing hook_hash continues to work by populating hooks with {"hook_hash": null}

Example: "hooks": {"7151120f": "Perhaps you should wish to understand your new powers", "a757c4bc": null}

[Commit 1] Update the scenario gui to provide a description on a second line, if provided. Not having some game-related text in the box kinda broke immersion. Unless you were playing through explicitly to hit that scenario, how would you know what choice it represents? For example, my scenario is going to add "Wish to understand your new powers" as an option when cercie is asking for wishes, which is not something that can easily be represented by the scenario name and author.

[Commit 2] Tells Renpy to stop skipping when hitting scenario hooks

[Commit 3] Passes the commit hash, instead of a simple boolean, when the scenario starts. This allows it to have dynamic logic based on entry point.

The following pieces could use a close look by someone with more skills than I:

[Commit 1] The GUI logic has to run through the scenario list an extra time to compute the total size of the window. I was unable to get it running inline. See comment in screens.rpy

[Commit 2] This only stops regular skips, not fast skips. I was unable to find a way to stop fast skips

[Commit 3] I don't think changing from a boolean to a string will effect any current use cases. After all, if _scenario should still work. However, if I'm wrong about this, we could pass it as a different variable name easily enough

Testing: I've verified this under several combinations of hooks. This is how it looks with and without a description screenshot0002

screenshot0003

I've also verified it stops on skips, that it registers multiple hooks per scenario, and that the hash value is passed to the scenario correctly.

Edited by cobaltcore

Merge request reports