I am currently making a simple tree which looks like this :
MainNode (Parent) -> Character (Child)
MainNode can add child or free one from any files such as maps (i.e. terrain.tscn) or events (i.e. event.tscn). All events and maps will be stored in a dictionary for easy usage. The codes would look like this :
# load the corresponding tscn file from dictionary
# find the corresponding target node using key
# load Mainmenu.tscn
My problem begins when I press start in the Mainmenu.tscn. If I had Mainmenu.tscn as a child (in default), I can always emit a signal for confirming the player press the button to fire a signal to proceed to the next scene, such as :
var target_scene = "Opening Scene"
But since the node isn't actually in the MainNode (It will be added as a child after _ready() ), I can't find a way to emit a signal from "Mainmenu.tscn" to MainNode, because initially it's not in the MainNode's tree.
Is there a way to make a signal to a different tree? Or is there a alternative solve for this?
[note : This question is also on stackoverflow. I'm posting on both platforms ;) ]