KatsBits Community

Game Editing => General Content Creation => Topic started by: giankitax on May 03, 2011, 08:45:22 PM

Title: [BGE] How to create a loading screen?
Post by: giankitax on May 03, 2011, 08:45:22 PM
 :) hi all, Im searching for how to create a loading screen, Explain myself, the thing is that I created a game and when I launch  the game I have to waite because of the textures... I usually have to waite beetwen 10 and 15 seconds and in that lapse of time the only thing I can see is a black window, so Im looking how to create a loading bar before the game start, So thats the question... Sorry about the english...  :'(

If I didnt explain very well just tell me.... thx anyways !!!!
Title: Re: How to create a loading screen ?
Post by: kat on May 03, 2011, 09:24:05 PM
Looks like the easiest thing to do would be to set a 'default' scene the game loads during start up; typically this would be your in-game menu that you assign an event 'trigger' to change ("Start Game" button for example). If you want a dynamic load screen, i.e. something that displays a progress bar as content loads then that's a different ball game that probably relies on a script that checks progress in real time - which may use up resources unnecessarily.

You might be able to compromise however, and show one scene as the game loads, then trigger a switch to another (main game menu) when the games content has fully loaded. You'd need to find a way to trigger that change though, an "on_load" event of some sort. I can't really be more helpful than that I'm afraid as I don't use Blenders game engine that much these days.
Title: Re: How to create a loading screen ?
Post by: giankitax on May 03, 2011, 10:06:06 PM
ok, you gave and idea... may be If I use a default scene, without movement, and the instructions say press "S" to begin the game, but the truth is that when press "S" it does two works... first move the bar of loading, and at the same time it change from scene one to the two ( the scene two is going to be the game ), what do you think..? It should work right ?? 
Title: Re: How to create a loading screen ?
Post by: kat on May 03, 2011, 10:40:07 PM
Ideally you want be loading the games content (the initial level and material) independently of any user input (you don't want users trying to start the game when it's not ready). Once that loads you can then activate input and let the user continue; if you don't do that you're setting yourself up for problems.

I can't remember if BGE does this but look for info about checking the game state and triggering actions, there's going to be either a python script or a logic-brick set-up that will do what you're trying to do. The key to this is to break what appears to be a linear event into a series of sub-events so you can better control the way the game works as a mechanism based on a series of interdependencies.