Damage reduction issue

Ashcat

Hellooo
Reaction score
68
Hi everyone, I'm creating a spell that absorbs all the damage you take for a short duration, then unleashes it all on your next attack. I have everything down, except one small issue I've noticed.

What I'm doing, is I am detecting when a unit with the spell activated is damaged, then increasing the life of the damaged unit by the amount of damage taken.

The problem is that if the damage taken is greater than the amount of health that the damaged unit has at the moment, then it will die before the triggers can increase its health.

And I can't use item spells or anything like Hardened Skin, or Spiked Carpace, because I need to be able to store the amount of damage taken in a variable.
 

Slapshot136

Divide et impera
Reaction score
471
w8, are you using "unit takes damage" and then setting the life to the life + the damage taken? im pretty sure that the triggers for "unit takes damage" work before the damage is actually dealt, post the triggers plz, and what about a spell like elune's grace that reduces the damage taken by lets say 99%, and then with your triggers you just do the damage taken x 100 to get the actual damage that the unit would of taken
 

Ashcat

Hellooo
Reaction score
68
I havn't actually made the trigger itself yet, but I've played around with a few triggers like this to experiement.

Basically this is what I'm doing

Code:
Shield of Blood
    Events
        Unit - A unit Takes damage
    Conditions
        ((Triggering unit) has buff Shield of Blood) Equal to True
    Actions
        Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
 

Ashcat

Hellooo
Reaction score
68
No, its not : (

I place two footmen in a test map to fight each other, give one the shield of blood ability, and set its health to 1, with no regeneration.

On the first attack it dies, but when I have the footman start with full health instead of 1, the ability works as intended.
 

Sooda

Diversity enchants
Reaction score
318
Unbelievable, all other methods fail to correctly prevent damage except one-shot timer with 0.00 duration.
Code:
Deny Damage
    Events
    Conditions
    Actions
        Set doneDmg = (Damage taken)
        Set curHp = (Life of (Triggering unit))
        Set newLife = (curHp + doneDmg)
        Set victim = (Triggering unit)
        Countdown Timer - Start timer as a One-shot timer that will expire in 0.00 seconds
Code:
Add life
    Events
        Time - timer expires
    Conditions
    Actions
        Unit - Set life of victim to newLife
 

Ashcat

Hellooo
Reaction score
68
Well that continues to reduce damage to 0 like it did before, but still doesn't solve my problem of reducing the damage for a unit with 1 health left.

I guess I could use Slapshots idea of creating an Elune's Grace with 99% damage reduction. That way only a unit with 100 or more damage could break through the shield at 1 health.
 

Sooda

Diversity enchants
Reaction score
318
Didn' t knew 'Takes Damage' event damage is so hard to prevent. If timer with 0.00 duration dosn' t do, nothing does it. Your only option would be to use damage reduction ability like Night elf unit Hardened Skin (Allies checked additionally) or similar.
 
Reaction score
107
Cohadar was talking about this in another thread, but I forget which one...
But basically what he was saying, was to add 10000 hp to the unit (or something huge number) so that the unit wouldn't die, take the damage, calculate or whatever, and afterwards just remove the 10000hp buff.

Apparently thats what he does with one of the spells in his map "pyramidal defense" or "naga team survival" whether he changed the name or not :p
 

The Undaddy

Creating with the power of rage
Reaction score
55
Correct me if I'm wrong but I think when damage is dealt to a unit,as low as it may be,the target unit takes at least 1 damage.So even with the 99% damage reduction,the unit will take 1 damage no matter what unit attacks him.
 

Ashcat

Hellooo
Reaction score
68
I'm pretty sure you're right about that, but isnt health a real value? meaning a unit could have, say, 0.50 health, even though it would display as 1?

And even if I'm wrong, the a unit won't usually have 1 health remaining as often as 20 or some other low amount. I don't know, I'd love to find a fix, but if I can't I will just try to cover it up as best as I can.
 

Slapshot136

Divide et impera
Reaction score
471
how about using mana shield, and then healing the mana? and can i ask for a map with this, since im still having a hard time believeing it lol

p.s. it's possible to deal damage that does less then 1 damage
 

Ashcat

Hellooo
Reaction score
68
Mana Shield wouldn't work, but I think what I have now is okay.

And as for what kind of map... I'm still debating between a Hero Arena and an AoS, though they are almost the same thing. lol
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top