• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Detect lowest integer??

Status
Not open for further replies.
Level 8
Joined
Jan 4, 2009
Messages
110
Ok!
i am working on a score system, and want to detect the lowest integer
but i cannot come up with formula or a trigger so i decided to ask people here

for example i made a multiboard with numbers of kills a player does
and i want to detect a player(s) with the lowest number of kills as shown on multiboard to do further action, so all i want is a trigger which detect a player(s) with the lowest integer (numbers of kills in this case)
(no leaderboard involve)

Ps. is that clear to you guys?
Thankyou very much
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Is it an array? If you do it would be something like this, where Low the value of the smallest value in the array and LowIndex is the index at which it was found.

  • Actions
    • Set Low = YourValues[0]
    • Set LowIndex = 0
    • For each (Integer A) from 0 to 9, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • YourValues[(Integer A)] Less than Low
          • Then - Actions
            • Set Low = YourValues[(Integer A)]
            • Set LowIndex = (Integer A)
          • Else - Actions
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Okay, let me show you. It'll take a second.

Okay well it's pretty well the exact same trigger as what I showed you, except instead of YourValues the array is named Kills and you're looping from 1 to 12, rather than 0 to 9. This is because there are a maximum of 12 players per game, the first one of which (in GUI) starts at index "1".
 
Level 8
Joined
Jan 4, 2009
Messages
110
Okay, let me show you. It'll take a second.

Okay well it's pretty well the exact same trigger as what I showed you, except instead of YourValues the array is named Kills and you're looping from 1 to 12, rather than 0 to 9. This is because there are a maximum of 12 players per game, the first one of which (in GUI) starts at index "1".

oh, well,
now i understand, thank you very much :xxd:
 
Status
Not open for further replies.
Top