x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to sort an integer array in blueprint?

Hi everyone, I am trying to implement an scoreboard using blueprint which will sort player scores in descending order and show only top five of them, no matter how much time the game has been played. So , basically I need a sorted array. I have checked some YouTube videos and some UE4 answers, but frankly to say, I haven't understood quite clear. I'm quite new to Unreal and this is our first team project. So, if someone please upload a blueprint image of how to sort an integer array with simple methods, I'll be greatly helped. For someone who wish to help, My scoreboard only contains integers and this integer array is supposed to be worked on saved scores and it'll be shown when the player dies. Thanks in advance.

Product Version: UE 4.19
Tags:
more ▼

asked Jun 26 '18 at 09:14 AM in Blueprint Scripting

avatar image

Gazzali Fahim
5 1 3 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You Can use max to get the top value.

You can then remove it using its index and repeat the process to get the next highest.

alt text

untitled.png (26.2 kB)
more ▼

answered Jun 26 '18 at 09:47 AM

avatar image

HarryHighDef
1.4k 1 14 17

avatar image Gazzali Fahim Jun 26 '18 at 09:59 AM

@HarryHighDef ,Thanks. Didn't know about that. But I think in this way I need another integer array to serve the purpose of saving and showing the top 5 scores. How to loop that? For loop or ForEach loop?

avatar image HarryHighDef Jun 26 '18 at 10:19 AM

Yeah a for loop would do it.

alt text

untitled.png (70.7 kB)
avatar image Gazzali Fahim Jun 26 '18 at 10:29 AM

@HarryHighDef, Thanks. I'll try to do that. :)

avatar image HarryHighDef Jun 26 '18 at 03:33 PM

Any Luck?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question