Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Grant, dr_panther, AndrewAMD), 1,379 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Saving / Loading crashing game #426836
07/30/13 15:11
07/30/13 15:11
Joined: Sep 2007
Posts: 173
USA, Florida
3dworld Offline OP
Member
3dworld  Offline OP
Member

Joined: Sep 2007
Posts: 173
USA, Florida
Hi Everyone;

I'm trying to save and load my game using the F2 for save and F3 for load. Every time I press F2 it saves the game correctly but when I press F3 it just freezes. Any ideas welcome?

This is my code:

Code:
function mySave()
{
	if (inkey_active == 1) {return;}
	if (players_health <= 0) {return;} 
	
	game_save("save01", 1, SV_ALL-SV_INFO);
	file_for_screen("save01.png",01);  // saves a screenshot to "shot01.png"
}
 
function myLoad()
{
	if (game_load("save01",1) <= 0) { 
		slot1_txt.flags |= SHOW; 
	} 
	else{
		slot1_txt.flags &= ~SHOW;
		game_load("save01", 1);
	}	
}



Then in my main function:

Code:
void main()
{
	video_mode = 10;
	video_depth = 32; // 32 bit mode
	video_screen = 1; // C-Script: start settings for Fullscreen*/
	
	fps_max = 60;
	
	level_load("level.wmb");


	// Wait for 3 frames, until the level is loaded
	on_f2 = mySave;
	on_f3 = myLoad;
	wait (3); 
		
}



Thank you in advance. Any ideas welcome.

Re: Saving / Loading crashing game [Re: 3dworld] #426839
07/30/13 16:08
07/30/13 16:08
Joined: Sep 2007
Posts: 173
USA, Florida
3dworld Offline OP
Member
3dworld  Offline OP
Member

Joined: Sep 2007
Posts: 173
USA, Florida
Got it I found the solution here:
Basically all PP effects should be disable and the enabled back:
http://www.opserver.de/ubb7/ubbthreads.p...true#Post404079


No matter what people tell you,  words and ideas can change the world.
Re: Saving / Loading crashing game [Re: 3dworld] #426841
07/30/13 16:38
07/30/13 16:38
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Just wanted to answer your question, but uve found my old thread already. ^^


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Saving / Loading crashing game [Re: rayp] #426866
07/31/13 00:20
07/31/13 00:20
Joined: Sep 2007
Posts: 173
USA, Florida
3dworld Offline OP
Member
3dworld  Offline OP
Member

Joined: Sep 2007
Posts: 173
USA, Florida
That's a really good advice. My problem now is as follow:

Let me put the code first and the the error:

My save function now:

Code:
function Mysave()
{
        //remove pp bloom effect
	BloomChecker = 1;
	Bloom();

	if (inkey_active == 1) {return;}
	if (players_health <= 0) {return;} 
	
	game_save("save", 1, SV_ALL);

        //restart pp bloom 	
	BloomChecker = 0;
	Bloom();
}



My Load function:
Code:
function Myload()
{
	if (game_load("save",1) <= 0) { 
		slot1_txt.flags |= SHOW; 
	} 
	else{
	 slot1_txt.flags &= ~SHOW; 
	
	 game_load("save", 1);
         BloomChecker = 0;
         Bloom();

	}	
}



Then in my main function:

Code:
void main()
{
	
	d3d_anisotropy = 2;
	d3d_mipmapping = 4;
	video_mode = 10;
	video_depth = 32; // 32 bit mode
	video_screen = 1; // C-Script: start settings for Fullscreen*/
	
	fps_max = 60;
	
	level_load("level.wmb");
	shadow_offset = 2;
	
	mouse_sync = 1;
	mouse_mode = 0;
	
	d3d_automaterial = 1+2; // automatically assign materials to textures and entities

  	shadow_stencil = 4; // activate z-fail stencil shadows
	shadow_lod = 2; // use the second LOD stage for stencil shadows
	stencil_blur(1); // activate blurred shadows (included in mtlView.c, look better)


	on_f2 = save_progress;
	on_f3 = load_progress;
	
	//pp bloom effect
	Bloom();
	
	// Wait for 3 frames, until the level is loaded	
	wait (3); 

}



I got no problems saving the game now and restarting the pp bloom effect, then after it finish loading the previous saved game it shows me this error, and a green square bitmap in the left hand side:

Malfunction W1508
Can't load save01.SAV


Any ideas.
Thank you in advance.

Re: Saving / Loading crashing game [Re: 3dworld] #426879
07/31/13 09:06
07/31/13 09:06
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Does the file exist? Is it named "save01.SAV"? Where are you saving? In the users directory? If not, are you allowed to save where you save?

Re: Saving / Loading crashing game [Re: PadMalcom] #426903
07/31/13 11:56
07/31/13 11:56
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Try to use this
Code:
game_save ("save",1, SV_ALL-SV_INFOS);

Added -SV_INFOS. Does this work ?


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Saving / Loading crashing game [Re: rayp] #426934
07/31/13 14:02
07/31/13 14:02
Joined: Sep 2007
Posts: 173
USA, Florida
3dworld Offline OP
Member
3dworld  Offline OP
Member

Joined: Sep 2007
Posts: 173
USA, Florida
Yeap, the .SAV file saved into the directory of the working folder where of my project itself. I'm going to try the solution from Rayp and I let you know.

Thank you for your help.


No matter what people tell you,  words and ideas can change the world.
Re: Saving / Loading crashing game [Re: 3dworld] #426938
07/31/13 14:19
07/31/13 14:19
Joined: Sep 2007
Posts: 173
USA, Florida
3dworld Offline OP
Member
3dworld  Offline OP
Member

Joined: Sep 2007
Posts: 173
USA, Florida
I've try the solution from Rayp and problem persist. The same error still displaying.
If I take of the bloom effect everything works just fine but then I lost the effect crazy


any suggestions?

Thanks in advance guys.


No matter what people tell you,  words and ideas can change the world.
Re: Saving / Loading crashing game [Re: 3dworld] #426949
07/31/13 14:45
07/31/13 14:45
Joined: Sep 2007
Posts: 173
USA, Florida
3dworld Offline OP
Member
3dworld  Offline OP
Member

Joined: Sep 2007
Posts: 173
USA, Florida
OK, got it working. Here is the code, maybe this will help someone else:

Basic save and load function:

Code:
var BloomChecker = 1;

function saving_game()
{
	//disable pp bloom before saving
	BloomChecker = 1;
	Bloom();

	if (inkey_active == 1) {return;}
	if (players_health <= 0) {return;}
	
	game_save("save", 1, SV_ALL-SV_INFO);
	
	//enable pp bloom after saving
	BloomChecker = 0;
	Bloom();
}

 
function loading_game()
{	
	//disable pp bloom before loading
	BloomChecker = 1;
	Bloom();
	
	//enable pp bloom after loading
	game_load("save", 1);
	BloomChecker = 0;
	Bloom();
	
}




Main function:

Code:
void main()
{

	video_mode = 10;
	video_depth = 32;
	video_screen = 2;
	
...................................................
	
	level_load("level.wmb");

	on_f2 = saving_game;
	on_f3 = loading_game;

..................................................
	
	wait (3);

        //initializing bloom effect 
	while(BloomChecker!=0){
		Bloom();
		BloomChecker = 1;	
		wait(1);
	}
}



Thank you for your help everyone. Enjoy smile


No matter what people tell you,  words and ideas can change the world.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1