• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

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: 67
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