Jump to content


Photo

High Score Table


  • Please log in to reply
8 replies to this topic

#1 warspite2

warspite2

    GMC Member

  • GMC Member
  • 188 posts
  • Version:GM:Studio

Posted 06 October 2012 - 02:19 AM

Anyone able to get a high score table of any kind setup and running in GMS?
  • 0

#2 janlucvd

janlucvd

    GMC Member

  • GMC Member
  • 32 posts
  • Version:GM:Studio

Posted 01 November 2012 - 10:47 PM

I asked that question days ago.

Nothing.
  • 0

#3 PanicBomber

PanicBomber

    Panic Arts

  • GMC Member
  • 635 posts
  • Version:GM:Studio

Posted 02 November 2012 - 06:38 AM

what kind of question is that? You can make your own highscore tables.
  • 0

#4 AJArmstron

AJArmstron

    GMC Member

  • GMC Member
  • 159 posts
  • Version:GM:HTML5

Posted 02 November 2012 - 08:29 PM

Hi - do either of you both still have questions about drawing high score tables? I have spent the past few days looking at drawing high score tables for myself. They are quite easy to do, although it gets a lot more complicated and potentially very time consuming if you are going to create your own online database.

GM still keeps some commands for making a high score table list, but you have to draw them for yourself (which means making a loop and drawing the values).

The key commands are:
highscore_add(String Name,Number Score) - this will add a score to the high score list and if the score is higher than what is there already it makes a new entry.

To simply recall the high score data use: highscore_name(position) and highscore_value(position).

The positions are for 1 to 10.

You can clear the table by doing highscore_clear();

I think the difficulty is getting the player to input the score (i.e. that needs thinking about for screen input and touch device input.)

If you want I send send you a file which contains my high score table constructed.
  • 1

#5 janlucvd

janlucvd

    GMC Member

  • GMC Member
  • 32 posts
  • Version:GM:Studio

Posted 03 November 2012 - 04:21 PM

Hi - do either of you both still have questions about drawing high score tables? I have spent the past few days looking at drawing high score tables for myself. They are quite easy to do, although it gets a lot more complicated and potentially very time consuming if you are going to create your own online database.

GM still keeps some commands for making a high score table list, but you have to draw them for yourself (which means making a loop and drawing the values).

The key commands are:
highscore_add(String Name,Number Score) - this will add a score to the high score list and if the score is higher than what is there already it makes a new entry.

To simply recall the high score data use: highscore_name(position) and highscore_value(position).

The positions are for 1 to 10.

You can clear the table by doing highscore_clear();

I think the difficulty is getting the player to input the score (i.e. that needs thinking about for screen input and touch device input.)

If you want I send send you a file which contains my high score table constructed.


  • -1

#6 andyphillips20

andyphillips20

    GMC Member

  • GMC Member
  • 135 posts
  • Version:GM:Studio

Posted 04 November 2012 - 04:21 AM

I've been wondering this as well. I'm new to coding and when ever I type this

highscore_add(String Name,Number Score)

it says I need either a "," or ")" how do i fix that?

Edited by andyphillips20, 04 November 2012 - 04:24 AM.

  • 0

#7 janlucvd

janlucvd

    GMC Member

  • GMC Member
  • 32 posts
  • Version:GM:Studio

Posted 04 November 2012 - 01:12 PM

I've got the score variable to record and work, but for the name I just had to create something like "Highscore:".

If someone knows the exact code to ask for a players name and that name gets saved in the "name" part of the highscore_add(name, score), let me know!
  • 0

#8 Pizzastron

Pizzastron

    GMC Member

  • GMC Member
  • 40 posts

Posted 04 November 2012 - 02:09 PM

Hello,

@andyphillips20: Your variable names must not contain spaces, this is why you have an error message. Give your variables names such as "StringName" instead of "String Name" and "NumberScore" instead of "Number Score" and it should work.

@janlucvd: Here is an example of what you could do to get the players' names:

First, in the create event of the object which will get the player's name, or anywhere you think it could be best to put it, add an "Execute Code" action with:
io_clear();
This will empty the keyboard buffer. Then in the step event, have:
if (string_length(keyboard_string) <= 12)
{
    NameString = keyboard_string;
}
else
{
    NameString = string_copy(keyboard_string, 1, 12);
}
This will check on every step what is in the keyboard buffer and assign it to NameString, which obviously is the variable containing the player's name. If the name is longer than 12 characters, it will be cropped to the first 12 characters. You can modify the '12' values to what suits you best.

Finally, add a "release <Enter>" event in which you will for instance have:
highscore_add(NameString, score);
and that might do the job. You can of course refine this to your will or add anything you could think of... Might not be the best code there is, but it works perfectly fine.

Bye !

Edited by Pizzastron, 04 November 2012 - 02:13 PM.

  • 0

#9 creativitaal

creativitaal

    GMC Member

  • New Member
  • 4 posts
  • Version:GM:Studio

Posted 02 February 2014 - 11:31 PM

Thank you for the instructions above, Pizzastron. I created 'obj_highscore' and in the final step (where you lose the game) I put an 'create object' action to get obj_highscore. But... it doesn't appear.Where did I make a mistake?


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users