Is there a way to initialize Node export variables before entering the scene? I found only two initialization callbacks ready and init. First is called after node is added to the scene, and second on node instantiation. Because I haven't found any others callbacks which could be connected to node creation, and because the export variables are not initialized on init method, I just can assume that export variables are not initialized before ready are called, which means that even if you loaded some node from a resource, where is no way to use it's setupped variables before this node is added to the scene tree. Which is ultimately mean, there is not way to load some nodes, and do pre-ready manipulations with them (for example change some parameters according to json save file) asynchronously in the separate thread..

I think I just missing something.. So, is there an additional step in node loading? Or maybe I can trigger variables instantiation explicitly?

Welcome to the forums @luedos!

Maybe you could use _enter_tree()? Its called right after its been added to the SceneTree but before any of its children nodes have. I have no idea if the exported variables would be setup at this point though. Maybe this page on the documentation about notification order will help (found on Godot Q&A)? I don't think it covers initializing export variables though.

I think I just haven't done enough testing :P I've retested few things and here what I found: First of all external variable (as well as all other variables) do init on instantiate call from resource. they just do it after _init (somewhy). Secondly you can have NOTIFICATION_INSTANCED notification call which happens after all nodes and their variables were initialized (again, this notification came on the same instantiate call so no need to add your node to the tree first). But this notification call is triggered only on root node of your scene you instantiated, no children will receive it. It seems there is no others notifications in the instantiation process of the nodes, which is the shame. It would be really great to have some callback which is called after your instantiated scene is initialized, but before you added it to the tree, it would definitely replace _ready in terms of initializing children Node variables from paths.. But again, mb I just missing something :/ Any way it's enough for me (for now), and even if I would need more complex system, I think I will just create my own callbacks for that, and will call them from NOTIFICATION_INSTANCED of my root Room node.

2 years later