Godot Version
Godot 4.3
Question
Hi!
I have a Godot resource-based DB that stores data with references to room scenes that I use to create level geometry
I have to store them in a PackedScene to be able to initialize them before adding them as child objects
I initialize and create rooms and corridors with a certain logic. But I also need to specify the Position in the game world, otherwise they will be created one on top of the other. And I also need to hook data from the rooms and corridors stored in the scripts about the Position of the joints (the places where these objects connect)
Actually, the question is - how can I specify the Position of my rooms and corridors, if at the time of creation, the nodes are Node, and not, say, Room, which stores the source data of the joints of the rooms and corridors
Type casting will not work because the process is planned to be made automatic, and I can’t know which room or corridor the randomizer will pick up during the generation process
Perhaps there is some method that allows you to invert the type of an object to its previous state - “Room” for example etc?
I know that there is a method that does a certain action, having first checked whether the specified class has the required method, perhaps there is a similar action for variables?