![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | mattkw80 |
I’m working on a Dwarf-Fortress type game that goes through a proc-gen world creation before you play.
It creates npc’s , items etc.
The npc’s are instance of a Being scene.
The items are resources, not actual scenes.
In the world creation scene - I create the instances, but I don’t actually add them to the scene, I just put them in a list so I can loop through them.
As the world creation loops - I’ve found it’s not safe for me to be queue_free-ing these in my main loop… so I add them to a list in autoload called: “gamelistofobjectstoqueuefree”.
When it’s more safe to do so… I then loop through the Autoload.gamelistofobjectstoqueuefree list, and try to queue_free each item in the list.
But I get error : " Attempt to call function ‘queue_free’ in base ‘null instance’ on a null instance. "
Any idea why I wouldn’t be able to queue_free from a list I’m keeping in an Autoload/Global/Singleton script?
Also - how do I handle the items, which are resources, not Scenes at all. Can I queue_free a resource?