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. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. 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.

Buff & Healing

Discussion in 'World Editor Help Zone' started by White Wolf, Aug 14, 2019.

  1. White Wolf

    White Wolf

    Joined:
    Aug 14, 2019
    Messages:
    21
    Resources:
    0
    Resources:
    0
    Hello Hiver, I had been attempting for some time to make a spell which works by casting a buff on a unit, if this unit is slain while it still has the buff all friendly units within 500 range of it will regain 100 health, for some reason this doesn't seem to work. THe trigger specifically checks whether the unit has the buff once its slain and then heals.

    I know the healing part occurs/works because I;ve tested it with a different condition, am I doing something wrong?
     
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,704
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Units don't have any buffs when they die. It would be really nice for Blizzard to keep buffs in on-death events but so far your only options are this:
    • Use a damage detection system to detect fatal damage (after-mitigation damage - unit current hp < 0.406), then check for the buff and do things accordingly.
    • Keep track of all units that have the buff periodically (say every 0.20 seconds) in a unit group. Remove a unit from the group if it no longer has the buff. If a unit dies and it's in the group it (probably) had the buff active so do things accordingly. This method is more resource intensive than the first but this can be mostly mitigated by adding units to the group when the spell is cast on them rather than searching through every unit on the map to see what has the buff.
     
  3. Prince Aerrus

    Prince Aerrus

    Joined:
    Aug 8, 2019
    Messages:
    137
    Resources:
    0
    Resources:
    0
    This is accurate to my knowledge. I haven't done this for multi-castable spells. But I did it for an ultimate, and the way it worked was it had a trigger that checked every 0.5 seconds if the unit had the buff and gave a bolean true or false and another that fired only if the unit was no longer alive which checked whether the bolean set by the first was true. I multi-castable version of the spell would do the same thing but as Pyrogasm said would allocate units to a unit group. Then have the second trigger fire when they are no longer alive but have their presence in the unitgroup as one of the conditions. If I were you I would first build a simple version of the spell, then make it more complex as to suite your needs. It's much easier to learn triggers step by step.

    Also I just thought about another method you could set this up, re-work black arrow (under neutral hostile) or parasite (neutral passive) to summon a dummy unit. Then create a trigger that checks the unit type of a summoned unit, when this dummy is summoned have a trigger heal all friendly units that are close.
     
  4. Chaosium

    Chaosium

    Joined:
    Aug 29, 2012
    Messages:
    416
    Resources:
    2
    Models:
    2
    Resources:
    2
    Silly idea: does the goblin mine AoE damage on death accept negative values? If so, you could try to change the allowed targets to friendlies, add the ability to the buffed unit and it would theorically trigger a heal.

    I doubt that works, but who knows :gg:
     
  5. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,704
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Ah but then you also have to remove it when the buff expires, which is basically the same solution as the buff checking.
     
  6. vectorr

    vectorr

    Joined:
    Aug 20, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    The potential this last idea has...is enormous.
    In the past I have tried doing things before to get a similar affect, only now do I see the proper way to do this. Thank you for illustrating this
     
  7. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    765
    Resources:
    0
    Resources:
    0
    EDIT:
    I realized that the stuff I posted earlier didn't actually work properly. If you didn't see it then don't worry about it.

    @White Wolf
    Do what Pyrogasm said and use Bribe's Damage Detection System. It's an awesome tool to have in your map and it's not difficult to use either. I can create a map with an example of your ability using the DamageDetectionSystem, it would be very easy to import into your map.
     
    Last edited: Aug 22, 2019
  8. Prince Aerrus

    Prince Aerrus

    Joined:
    Aug 8, 2019
    Messages:
    137
    Resources:
    0
    Resources:
    0
    Here is a very simple way to implement this, I've just tried it with black arrow and it works

    Ok I've done it with the black arrow ability being at level 3, so it summons a "Greater Dark Minion"

    I've given this Dark minnion the "essence of blight ability" and 100 mana in both the maximum mana amount field and the initial amount field so the unit can cast the spell
    upload_2019-8-22_20-13-16.png

    Give this unit (Greater Dark Minion) the "essence of blight ability", set the healing value of the ability(essence of blight) to whatever you want

    Also set the summoned unit duration field in dark arrow to 3 seconds or so, so the dummy doesn't hang around

    upload_2019-8-22_21-29-24.png
    Remove the model from the unit so it does not appear in game, do this by going to model file > custom and putting a space there and leaving it empty

    upload_2019-8-22_20-16-40.png

    Now use this trigger to make the unit cast the healing ability upon its creation
    upload_2019-8-22_20-19-59.png

    Rework parts of this schematic to get the desired result, best of luck to you
     
    Last edited: Aug 23, 2019
  9. vectorr

    vectorr

    Joined:
    Aug 20, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    Why not just have create a copy of essence of blight that requires no mana?
     
  10. White Wolf

    White Wolf

    Joined:
    Aug 14, 2019
    Messages:
    21
    Resources:
    0
    Resources:
    0
    Ok.

    I am a bit confused; can you please give me a step-by-step version of how to make this ability so that it heals all friendlies in the area by 100 hit points when your enemy gets slain.
     
  11. Prince Aerrus

    Prince Aerrus

    Joined:
    Aug 8, 2019
    Messages:
    137
    Resources:
    0
    Resources:
    0
    @White Wolf

    Alright I will make this as simple as possible…

    1. Open up the object editor, go to abilities, go to undead, go to units, select essence of blight and copy it

    2. Open up this copied essence of blight (Change the art to whatever you want to), change the Data – Hit Points gained field to 100, change the Data – Maximum Units effected to 100, change the Stats – Cooldown to 10, Finally change the Stats – Mana cost field to 0 (Look at illustration below)

    upload_2019-8-23_4-7-35.png

    3. Create an invisible dummy unit (plenty of tutorials on this) Just make sure it has no model, set model to custom and leave it blank, and make sure it takes up no room by setting its collision size to 0, maybe making it a flying unit, etc. Give it the reworked essence of blight ability described above

    4. Go to object editor, go to abilities, go to neutral hostile, go to units, and copy Black Arrow

    Rename it to whatever you want it to be called, set Data – Damage Bonus to 0 (or whatever bonus you want), Set Data – Summoned unit Duration (Seconds) to 3, Set Data – Summoned Unit Type to the invisible dummy unit you created before

    upload_2019-8-23_4-7-53.png


    5. Create the following trigger

    Event = Unit - A unit Spawns a summoned unit

    Condition = (Unit-type of (Summoned unit)) Equal to Dummy unit

    Action = Unit - Order (Summoned unit) to Undead Obsidian Statue - Essence of Blight

    upload_2019-8-23_4-8-17.png


    6. Now give your unit the reworked black arrow, make sure it’s on auto cast by putting it in Abilities – Default active ability field


    upload_2019-8-23_4-9-2.png
     
  12. White Wolf

    White Wolf

    Joined:
    Aug 14, 2019
    Messages:
    21
    Resources:
    0
    Resources:
    0
    Ok - i got it to work after many tries

    is there a way to make the slaying unit regain a bigger amount of health than the other friendlies?
     
  13. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    765
    Resources:
    0
    Resources:
    0
    Added a new version that should do everything you want. It doesn't use a DDS but instead keeps track of the units using Indexing. It isn't a perfect system as it doesn't recycle the indices in a proper fashion but it should work just fine.

    I'm happy with it now. Pretty configurable and easy to use. Appears to be bug free as far as I can tell.

    To use, first enable "Automatically create unknown variables" in File/Preferences/General in the World Editor. Then Copy and Paste the Heal Ability folder into your map.
    Lastly, simply configure the "Heal Ability Setup" trigger to suit your needs:
    • Heal Ability Setup
      • Events
        • Time - Elapsed game time is 0.00 seconds
      • Conditions
      • Actions
        • -------- Set Ability Information --------
        • Set ha_Ability = Heal Ability
        • -------- - --------
        • Set ha_Buff = Heal Ability
        • -------- - --------
        • Set ha_BuffDuration = 10.00
        • -------- - --------
        • Set ha_AreaOfEffect = 300.00
        • -------- - --------
        • Set ha_HealAmount = 100.00
        • -------- - --------
        • Set ha_HealKillAmount = 200.00
        • -------- - --------
        • -------- The Special Effect that is created at the position of the dying unit (Leave blank if you don't want a Special Effect to play) --------
        • Set ha_SpecialEffectArea = Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
        • -------- - --------
        • -------- The Special Effect that is created on each healed unit (Leave blank if you don't want a Special Effect to play) --------
        • Set ha_SpecialEffectUnit = Abilities\Spells\Other\HealingSpray\HealBottleMissile.mdl
        • -------- - --------
        • -------- The attachment point for SpecialEffectUnit (Won't do anything if SpecialEffectUnit is blank) --------
        • Set ha_SfxAttachmentPoint = origin

    Also, to filter out which units you should and shouldn't heal make sure to add conditions to this If Else Statement in the Heal Ability Effect trigger. By default I tried to make it match what most abilities can target so you probably won't have to touch this.
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Picked unit) belongs to an enemy of (Owner of TempDyingUnit)) Equal to True
        • ((Picked unit) is alive) Equal to True
        • ((Picked unit) is A structure) Equal to False
        • ((Picked unit) is Mechanical) Equal to False
        • ((Picked unit) is hidden) Equal to False
      • Then - Actions
      • Else - Actions


    Edit: Added v.6. Fixed a bug that had to do with the fact that the buff from the Heal Ability had a very slight delay before it was applied (Since the buff is applied by Acid Bomb which uses a Missile). This time just to be sure I tested the ability using 100 Grunts, casting the ability on all of them, and then killing them all, and everything worked.

    I think if I used an ability like Slow that instantly puts a buff on the unit instead of having to rely on Acid Bomb this wouldn't have been a problem.
     

    Attached Files:

    Last edited: Aug 23, 2019
  14. Prince Aerrus

    Prince Aerrus

    Joined:
    Aug 8, 2019
    Messages:
    137
    Resources:
    0
    Resources:
    0
    Try using this, change the 50 to whichever value you prefer
    upload_2019-8-23_5-43-15.png
     
  15. vectorr

    vectorr

    Joined:
    Aug 20, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    For step 6 setting essence of blight as the default active ability is redundant because you have a trigger setting it off
     
  16. Prince Aerrus

    Prince Aerrus

    Joined:
    Aug 8, 2019
    Messages:
    137
    Resources:
    0
    Resources:
    0
    You're correct, I don't know why I included that. But hey its a safeguard should the trigger ever "forget" to fire
     
  17. vectorr

    vectorr

    Joined:
    Aug 20, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    Another thing -isnt the parasite ability much better for this purpose than black arrow

    black arrow is meant to add more damage to an attack & will fire every time its caster attacks and has enough mana to cast it

    parasite is a regular spell, it can be autocasted too, but not like black arrow ->i think its the better option here
     
  18. Prince Aerrus

    Prince Aerrus

    Joined:
    Aug 8, 2019
    Messages:
    137
    Resources:
    0
    Resources:
    0
    Maybe

    I think it's what you prefer

    With the created spell black arrow is re-worked to make your unit's killing blows heal you and your allies

    The parasite version allows you to cast a buff on a unit which heals you and your allies when the unit is slain

    so in this regard parasite is more in-line with White Wolf original intent


    but we went the black arrow rather than the parasite route, if you want to explore and experience the alternative be my guest
     
  19. vectorr

    vectorr

    Joined:
    Aug 20, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    No thanks. Id rather leave that to someone more resourceful and experience with the editor such as yourself :)
     
  20. White Wolf

    White Wolf

    Joined:
    Aug 14, 2019
    Messages:
    21
    Resources:
    0
    Resources:
    0
    Wait

    One thing everyone here is forgetting; It's easy to identify the casting unit when black arrow is used but if we use parasite it will be harder/not possible to identify the caster. So after looking over all this I think black arrow is the better choice