Le_Beholder
Member
Hello, I've finally figured out how to implement saving by ini file writing into my game, now im running into what i hope is the last hurdles in that effort.
so far I can save how many hearts the player has, how many bombs hes got, and how big his health is.
what im now trying to do is save the exact x and y coordinate of the room hes in at the moment of saving, and then having actually appear there upon load.
so far all ive got is
just as the players create event variable setup,
saving what i think those values should be,
and that for loading.
all i can think of so far is somehow having the player jump_to_point global.Ypos and global.Xpos, after the game control object check whether global.loading is set to true.
(which global.loading is also used in the games first room, the title menu screen to load the game only after switching rooms to the main game one where the saving takes place. if that makes sense..)
any thoughts? thanks in advance..
EDIT:
i solved it lol.
so far I can save how many hearts the player has, how many bombs hes got, and how big his health is.
what im now trying to do is save the exact x and y coordinate of the room hes in at the moment of saving, and then having actually appear there upon load.
so far all ive got is
Code:
global.Xpos = obj_player.x;
global.Ypos = obj_player.y;
Code:
ini_write_real('save1','Xpos',global.Xpos);
global.Xpos = ini_read_real('save1','Xpos',global.Xpos)
ini_write_real('save1','Ypos',global.Ypos);
global.Ypos = ini_read_real('save1','Ypos',global.Ypos)
Code:
global.Xpos = ini_read_real('save1','Xpos',global.Xpos)
global.Ypos = ini_read_real('save1','Ypos',global.Ypos)
all i can think of so far is somehow having the player jump_to_point global.Ypos and global.Xpos, after the game control object check whether global.loading is set to true.
(which global.loading is also used in the games first room, the title menu screen to load the game only after switching rooms to the main game one where the saving takes place. if that makes sense..)
any thoughts? thanks in advance..
EDIT:
i solved it lol.
Code:
if global.loading = true
{
load_game();
obj_player.x = global.Xpos;
obj_player.y = global.Ypos;
global.loading = false;
}
else
{
global.loading = false;
}
Last edited: