Skip to content

Change EasyRPG's "SetInterpreterFlag" to make patch overrides temporary #3379

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

florianessl
Copy link
Member

This PR refactors the EasyRPG feature "SetInterpreterFlag" (#3123), similar to the way @Ghabry suggested there, by making use of some new state flags that have been merged into liblcf.

See liblcf PRs:

Rather than setting the global config options directly as before, a new field "easyrpg_runtime_flags" in the SaveEventExecState" struct is used, to make these overrides persist across save/load boundaries.

This makes these config overrides apply only to the Interpreter instance where they have been set, and when the end of the base frame is reached, all of the flags are reset automatically. To make this possible, a new global field "active_interpreter_flags" has been introduced, so the Player functions responsible for restricting use to these custom features can access & consider the state of the active interpreter flags for its check.

Test Project

RuntimeFlags.zip

Set "EasyRPG.ini" accordingly, whether you want to test the explicit enabling or disabling of certain patches.

  • Talking to the ladies at the "ON" section should always trigger the test code.
  • Talking to the ladies at the "OFF" section should never trigger the test code.
  • Talking to the ladies at the "---" section: Here it depends on the patches enabled inside EasyRPG.ini.

Note:
Some extra test code has been introduced via a commit, to make it possible to easily test DynRPG & Destiny support using a simple log command. (@easyrpg_output would always be possible, even without DynRPG enabled)

Copy link
Member

@Ghabry Ghabry left a comment

Choose a reason for hiding this comment

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

Thanks for finishing the command implementation.

@Ghabry Ghabry added this to the 0.8.2 milestone Mar 24, 2025
…, according to Ghabry's suggestions:

- Overrides of interpreter features are now stored inside a new lcf field "easyrpg_runtime_flags", so the settings can be retrieved from save files.
- These overrides are only valid for the current interpreter & the runtime flags will be cleared, once the last frame has been popped
- A new global field "active_interpreter_flags" has been introduced, so the Player functions responsible for restricting use to these custom features can access & consider the state of the active interpreter flags for its check.
- Implemented a very rudimentary display for active engine flag overrides in window_interpreter
…gExtensions() evaluates to true -> Separated script handling for Dyn/Easy & Destiny
@florianessl florianessl force-pushed the features/RuntimeFlags branch from d174607 to ab89abb Compare April 16, 2025 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Settings All about customizable features, storing and applying them Window/Scenes
Development

Successfully merging this pull request may close these issues.

2 participants