• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[General] changing damage based on % of current hp

Status
Not open for further replies.

Deleted member 242951

D

Deleted member 242951

I want to know that how can I change a units hp percentage to damage. Like 80 % hp = 80 dmg

Also I want 2 know is there a way to do it without CSS.

Thnx in advance. :as:
 
Damage is not an integer but acreal, still theres bo way that I can see to modify it
 
There is a possible solution. Firstly, you'll have to create a skill based on Item Damage Bonus (+1) and let it have 100 levels (level 1 = 1 damage, level 2 = 2 damage, level 3 = 3 damage etc...). Give this skill to your unit then you set the level of the skill to the percentage life of the units using this trigger:

  • Update HP
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit - Set level of Item Damage Bonus (+1) for [Your Unit] to (Integer((Percentage life of [Your Unit])))
If there are multiple units, assign the units to a unit group, pick every unit in that groupn replace [Your Unit] with (Picked unit), destroy the group and that's all. I can't think of other solutions.
 
at that point, he can just use some form of bonus mod with multiple abilities(for this, 9 will do), because afaik 9 abilities load a lot faster than 1 ability with 100 lvls(depends on how much stuff you change in it of course)

I'm aware that a skill with 100 levels takes much time to load but if it's going to be the only skill with so many levels, I guess it can be acceptable and not interfere too much with the loading times.
 
Problem still not solved.

@Daffa and Weitol, whats the Bonus mod, u mean CSS ?

@Shadow fury, Maybe Ill have to do that if I dont find a better solution. Thanks BTW

@Arad MNk, actually Ive seen that but I didnt get how it works in saving the damage and stats of items.
 
Bonus creats a few buffs for your map and applies them to a unit. Buffs represent 1's in binary, so any number can be achieved with minimal buffs. 10 abils can go up to 2^10 - 1, or 1023. The attack will show with +damage green text.

To change precise attack, you can use tomes. Same deal.

To change damage output without showing attack, you can modify the damage as it is applied to a unit. You can still show the attack via an item with item charges in an inventory.
 
There are two ways:
1. Upgrades: (Obvious IMO)
Upgrades are limited. You can increase level of an upgrade, however you cannot decrease it. Hence you are limited here.


Item Damage Bonus (+1) and let it have 100 levels ...
No need for that much. All you need is actually 2 abilities, one with 10 levels that increases damage by 0-9 and other with 11 levels that increases damage by multiples of 10: 0, 10, 20, ..., 90, 100.

Then you have this:
  • Set hp = Integer(Percentage hp of unit)
  • Set bigger_bonus_level = (hp / 10) + 1
  • Set lower_bonus_level = mod(hp, 10) + 1
  • Unit - set level of stronger_boost to bigger_bonus_level
  • Unit - set level of weaker_boost to lower_bonus_level
E.g. % Hp of unit: 82.75%
hp = Int(%hp) = 82
bigger_bonus = hp/10 + 1 = 9
lower_bonus = mod(hp, 10) + 1 = (82 % 10) + 1 = 3

bigger_level = 9 = 80% (remember, you start at level 1 with 0 dmg bonus)
lower_level = 3 = 2% (remember, you start at level 1 with 0 dmg bonus)
 
Status
Not open for further replies.
Back
Top