Jump to content
Sign in to follow this  
Indomitus

Player score sorting logic

Recommended Posts

Even though this might be considered a "community creation" I think it's more useful in the Visual Scripting section, so I'm putting the post here.

In the P1 chat today, someone asked about the logic I was using to sort scores for the leaderboard.  (I forget who asked, I'm sorry.)

For the benefit of all the creators here, I have built a universal version of the logic, that can be easily added to any scenario.  Feel free to use it, modify it, examine it and learn from it, whatever you want.  If you have questions, please ask, and if you find bugs or have suggestions, please let me know.

You can find it in the Workshop:

https://workshop.ylands.com/asset/794

 

code_screenshot.thumb.jpg.be2ac6ba4cc18c756ea092b3f2db69e9.jpg

 

play_screenshot.thumb.jpg.edfd89de90133abde841ecb281e18dfa.jpg

 

editor_screenshot.thumb.png.bdb284adf584aefabbca7299e23eb08e.png

 

 

  • Like 3
  • Upvote 2

Share this post


Link to post
Share on other sites

If they are equal, then this will simply put them in the same order they are in, in the starting lists (only for the ones who are the same score) which would probably be in the order they joined the game.  There would not be an error, but that might not be the result you want.  If you hit the "sort and show" lever before the randomize lever, it will do exactly this with all the scores being 0.

More complex comparisons are definitely possible, but the goal was for this one to be a very quick, general version.

If you have something specific in mind, I'm sure we could put something together for it.

Edited by Indomitus

Share this post


Link to post
Share on other sites

ok I did not say anything, I'm an idiot... xD is a game

Edited by Spyler.X

Share this post


Link to post
Share on other sites
31 minutes ago, bb cakes_P1 said:

@Spyler.X my friend.  You may be a lot of things, but not an idiot. 

9_9

I was going crazy thinking it was a composition and it did not work haha.
Even so I can not open the map to edit it just to play it, but this time I will make sure first that it is not my fault before I complainxD

 

  • Haha 1

Share this post


Link to post
Share on other sites
On 1/1/2019 at 12:51 PM, Spyler.X said:

I was going crazy thinking it was a composition and it did not work haha.
Even so I can not open the map to edit it just to play it, but this time I will make sure first that it is not my fault before I complainxD

 

I've noticed that myself.  I did set it to be editable before exporting, so it should be.  I might retry the upload this evening.

Share this post


Link to post
Share on other sites
7 hours ago, Indomitus said:

I've noticed that myself.  I did set it to be editable before exporting, so it should be.  I might retry the upload this evening.

I really could not, your previous map worked for me without problem.
But this one I can only edit it if I play it first, and the logic is hidden.

 

Redeagle has tested and it did not work either.
I've tried other maps and the same thing happens although I'm not sure if they uploaded it in editable format

 

Edited by Spyler.X

Share this post


Link to post
Share on other sites

I've tried sharing it as a composition.  I tried and was able to download it into a blank scenario in the editor.  Hopefully this works better.

https://workshop.ylands.com/asset/801

 

@Ane I got several errors while trying to upload thumbnails (with the original, and with the new one) and the "editable" feature for scenarios doesn't seem to be working?  I uploaded 2 "update" files for my scenario.  The first has the editable option set to yes, and the second has it set to no, just for the sake of trying a different thing.  Neither would show available to edit.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks @Indomitus, in composition format I could download it without problem.
I have a good time ahead to go a little crazy with this:P

Share this post


Link to post
Share on other sites

This was immensely helpful.

I'm glad I didn't destroy my brain trying to figure out how to code this!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×