Lets say you are making a Role Player Game or something. Something big, so big that you need a saving and loading feature. Now game maker 8 has a saving and loading action, but it only saves one file. So only one person can play your game. You don't want that do you! You want to have 3, 5 or maybe 10 saving and loading slots right? Here is how you do this.
Lets say you have a object. obj_load_slot1. When you click on this you want it to load a game. You want it to load game slot 1. Here is how you do this. Put this code in the mouse left pressed event.
code:
game_load(slot1)
Its as simple as that! the (slot1) is the name of the file, so it will only load that if the file (slot1) exists. Here is how you would save your game. Lets say you have a object obj_save_slot1. You want your game to save as slot 1 when you click on it. Put this code in the mouse left pressed event.
Code:
game_save(slot1)
Now the game is saved under slot 1. To load that file the names have to be the same. You can name your file anything you want making it easier to search and find it. This code has to be one of the easiest codes that there are in game maker. Its almost like you are reading it. game save slot1. Now you can have a dozen saving and loading slots! All you have to do is name then and use these two simple codes.
No comments:
Post a Comment