So my horror game is working, scene changes happening but I have hit a hiccup.
- I have a splash screen with an RNG roll that hit when the player is caught by a monster.
- If a player loses, they go to game over screen,
- If they win, it should reload the previous scene.
Problem: The method I have used for all my other scene changes (including the kill screen and game over) do not work for this particular method. I am trying to use a global variable and update it and even get its filename but I can't seem to get this mechanic to work and I am getting zero errors on the debugger.
Here's my singleton in a global object: (it currently has a placeholder)
var sceneJar = preload("res://assets/TESTROOM_00.tscn"
This function is in every scene at a door object, which is a class that contains left and right doors. This function runs at exit_tree(have also tried _ready) so I won't bother posting it here.
func room_store():
_currentRoom = get_tree().get_current_scene()
Global.sceneJar = _currentRoom
Then the splash screen handles scene changes towards the result. This line keeps giving me black screens and the good old change_scene_to() method is not working. What can I do instead?
var _escape_dest = Global.sceneJar
func escape(): ### escape to homescreen
var _free = _escape_dest
var _free_me = get_tree().change_scene_to(_free)