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"

Is there any way sort an array from lowest to highest

I am currently trying to make a local scoreboard and I need a way of ordering the values from lowest to highest.

I know about the method shown here https://answers.unrealengine.com/questions/176672/sorting-float-array-numerically.html I need a way to have an array the holds both text (the player's name) and integers (the players score) and have these in order if biggest score to smallest score so I can promote these value to variables for the GUI

Product Version: UE 4.12
more ▼

asked Jul 10 '16 at 03:46 PM in Blueprint Scripting

avatar image

28 4 8 10

avatar image Pief Paf Poef Dec 07 '18 at 12:15 PM

A screenshot would be nice for others who might need it. ( Me for example ). I'm still unclear on how to acchieve this.

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

1 answer: sort voted first

Pretty simple make 2 arrays one holds the score and the second holds the names (when adding or removing from the arrays makes sure to do the same to both of them), then just get the index of the max value remove it from the array with the names(place it in a new array that will be the final one for the names), and then remove the max number itself from the array with the scores(do the same here as the other one), now you have 2 arrays that are ordered by score, when you need the highest score take the index of 0 ( 1 2 ...and etc) from both of them and you will have the name and the score.

more ▼

answered Jul 10 '16 at 04:10 PM

avatar image

478 21 10 25

avatar image TheLazyHatGuy Jul 10 '16 at 04:12 PM

That sounds perfect. Don't know why I didn't think of it. Would you by any chance have a picture of an example blueprint?

avatar image DDemon Jul 11 '16 at 07:07 AM

No I don't have an example for you, its really basic, just do it step after step you finish it in 5 min.

avatar image TheLazyHatGuy Jul 11 '16 at 05:44 PM

Took me a few hours but I got there in the end :D

avatar image DDemon Jul 11 '16 at 05:53 PM

Don't worry next time it will be only copy paste :P

(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