How to make a unit not die by an attack more than its max HP?

Ayanami

칼리
Reaction score
288
In the first place, why 100% GUI? It cannot be efficient. There's no way it will be. You will at least have to integrate basic JASS functions, at least for leak removal. I don't see why there is a need to use 100% GUI. And as I said, Weep's GDD uses global variables. So no custom script will be needed. It's just that his snippet is written in JASS, but you'll be able to use his GDD functions with Global Variables, meaning GUI. There's a reason why it's called GUI-Friendly Damage Detection (GDD).
 

mapguy

New Member
Reaction score
46
In the first place, why 100% GUI? It cannot be efficient. There's no way it will be. You will at least have to integrate basic JASS functions, at least for leak removal. I don't see why there is a need to use 100% GUI. And as I said, Weep's GDD uses global variables. So no custom script will be needed. It's just that his snippet is written in JASS, but you'll be able to use his GDD functions with Global Variables, meaning GUI. There's a reason why it's called GUI-Friendly Damage Detection (GDD).
I only use some custom scropts like:
call RemoveLocation (udg_loc)
call DestroyGroup (udg_group)
and some others


WOW!

I DIND IT NOW!

USING my way of reciclying units I can detect buffs in dead units because they are not dead, I just hide them and make invul + pause.
using my way I can detect buffs on units supposed to be dead.
I dont thing GDD ca doo it :D
 

Jedi

New Member
Reaction score
63
Wummi found his answer too, but somebody haven't noticed this yet.
I love happy ends :rolleyes:
 

Wummi

Just Relax and Smile!
Reaction score
58
and you also successfully hijacked this thread.
and Wummi has not found his answer yet.

Ok, I believe my answer lies within Weep's GDD? I don't know what its about, so I'm going to go take a look at it now. Hopefully I'll understand it.

And as for
just use the item ability +100 HP. and changee to +999999 HP.
then you give this ability to the unit when damage is DETECTED and starts a countdown timer that will expire in 0.00 seconds. when timer expires you remove the ability from the unit.

no need for WEPP.

only use the basic:

a unit takes damage
It still doesn't work, because if the unit is already dead from being hit by more than its current HP in one shot, how can you add the item ability to it?
 

Wummi

Just Relax and Smile!
Reaction score
58
Preplaced (already on the map). It would be wonderful if someone could post a trigger of how it would work.
 

mapguy

New Member
Reaction score
46
Ok, I believe my answer lies within Weep's GDD? I don't know what its about, so I'm going to go take a look at it now. Hopefully I'll understand it.

And as for

It still doesn't work, because if the unit is already dead from being hit by more than its current HP in one shot, how can you add the item ability to it?

the damage is detected before it is dealed
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Maybe this is a use for the seemingly useless Unit is attacked function in GUI.
 

Wummi

Just Relax and Smile!
Reaction score
58
the damage is detected before it is dealed

If that is the case, how come my Fortress still dies when the first action of the trigger is to turn the Fortress Invulnerable?

Trigger:
  • Fortress Takes Damage
    • Events
      • Fortress 0000<gen> takes damage
    • Conditions
      • Life of Triggering unit is less than or equal to 12000
    • Actions
      • Make triggering unit Invulnerable


If at any given moment the Fortress' Hitpoints is greater or equal to 13000 and say a creep with 50000 Chaos Damage comes and attacks it, the Fortress is still destroyed.
 

mapguy

New Member
Reaction score
46
If that is the case, how come my Fortress still dies when the first action of the trigger is to turn the Fortress Invulnerable?

Trigger:
  • Fortress Takes Damage
    • Events
      • Fortress 0000<gen> takes damage
    • Conditions
      • Life of Triggering unit is less than or equal to 12000
    • Actions
      • Make triggering unit Invulnerable


If at any given moment the Fortress' Hitpoints is greater or equal to 13000 and say a creep with 50000 Chaos Damage comes and attacks it, the Fortress is still destroyed.

Maybe the invul ocurs after the damage is taken, try giving 999999 hitpoints to your unit
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Well if it is damaged then it will die before the effects... Attacked will place it before it takes damage....
 

mapguy

New Member
Reaction score
46
attacked will not prevent damage. because the attack ocurst before the damage.
you just have to add +999999HP to your unit.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Careful common sense below
Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Unit - Add Item Life Bonus (Greater) to (Triggering unit)
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
If at any given moment the Fortress' Hitpoints is greater or equal to 13000 and say a creep with 50000 Chaos Damage comes and attacks it, the Fortress is still destroyed.
As said, the event occurs before the damage is dealt. Its health has not yet fallen below 12000. Your condition needs to be like this:

Trigger:
  • Fortress Takes Damage
    • Events
      • Fortress 0000<gen> takes damage
    • Conditions
      • ((Life of Triggering unit) - (Damage dealt)) is less than or equal to 12000
    • Actions
      • Make triggering unit Invulnerable
 

Wummi

Just Relax and Smile!
Reaction score
58
As said, the event occurs before the damage is dealt. Its health has not yet fallen below 12000. Your condition needs to be like this:

Trigger:
  • Fortress Takes Damage
    • Events
      • Fortress 0000<gen> takes damage
    • Conditions
      • ((Life of Triggering unit) - (Damage dealt)) is less than or equal to 12000
    • Actions
      • Make triggering unit Invulnerable

Under which comparison can I find the Damage Dealt in the condition? I can't find it.
 

sylvannis mb

New Member
Reaction score
6
hey i know use are all talking about other stuff but have you tried this?

Trigger:
  • damage
    • Events
      • Unit - Keep 0000 <gen> Takes damage
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Life of (Triggering unit)) - (Damage taken)) Less than or equal to 0.00
        • Then - Actions
          • Unit - Set life of (Triggering unit) to 1.00
        • Else - Actions
          • Do nothing


and this
Trigger:
  • invul
    • Events
      • Unit - Keep 0000 <gen> Takes damage
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Less than or equal to 10000.00
        • Then - Actions
          • Unit - Make (Triggering unit) Invulnerable
        • Else - Actions
          • Do nothing


and the command that gives invul, just change to the trigger you want :)
hope this helps
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top