Game Development Community

Pre)loading problem

by Very Interactive Person · in Torque Game Builder · 10/27/2007 (8:10 am) · 2 replies

I tough onLevelLoaded() was the right place to start the actions in a level. However, it turns out on slower machines, it is still loading things into memory when this callback is made. The result is the screen doesn't update for 1-2 seconds. This is a problem for me becuase I have an intro animation at the beginning of each level. I start this animation in onLevelLoaded, but on slower pc's 1-2 seconds of this animation are skipped.
How can I know the computer is really done loading everything and I can start this intro animation?
If I restart the same level, I don't have this problem anymore. Its only the first time I start a level.

#1
10/27/2007 (4:11 pm)
You can schedule, which is not either a good idea or an "exact science" or you can write a process manager and in the very last line of your t2d file make a call to the process manager, on the safe side, scheduled again. Unfortunatelly if you write extra code in the t2d file and open it in the editor, it will be deleted.
#2
10/28/2007 (3:02 am)
I'm already using schedules, the problem is on my own PC I don't even have to use schedules becuase everything is immidiately loaded. On other pc's it takes as long as 5 seconds. So I want something that works on all pc's. Letting everyone wait 5 seconds is not really an option, and maybe there are pc's out there that need 10 seconds.
Are you sure about writing some code at the end of the level file? Will that be executed AFTER everything is loaded into memory?