Hello, how could I create a random scene system that does this?
The scenes would represent the levels.
There must be two types of scenes; the complete and the incomplete. At first all scenes are of the incomplete type.
So there must be a function that randomly selects them.
To then press a button ... call the function with the random scene and load it with ... gettree (). Changescene.
Finally the shit scene must be removed with from the list of incomplete scenes and go to full
I have tried to do this ... with the following code
var imcompletas: Array = [
var completas: Array = [
func ob_escena() -> String:
return imcompletas[int(rand_range(-1, imcompletas.size()))]
It works very well ... but the problem is that when printing the complete ones I have incomplete ... errors arise starting with the printing of the scene loaded with
print (ob_escena) .. to know which scene was changed ... the name of another scene is printed and not the name of the loaded scene ... and obviously when printing the complete and incomplete scenes the same arise