• 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.

Requesting a simple GUI system

Status
Not open for further replies.
This is how you do it in pseudo-code (I don't know how the correct trigger syntax is, since I only use JASS, but I think with this, you can will understand which actions to pick).


  • Set TEMP_UNIT = no unit
  • Pick every unit in TEMP_GROUP an do actions:
  • If: TEMP_UNIT equals no unit
  • then: Set TEMP_UNIT = Picked Unit
  • Else:
    • If: (Life of (Picked Unit) < Life of TEMP UNIT)
    • then: Set TEMP_UNIT = Picked Unit
After this block TEMP_UNIT always contains the unit with the lowest health of TEMP_GROUP.
 
Level 21
Joined
Aug 13, 2011
Messages
739
You can use the priest in the map to heal the lowest HP unit and get a new lowest.

Edit: Disable the first HP check trigger and enable the percent one if you want to check for the lowest percentage. I'm not sure which you needed :prazz:
 

Attachments

  • Lowest HP Check.w3x
    9.6 KB · Views: 68
Last edited:
Level 37
Joined
Aug 14, 2006
Messages
7,614
Yeah, that's close to how I was setting it up.

You can use the priest in the map to heal the lowest HP unit and get a new lowest.

What? What is that simple? And you even use same variables names that I am using. Something feels odd... Have you been spying on me? Oh now I remember! You've helped me before. Not just once but million times!

Well thanks. Hopefully this is the final time I request something. The project is soon finished!
 
Status
Not open for further replies.
Top