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

Implementation idea for branching or secret paths #3152

Open
MatusGuy opened this issue Dec 24, 2024 · 0 comments
Open

Implementation idea for branching or secret paths #3152

MatusGuy opened this issue Dec 24, 2024 · 0 comments
Labels

Comments

@MatusGuy
Copy link
Member

Me and @Rusty-Box discussed a solution to implement branching or secret paths in the worldmap in a more easier and consistent method, and I wanted to document it here.

In the EndSequence object, you will be able to specify which paths open on the worldmap by ticking certain tickboxes.
image

Each one of these tickboxes will turn a certain boolean with the name <level filename>_<dir> true in the Squirrel state table when the level is finished. For instance, when completing the upper path of "A Fork In The Road?", state.fork_in_road_up will become true.
Additionally, state.fork_in_road_up_finished will also become true. This boolean indicates if the path was just unlocked. This can be used to make a fancy fade animation that only runs once, for example.
Heres how you would write that script:

if (state.fork_in_road_up_finished) {
  // fade in x tilemap
} else {
  // show x tilemap without animation
}

In the level dot, you can run a script when a specific path opens.
image

These scripts only run if <level filename>_<dir> is true when the worldmap sector initializes. They essentially serve as a more convenient method of writing this in the worldmap sector initialization script:

// Going back to the "A Fork In The Road?" example.
if (state.fork_in_road_up) {
  // code
}

I'm unsure about certain things, though:

  • Where would this be documented in the wiki?
  • Is there a better way to implement the state.<level filename>_<dir>_finished variable instead of putting it in the state table?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant