Level disappears when I load my game?

Non-platform specific questions.

Level disappears when I load my game?

Postby TeraPoison » Mon Apr 01, 2013 11:30 pm

I was using it and creating a title screen. when you click start and it loads the game it makes the stage disappear and the character will fall into the void . How do I fix this? ALSO how do I make the title screen game and ending screen all on one game and export it and make it work? Thanks guys you all are the best! 8)
Many of life’s failures are people who did not realize how close they were to success when they gave up.
- Thomas Edison
TeraPoison
 
Posts: 24
Joined: Sun Mar 31, 2013 3:01 am
Location: My House
Score: 2 Give a positive score

Re: Level disappears when I load my game?

Postby Hblade » Mon Apr 01, 2013 11:33 pm

It's a small bug when loading ged files
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Level disappears when I load my game?

Postby TeraPoison » Mon Apr 01, 2013 11:35 pm

is there a way to fix it? also how do I do the last part?
Many of life’s failures are people who did not realize how close they were to success when they gave up.
- Thomas Edison
TeraPoison
 
Posts: 24
Joined: Sun Mar 31, 2013 3:01 am
Location: My House
Score: 2 Give a positive score

Re: Level disappears when I load my game?

Postby skydereign » Tue Apr 02, 2013 12:08 am

TeraPoison wrote:is there a way to fix it?

It doesn't happen in the exported version of the game, but it is a major inconvenience when building your game. I usually recommend not using multiple ged files for your levels, this being one of the reasons.
TeraPoison wrote:ALSO how do I make the title screen game and ending screen all on one game and export it and make it work?

You would need to use some variable in a save file. That way when you load the main menu, you check the value of the variable, and if it is one for instance, you move the view to the ending screen (also setting it back to zero and saving). So whenever you want to display the end screen from a level, you set the variable, call saveVars, and then call LoadGame.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Level disappears when I load my game?

Postby TeraPoison » Tue Apr 02, 2013 12:10 am

that went straight over my head dude. im sorry im really new to this.
Many of life’s failures are people who did not realize how close they were to success when they gave up.
- Thomas Edison
TeraPoison
 
Posts: 24
Joined: Sun Mar 31, 2013 3:01 am
Location: My House
Score: 2 Give a positive score

Re: Level disappears when I load my game?

Postby skydereign » Tue Apr 02, 2013 12:22 am

TeraPoison wrote:that went straight over my head dude. im sorry im really new to this.

It was meant to be a cursory explanation, since I didn't know your experience with gE. If you want the title screen file to serve as both the title screen, and the end game screen, the game will need to know which one it is loading. The only way to transfer data between two game files is through save files of some sort. By default you probably want the title screen executable to load up the title screen, because that is what you show when you start the game.

Now the game will always start in the same way, so you need to write some code at the beginning of the menu screen to check which screen to show. Either the main menu by default, or if the variable is set, show the end game screen. The following is generally how it would work. end_screen would be a variable in the save group menu_type. If you aren't sure how to use save groups, search the forums for saveVars/loadVars.
view -> Create Actor -> Script Editor
Code: Select all
loadVars("menu_type", "menu_type");
if(end_screen==1)
{
    y=1000; // move the view to where the end game screen is shown
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Level disappears when I load my game?

Postby TeraPoison » Tue Apr 02, 2013 12:25 am

I need all 3 to work together
Many of life’s failures are people who did not realize how close they were to success when they gave up.
- Thomas Edison
TeraPoison
 
Posts: 24
Joined: Sun Mar 31, 2013 3:01 am
Location: My House
Score: 2 Give a positive score

Re: Level disappears when I load my game?

Postby skydereign » Tue Apr 02, 2013 12:55 am

Ah, I missed the mention of the game in it as well. If you are going with the multiple ged method, then all you need to really worry about is the LoadGame function. Create your title menu as an executable. This game should have some way of loading your level files (which will be exported as .dat files) using the LoadGame functions. Usually you would put the LoadGame in a button click. Your game files should have some way of returning to the menu usually, and when you beat the game, have a call to LoadGame for your end game file (also a .dat). It's pretty basic idea, since all you need to do is call LoadGame for the different files when you need to transition between them.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Level disappears when I load my game?

Postby TeraPoison » Tue Apr 02, 2013 1:12 am

After I export the game how does the title screen and the end load?
Many of life’s failures are people who did not realize how close they were to success when they gave up.
- Thomas Edison
TeraPoison
 
Posts: 24
Joined: Sun Mar 31, 2013 3:01 am
Location: My House
Score: 2 Give a positive score

Re: Level disappears when I load my game?

Postby skydereign » Tue Apr 02, 2013 1:18 am

You export the title screen as an executable. You can then open the executable, and it loads the title screen (because that is what the executable is of). You export your end screen and game levels as .dat files, which are just files that the title screen will load. All you need to do to load up the other parts of the game is to use LoadGame. For example, you have a button in the title screen game with the following code.
Code: Select all
LoadGame("level1.dat");

Clicking that would then try to load the level1.dat file. As soon as it loads, the game will now be playing the level1 file, instead of the title screen. Remember, the title screen is the file you load first, and should be the only executable. That way the player can't load any level they want, and play your game out of order.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron