1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  4. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  5. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[General] changing damage based on % of current hp

Discussion in 'World Editor Help Zone' started by [E]clipse, Jul 20, 2015.

  1. [E]clipse

    [E]clipse

    Joined:
    Jan 6, 2015
    Messages:
    559
    Resources:
    0
    Resources:
    0
    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:
     
  2. Arad MNK

    Arad MNK

    Joined:
    Dec 11, 2014
    Messages:
    1,889
    Resources:
    3
    Maps:
    2
    Spells:
    1
    Resources:
    3
    Set the percentage of life to An Integer and then set the integer as a damage. IMO JASS Should do it...
     
  3. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,855
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    and how do you imagine this to work?
     
  4. [E]clipse

    [E]clipse

    Joined:
    Jan 6, 2015
    Messages:
    559
    Resources:
    0
    Resources:
    0
    Damage is not an integer but acreal, still theres bo way that I can see to modify it
     
  5. PublishedShadow

    PublishedShadow

    Joined:
    Jun 2, 2013
    Messages:
    599
    Resources:
    2
    Maps:
    2
    Resources:
    2
    There is Conversion - Convert Integer to Real I believe.
     
  6. Shadow Fury

    Shadow Fury

    Joined:
    Nov 4, 2013
    Messages:
    1,630
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    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.
     
  7. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,855
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    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)
     
  8. Shadow Fury

    Shadow Fury

    Joined:
    Nov 4, 2013
    Messages:
    1,630
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    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.
     
  9. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,653
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Well... one ability will be the first.
    Assuming it wont matter later is not the best thing to assume.
    BonusMod will do, otherwise... I dont really see another way to do it actually.
     
  10. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,617
    Resources:
    27
    Packs:
    1
    Maps:
    8
    Spells:
    16
    Tutorials:
    2
    Resources:
    27
    If the damage is shown, then BonusMod is mandatory, else you can hack a little through DDS.
     
  11. Arad MNK

    Arad MNK

    Joined:
    Dec 11, 2014
    Messages:
    1,889
    Resources:
    3
    Maps:
    2
    Spells:
    1
    Resources:
    3
    Hey, I don't think 100 Levels should be used. Maybe 10 would do it.
    There are two ways:
    1. Upgrades: (Obvious IMO)
    2. This. It somehow did it using hashtables and it works in my map. Mind checking it?
     
  12. [E]clipse

    [E]clipse

    Joined:
    Jan 6, 2015
    Messages:
    559
    Resources:
    0
    Resources:
    0
    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.
     
  13. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    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.
     
  14. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,653
    Resources:
    3
    Spells:
    3
    Resources:
    3
    BonusMod
    Dunno why its in the graveyard though.
     
  15. Nichilus

    Nichilus

    Joined:
    Sep 26, 2009
    Messages:
    1,968
    Resources:
    0
    Resources:
    0
    Upgrades are limited. You can increase level of an upgrade, however you cannot decrease it. Hence you are limited here.


    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)
     
  16. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,149
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Nichilus, if your max damage is 100 or 109 or something, you can accomplish the same thing with 7 abilities. 7 abilities will be able to produce any value between 0 and 127. Keep in mind that every level on an ability is like another full ability (well, close enough). 7 abilities is a lot less than 21 levels of abilities ; ).
     
  17. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,653
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Using 10 leveled abilities is just easier to use.
    Ofcourse if you just go and think about it for a while, the binary way is not hard either but the 10 leveled way is still just obvious.
     
  18. Arad MNK

    Arad MNK

    Joined:
    Dec 11, 2014
    Messages:
    1,889
    Resources:
    3
    Maps:
    2
    Spells:
    1
    Resources:
    3
    It's simple Radix. I think you can do it now :D
     
  19. [E]clipse

    [E]clipse

    Joined:
    Jan 6, 2015
    Messages:
    559
    Resources:
    0
    Resources:
    0
    Thanks for all ur help guys !!
    Now Ive done it already ! (for a boss)