Conversation
Previously, if you launched a single scene in the editor, you would have the ability to repel and grapple; while if you jumped directly to a scene in a web build via the URL hash, you would have no abilities. This is because when running a single scene in the editor, it is GameState._ready() which applies various changes like disabling persistence and granting repel + grapple; while URL hash changes go through SceneSwitcher. Even the initial hash restoration is done in (a deferred call from) SceneSwitcher._ready(). It would be possible to teach the JavaScript side to inspect the URL hash and pass `--scene res://...` to Godot when launching the game, but this would mean reimplementing SceneSwitcher on the Godot side, and the game failing to launch if the URL hash does not match an extant scene. And I believe we want to grant debug abilities if you edit the URL hash on a running game. Add the same logic to grant GameState.DEBUG_ABILITIES to SceneSwitcher.
|
Play this branch at https://play.threadbare.game/branches/endlessm/wjt/sceneswitcher-grant-debug-abilities-when-url-hash-changes/. (This launches the game from the start, not directly at the change(s) in this pull request.) |
manuq
approved these changes
Apr 2, 2026
Collaborator
manuq
left a comment
There was a problem hiding this comment.
Thanks for the Easters present. Yes, edit the URL hash on a running game is what I usually do too, it saves reloading.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, if you launched a single scene in the editor, you would have
the ability to repel and grapple; while if you jumped directly to a
scene in a web build via the URL hash, you would have no abilities.
This is because when running a single scene in the editor, it is
GameState._ready() which applies various changes like disabling
persistence and granting repel + grapple; while URL hash changes go
through SceneSwitcher. Even the initial hash restoration is done in (a
deferred call from) SceneSwitcher._ready().
It would be possible to teach the JavaScript side to inspect the URL
hash and pass
--scene res://...to Godot when launching the game, butthis would mean reimplementing SceneSwitcher on the Godot side, and the
game failing to launch if the URL hash does not match an extant scene.
And I believe we want to grant debug abilities if you edit the URL hash
on a running game.
Add the same logic to grant GameState.DEBUG_ABILITIES to SceneSwitcher.