• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Highscore Table

O

ofmiceandfreeman

Guest
Hi! I'm an absolute noob at GML, so please make your answers simple or well explained. I finished the Space Rocks tutorial, and am trying to add on to the game with my own twists, such as multiplayer and a highscore table. Does anyone know how to make a highscore table, that will save after the game is closed?
 

obscene

Member
It's not a very simple thing. There are a few parts to it you should learn individually....

First is how to hold the data. Basically you need a way to hold a bunch of score values and be able to sort them. This is called a data structure and the simplest type is a ds_list which is a simple, one-dimensional list which could hold scores, but no names, initials etc. You should start with the list and then if you want to add other fields you can graduate up to a ds_grid.

Here's a video on ds_lists

Specifically, you'll need to learn to 1) create a list, 2) add a new score to it, 3) sort it in descending order and then 4) read the list in your draw event.


Second, you'll need to learn how to read/write INI files which is how you will save the score when you close your game and load it when you start your game. Once you get the basics of that, you'll be using ds_list_read and ds_list_write to save your list into an INI file, which is actually the easiest part.

Here's a video on INI files

Good luck and feel free to ask more if you get lost.
 
O

ofmiceandfreeman

Guest
Thanks a lot! I just saw your response, and am trying it now!
 
O

ofmiceandfreeman

Guest
It's not a very simple thing. There are a few parts to it you should learn individually....

First is how to hold the data. Basically you need a way to hold a bunch of score values and be able to sort them. This is called a data structure and the simplest type is a ds_list which is a simple, one-dimensional list which could hold scores, but no names, initials etc. You should start with the list and then if you want to add other fields you can graduate up to a ds_grid.

Here's a video on ds_lists

Specifically, you'll need to learn to 1) create a list, 2) add a new score to it, 3) sort it in descending order and then 4) read the list in your draw event.


Second, you'll need to learn how to read/write INI files which is how you will save the score when you close your game and load it when you start your game. Once you get the basics of that, you'll be using ds_list_read and ds_list_write to save your list into an INI file, which is actually the easiest part.

Here's a video on INI files

Good luck and feel free to ask more if you get lost.

Thanks a lot! I just saw your response, and am trying it now! But the video is on Game maker 1, or an older version. Is that pretty much the same to GML 2?
 
Top