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

Is there a percentage function in the editor?

Status
Not open for further replies.
sorry for not understanding d'ohh but random percentage doesn't have any functions but if this helps u can use it like this o.O

  • Unit - Set mana of (Triggering unit) to (Random percentage)%
random percentage can be used in autocasting spells (%= number betwen 0 and 100)
 
Last edited:
What I'm doing is:
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacked unit)) Equal to Lumber Mill

Now, in order to do the action I need a percentage function so I can put in 50% for example.
I want, when the lumber mill's health drops below 50%, the player attacking it captures it.
 
  • Events
    • Unit - A unit Is attacked
    • Conditions
      • ((Unit-type of (Attacked unit)) Equal to lumbermill) and ((Life of (Attacked unit)) Less than or equal to 50.00)
find the second condition under "real comparison" - "unit percentage life"
 
Raid1000, that doesn't work as intended. Life of Attacked Unit doesn't return a percentage.

Anteep, here's your simple solution since you've finally made it clear what you wanted to:

((Life of (Attacked Unit) / Max Life of (Attacked Unit)) less than or equal to 50)

A percentage is just a number over the intended. In this case, the current over the maximum.
 
Thanks all, this is the trigger I ended up doing and it works:


Events
Unit - A unit Is attacked
Conditions
((Unit-type of (Attacked unit)) Equal to Quarry [1]) and ((Percentage life of (Attacked unit)) Less than or equal to 50.00)
Actions
Unit - Change ownership of (Attacked unit) to (Owner of (Attacking unit)) and Change color
Unit - Set life of (Attacked unit) to 100.00%
 
Raid1000, that doesn't work as intended. Life of Attacked Unit doesn't return a percentage.

Anteep, here's your simple solution since you've finally made it clear what you wanted to:

((Life of (Attacked Unit) / Max Life of (Attacked Unit)) less than or equal to 50)

A percentage is just a number over the intended. In this case, the current over the maximum.

in the trigger u proposed, u will need to use 0.5 instead of 50
 
Status
Not open for further replies.
Back
Top