Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, TipmyPip, OptimusPrime), 15,229 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Is this a bug? #369809
05/07/11 12:38
05/07/11 12:38
Joined: Apr 2011
Posts: 75
Malta
E
Ercoles Offline OP
Junior Member
Ercoles  Offline OP
Junior Member
E

Joined: Apr 2011
Posts: 75
Malta
I have found that if I use the game_save function to save the global variables only (SV_VARS) and then I restart the game and use the game_load function I start getting errors which usually do not occur. I nailed down the error causing command and it is this:

bmap_blit(changes_pcx,viewers[1][0],NULL,NULL);

now changes_pcx is a bmap defined at the start of the game with:

BMAP * changes_pcx = "blank.jpg";

while viewers[1][0] is a bmap array defined as follows:

BMAP* viewers[7][11];

and in main() function viewers[1][0] is defined as follows:

viewers[1][0]=bmap_create("carrack.jpg");

As I told you if I start a game and do not load there is no problem, but if I load a saved game there pops up the error. Also I checked saving and loading soon after without stopping the game and in this case the error does not occur. So I am concluding that the game_load function is affecting the bmap array even though it is supposed not to affect it. And by the way the definition of the viewers[1][0] is always done when the game starts and it is not changed through out the game, so the load function in theory should not affect it.

Is this a bug in the game_load function?

I also noted that string arrays are not saved well when I use SV_ALL. I think that string arrays and bmap arrays confuse game_save and game_load commands.

Last edited by Ercoles; 05/07/11 14:50.
Re: Is this a bug? [Re: Ercoles] #369868
05/08/11 09:46
05/08/11 09:46
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Read the game_save description in the manual:

game_save(STRING* name,var number,var mode)
Saves the current state of the application in a .sav file the savedir folder, for later resuming the game at the current position.
...
Remarks:
Objects are stored by their indices. Therefore levels, scripts, and objects must not change between game_save and game_load, with exception of level entities. All .._create and .._remove functions, except for creating and removing level entities, must be executed before the first game_save or game_load call.

Hope this helps.


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

Gamestudio download | 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