better way of preload multiple scenes

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By super312

i am making a project where the player have lots of characters to use so he can make a team and go to battle is a turn base rpg, but to the battles i didn’t find a way to send what scenes/character is the player team, i wanted to do something like that

(this code is just to give the idea, i know preload don’t work like that)
var char1_path = “”
var char1 = preload(char1_path)

func player_team(char1_path):
        self.char1_path = char1_path

the game is gonna have more than 50 characters because of that i think, preload everyone would be too much things for the memory.

:bust_in_silhouette: Reply From: brazmogu

You can load just assets and data necessary for a selection screen and then pass the selected characters for another scene that will load the characters that were actually selected only.

That said, preload loads resources at compile time, so you can’t really do that with this level of dynamism. What you want, probably, is to use load in this case.

thanks, that really helped a lot

super312 | 2020-03-05 18:36