Jump to content


Photo

Save game help


  • Please log in to reply
6 replies to this topic

#1 Gixxorz

Gixxorz

    GMC Member

  • New Member
  • 7 posts
  • Version:GM8

Posted 12 June 2012 - 04:57 PM

Hey guys, i was wondering if anyone could give me a hand please.

So here's the problem, i am trying to create a game save system kind of like the ones in pokemon.

example:
choose a save slot
save1 <-
save2 <-
save3 <-

choose a game to load
load1 <-
load2 <-
load3 <-

so basically you choose which one you want and save 1 will save a game as save 1 and then when you press [S] in game it saves it as which one you chose.
i tried doing this with drag and drop variables but it didnt work (i am not good with GML so i use drag and drop).

Thanks
  • 0

#2 ZyklonMiraj

ZyklonMiraj

    GMC Member

  • GMC Member
  • 136 posts
  • Version:Unknown

Posted 12 June 2012 - 05:11 PM

in step event of a control object type this:
//to save
if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('S'))
game_save('save1')//or asave file name

if keyboard_check_pressed(ord('2)) and keyboard_check_pressed(ord('S'))
game_save('save2')//or asave file name

if keyboard_check_pressed(ord('3)) and keyboard_check_pressed(ord('S'))
game_save('save3')//or asave file name

//to load
if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('L'))
game_load('save1')//or asave file name

if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('L'))
game_load('save1')//or asave file name

if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('L'))
game_load('save1')//or asave file name
press this Posted Imagebutton at the end of this post if this helps
  • 0

#3 Gixxorz

Gixxorz

    GMC Member

  • New Member
  • 7 posts
  • Version:GM8

Posted 12 June 2012 - 05:26 PM

thank you very much but not quite what i mean, how would i make it on a click screen so you have to click save1 2 or 3 and load 1, 2 or 3?

that is just if you press the keys
  • 0

#4 ZyklonMiraj

ZyklonMiraj

    GMC Member

  • GMC Member
  • 136 posts
  • Version:Unknown

Posted 12 June 2012 - 05:31 PM

thank you very much but not quite what i mean, how would i make it on a click screen so you have to click save1 2 or 3 and load 1, 2 or 3?

that is just if you press the keys

Mke different objects with spryte sayin save1,save2 etc...
in the mouse click event of save1
write game_save('save1') and so on for all others
in the mouse click event of load1
write game_load('save1')
  • 1

#5 Gixxorz

Gixxorz

    GMC Member

  • New Member
  • 7 posts
  • Version:GM8

Posted 12 June 2012 - 06:19 PM

thank you very much
  • 0

#6 Gixxorz

Gixxorz

    GMC Member

  • New Member
  • 7 posts
  • Version:GM8

Posted 12 June 2012 - 06:51 PM

also, sorry for this if its a stupid question but is there anyway to just make it press [S] using variables instead of [S] and [a number]:
//to save
if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('S'))
game_save('save1')//or asave file name

if keyboard_check_pressed(ord('2)) and keyboard_check_pressed(ord('S'))
game_save('save2')//or asave file name

if keyboard_check_pressed(ord('3)) and keyboard_check_pressed(ord('S'))
game_save('save3')//or asave file name

//to load
if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('L'))
game_load('save1')//or asave file name

if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('L'))
game_load('save1')//or asave file name

if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('L'))
game_load('save1')//or asave file name

Edited by Gixxorz, 12 June 2012 - 06:58 PM.

  • 0

#7 ZyklonMiraj

ZyklonMiraj

    GMC Member

  • GMC Member
  • 136 posts
  • Version:Unknown

Posted 13 June 2012 - 04:50 AM

also, sorry for this if its a stupid question but is there anyway to just make it press [S] using variables instead of [S] and [a number]:

//to save
if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('S'))
game_save('save1')//or asave file name

if keyboard_check_pressed(ord('2)) and keyboard_check_pressed(ord('S'))
game_save('save2')//or asave file name

if keyboard_check_pressed(ord('3)) and keyboard_check_pressed(ord('S'))
game_save('save3')//or asave file name

//to load
if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('L'))
game_load('save1')//or asave file name

if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('L'))
game_load('save1')//or asave file name

if keyboard_check_pressed(ord('1')) and keyboard_check_pressed(ord('L'))
game_load('save1')//or asave file name

I dont get what u mean,but it is possible,but only one save file would be possible.like
if keyboard_check_pressed(ord('S'))
game_save('save1')
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users