How do I load multiple tile maps to be joined together?

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

I’m making a 2D game and want to make levels out of individual chunks that are joined together according to certain rules, the simple sort of procedural generation that is used in most endless runners. I’ve created a system, and a set of chunks to test with, but I can’t figure out how to load the chunks. Preload doesn’t seem to work for this because the string to the appropriate chunk tscn isn’t a constant (chunks are selected using a naming convention so a random number is chosen, then a chunk that corresponds to that number is chosen and fits together with the previously placed chunk). The only thing I can think of would be to preload all the chunk scenes and then choose randomly from those, but I don’t know how many chunks I will end up with in the end (it will be well over 200) and I don’t want to make loading times too long (or type out 200 preload functions :P)

Never mind, I just didn’t understand the documentation. Using load() works fine.

Socrates | 2018-06-20 01:45