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. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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.

Negative Health

Discussion in 'World Editor Help Zone' started by Seavalan Legend, Mar 15, 2017.

  1. Seavalan Legend

    Seavalan Legend

    Joined:
    Dec 19, 2016
    Messages:
    45
    Resources:
    0
    Resources:
    0
    Is it possible using triggers to have a unit lose more than their maximum health so they have health below 0. Thanks in advance.
     
  2. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,656
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    If a unit has 10 hp you can deal 1000 damage with triggers, but the hp will just go down to 0 I believe.

    For what purpose is negative hp needed?
     
  3. DracoL1ch

    DracoL1ch

    Joined:
    Dec 12, 2010
    Messages:
    1,762
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    in short - no, you can't do that. alive unit with negative HP will be counted as dead and can never be killed, revived, healed etc
     
  4. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,472
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Won't visibly show on the unit picture however yes it is possible with triggers to use and manage this.
     
  5. Seavalan Legend

    Seavalan Legend

    Joined:
    Dec 19, 2016
    Messages:
    45
    Resources:
    0
    Resources:
    0
    Is it possible to make it say it has negative health then, even if it doesn't actually, because I want it to have the illusion of the unit having negative health.
     
  6. Kakerate

    Kakerate

    Joined:
    Oct 18, 2013
    Messages:
    472
    Resources:
    0
    Resources:
    0
    I think if you make the value of a unit's life to high that it overflows, then it is treated as "negative" health. But unless it's a hero that can be revived, I don't think you have any way of working with the unit.
     
  7. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,472
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    What are you trying to do with this? A unit/hero with negative health becomes nearly invulnerable by normal forms of damage so if you could explain a bit more would be helpful and I will upload an example map sometime today or tomorrow.

    Around 2.1 billion some part of the integer system fails and tries to kill the unit/hero however the health value is actually a real so this can be bypassed as reals can go way higher then integers. The actual limit before the game decides to set the objects health to 0 is around 27 or 28 zero's. You don't even need to kill the hero or unit as we have had the ability to stop unit/hero death for a while, I think its been possible since phoenix got added into the game however there is a few other methods to achieve this visually(meant as unit not dying) or some type of revive/respawn however actually not requiring any form of revive/respawn is limited to only one ability last I checked.
     
    Last edited: Mar 17, 2017
  8. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,695
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Large health numbers are prone to calculation error. Eg if you give a unit a couple of billion health and then attack it with a normal melee unit, it will take 0 damage from the attack as the damage amount is less than the epsilon of the health.
     
  9. Seavalan Legend

    Seavalan Legend

    Joined:
    Dec 19, 2016
    Messages:
    45
    Resources:
    0
    Resources:
    0
    Sorry for the vague wording on my request. I had poor internet at the time and couldn't type very much very fast. So what I plan to do is a boss fight. In the fight, when the boss is killed (which will be very easy), they will come back to life. The boss will then become very powerful, and will have 0 health at the start of the second stage. When they take damage, they will have negative health, and will be able to take damage but can't be killed. The way to defeat the boss is to outlast them. Eventually what is keeping them alive will fail and they will die. The negative health is to make them seem undefeatable. The only problem is the unit will be a hero. If necessary, I will make them a non-hero if a hero status will break it. Thank you for the help! :D
     
  10. Erkki2

    Erkki2

    Joined:
    Jun 6, 2007
    Messages:
    382
    Resources:
    7
    Skins:
    6
    Spells:
    1
    Resources:
    7
    In your scenario, I would set the health to 1 (or even below) and use a damage detection system to negate all damage that the boss takes. Health won't be seen as negative, but it gives the "undefeatable" feeling.
     
  11. Seavalan Legend

    Seavalan Legend

    Joined:
    Dec 19, 2016
    Messages:
    45
    Resources:
    0
    Resources:
    0
    Okay, thank you for the suggestion! :D Sorry for wasting all your guys' time, I was hoping there was a way to have it show negative health.
     
  12. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,472
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    I meant to post an example sooner, my bad however here's two examples of negative health. The other methods are usually a dummy minus health ability combined with the stop death ability from phoenix or coded revive.

    This does mess up some code for getting object health however there is an easy fix if you know how to use coded abilities or/and a damage detection system and unit indexers as max health still displays properly.
     

    Attached Files: