• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Pick Highest of 5 Integers

Status
Not open for further replies.
Level 22
Joined
Mar 16, 2008
Messages
1,018
Trying to imagine the best way to do this. Pick highest of 5 Integers, since the GUI function only has 2 input spots.

  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • highest_no_hero[SaveLoadEvent_PN] Greater than 0
    • Then - Actions
      • Set VariableSet difficulty_highest_load[SaveLoadEvent_PN] = highest_no_hero[SaveLoadEvent_PN]
    • Else - Actions
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • highest_warden[SaveLoadEvent_PN] Greater than 0
      • highest_warden[SaveLoadEvent_PN] Greater than highest_no_hero[SaveLoadEvent_PN]
    • Then - Actions
      • Set VariableSet difficulty_highest_load[SaveLoadEvent_PN] = highest_warden[SaveLoadEvent_PN]
    • Else - Actions
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • highest_dh[SaveLoadEvent_PN] Greater than 0
      • highest_dh[SaveLoadEvent_PN] Greater than highest_no_hero[SaveLoadEvent_PN]
      • highest_dh[SaveLoadEvent_PN] Greater than highest_warden[SaveLoadEvent_PN]
    • Then - Actions
      • Set VariableSet difficulty_highest_load[SaveLoadEvent_PN] = highest_dh[SaveLoadEvent_PN]
    • Else - Actions
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • highest_potm[SaveLoadEvent_PN] Greater than 0
      • highest_potm[SaveLoadEvent_PN] Greater than highest_no_hero[SaveLoadEvent_PN]
      • highest_potm[SaveLoadEvent_PN] Greater than highest_warden[SaveLoadEvent_PN]
      • highest_potm[SaveLoadEvent_PN] Greater than highest_dh[SaveLoadEvent_PN]
    • Then - Actions
      • Set VariableSet difficulty_highest_load[SaveLoadEvent_PN] = highest_potm[SaveLoadEvent_PN]
    • Else - Actions
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • highest_kotg[SaveLoadEvent_PN] Greater than 0
      • highest_kotg[SaveLoadEvent_PN] Greater than highest_no_hero[SaveLoadEvent_PN]
      • highest_kotg[SaveLoadEvent_PN] Greater than highest_warden[SaveLoadEvent_PN]
      • highest_kotg[SaveLoadEvent_PN] Greater than highest_dh[SaveLoadEvent_PN]
      • highest_kotg[SaveLoadEvent_PN] Greater than highest_potm[SaveLoadEvent_PN]
    • Then - Actions
      • Set VariableSet difficulty_highest_load[SaveLoadEvent_PN] = highest_kotg[SaveLoadEvent_PN]
    • Else - Actions
  • ...
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • highest_no_hero[SaveLoadEvent_PN] Greater than 0
    • Then - Actions
      • Set VariableSet difficulty_highest_load[SaveLoadEvent_PN] = highest_no_hero[SaveLoadEvent_PN]
    • Else - Actions
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • highest_warden[SaveLoadEvent_PN] Greater than difficulty_highest_load[SaveLoadEvent_PN]
    • Then - Actions
      • Set VariableSet difficulty_highest_load[SaveLoadEvent_PN] = highest_warden[SaveLoadEvent_PN]
    • Else - Actions
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • highest_dh[SaveLoadEvent_PN] Greater than difficulty_highest_load[SaveLoadEvent_PN]
    • Then - Actions
      • Set VariableSet difficulty_highest_load[SaveLoadEvent_PN] = highest_dh[SaveLoadEvent_PN]
    • Else - Actions
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • highest_potm[SaveLoadEvent_PN] Greater than difficulty_highest_load[SaveLoadEvent_PN]
    • Then - Actions
      • Set VariableSet difficulty_highest_load[SaveLoadEvent_PN] = highest_potm[SaveLoadEvent_PN]
    • Else - Actions
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • highest_kotg[SaveLoadEvent_PN] Greater than difficulty_highest_load[SaveLoadEvent_PN]
    • Then - Actions
      • Set VariableSet difficulty_highest_load[SaveLoadEvent_PN] = highest_kotg[SaveLoadEvent_PN]
    • Else - Actions
  • ...
 
Last edited:
There are several ways to do that, first you can use the max function but nested like this:

max(1, max(2, 3))

Or you can use a loop to compare all the values which is the most standard way to do it:

Set value[1] = <first value>
Set value[2] = <second value>
...
Set value[5] = <fifth value>

Set max = - 1
For i = 1 to 5
If value > max then
Set max = value
 
Was worried nesting would bug it out because it happened to me once with concentrate strings function, or maybe I'm making that up.

but your 2nd idea is similar to the one in my "draft 2" trigger so I guess that will work. thanks.
 
Status
Not open for further replies.
Back
Top