I didn't write this, and it's only going to possibly help,
it's not the entire solution, but you can most likely sniff what
you need with this type of scripting, and go from there. It's my
basic setup: preload scene 1, load assets scene 2, content scene 3.
What would be important for you is the stuff in scene 1: