playMaker

Author Topic: Local High Score List  (Read 5526 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Local High Score List
« on: March 20, 2016, 05:56:52 PM »
Hi!

Some time ago, I asked about how to add player names to the scores. I think "djaydino" made a small tutorial, but because of my frustration and that I was so f.... tired, I didn't watched it yet. And now I can't find it.

Now I'm almost finished with my new game for Android. I have a high score list which works very well, but without names. I almost got it to work with names. The names are placed correctly in the array for names, but I can't get it correctly to the UI. For example when I get the highest score, first place, and write my name, this name will be placed correctly in the array list and the UI. If I beat this score, get a new best score, then the previous score should be moved to the second place. It works in the array list, but not in the UI. I need to loop it or something, but I'm stuck.

Now, it's time to get this to work! So I ask: Can somebody help me? This will be useful for many people. High Score list is not the most common topic in this forum.
Maybe because that is very easy to do or people most of the time choose Google Leaderboard online high score. I don't want that, because I think people hack the high score all the time.

This topic will not be closed until my high score list works 100 %! :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Local High Score List
« Reply #1 on: March 20, 2016, 06:06:05 PM »
Hi,
I think you are looking for this video :


Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Local High Score List
« Reply #2 on: March 22, 2016, 02:38:53 AM »
Hi!

Why didn't I watched this the day you gave it to me? Maybe because I was very tired to try and try and try to get it to work!

I just need to say thank you so much! Finally I got it to work!
I was a little skeptical since it add player 1, 2, 3 and so on automatically, and this was not what I wanted, but it's just to show how to add names and connect it to the scores. The rest, I could figure out bymyself. And I did. When the game is over, a text box appear where I can write my name. When I press enter, the name will be placed correctly in the high score list. :)

Here is a screenshot of the high score in my next game Memorita which will be released soon. :)

Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Local High Score List
« Reply #3 on: March 22, 2016, 07:15:51 AM »
Hi,
I am happy for you that you got it to work :)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Local High Score List
« Reply #4 on: March 22, 2016, 03:54:18 PM »
Just one thing!

I want to highlight the current score I got in the highscore list with another color. Do you have any ideas how I can do this? I get the current score and store it in a variable, but then I need to find the name in the list that match this score or something, so the correct name and score will be highlighted.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Local High Score List
« Reply #5 on: March 22, 2016, 09:12:14 PM »
Hi,
i can't test now, but i think something like this :

When the score and name are saved into the array lists, get the index nr (it should be the last index number)
Then when sorting, add an int compare and compare the index from the sorter to the index that you saved.
When they are equal, let it highlight and after that let it continue sorting.

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Local High Score List
« Reply #6 on: March 23, 2016, 04:11:57 AM »
Hi!

Should it be in the same FSM? I added the Action Last Index Of in the Get Name State. But when I add the second score, I get an error:

ArgumentOutOfRange_Count
Parameter name: count
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Local High Score List
« Reply #7 on: March 23, 2016, 01:38:51 PM »
Hi,
Try using "array list Count"
I made a quick video on how you can set it up :


I might redo the tutorial and add this to it :)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Local High Score List
« Reply #8 on: March 23, 2016, 06:58:58 PM »
Hi!

Thank you! But I get an error after I write my name and then I go back to the main menu. When I click on Scores to show the high score list, I get this error:

High Score Manager : Array List : State 4 : ArrayListCount : ArrayList Proxy not found for reference <Score>
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Local High Score List
« Reply #9 on: March 24, 2016, 02:51:36 AM »
Hi,
It means that it can not find the reference you gave.

Is the action pointing to the right gameObject and is the reference name correct?

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Local High Score List
« Reply #10 on: March 24, 2016, 03:33:16 AM »
Hi!

I have 3 difficulties in the game, so I renamed the Array list to EasyScore. I forgot to change that to Array List Count. :) So it works now. Just need to experiment more. Because it also highlights the last score I got when I start the game.

But thanks for the help! :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Local High Score List
« Reply #11 on: March 24, 2016, 02:24:12 PM »
Hi,
you can reset the highlight when the high score is not showing anymore instead if resetting it before showing the high score.

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Local High Score List
« Reply #12 on: March 24, 2016, 09:22:11 PM »
Ok, but where do I reset the highlighted color? Is it on the Action U GUI Graphic Set Color, Reset On Exit?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Local High Score List
« Reply #13 on: March 25, 2016, 05:17:01 AM »
Hi,
I did not mean reset literally :)
i Mean that you can set in back to the way it was before so it matches again with the other lines.
 
you can make "last game object" and "last score object" as Globals.
Then you can change the color anywhere it fits to you,
it depends on how your project is set up.

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Local High Score List
« Reply #14 on: March 25, 2016, 06:06:45 AM »
Ok, thanks!

I will experiment a bit. :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no