Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
0 registered members (), 1,320 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 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 | 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