• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] whats wrong with my trigger?

Status
Not open for further replies.
Level 4
Joined
May 21, 2015
Messages
70
now now its my second post, and another trigger has gone wrong (btw im replicating aphotic shield from Lord of avernus in dota) >>>
  • Runic Aura Activate
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to LS
    • Actions
      • Set RunicATarget = (Learning Hero)
      • Game - Display to (All players) the text: learn
      • Trigger - Add to Runic Aura Trigger <gen> the event (Unit - RunicATarget Takes damage)
      • Trigger - Turn off (This trigger)
  • Runic Aura
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to LS
    • Actions
      • Set RunicATarget = (Casting unit)
      • Set RunicADamageAbsorbed = 0
      • Set RunicAMaxDamage = 300.00
      • Trigger - Run Runic Aura Trigger <gen> (checking conditions)
  • Runic Aura Trigger
    • Events
    • Conditions
    • Actions
      • Unit - Set life of RunicATarget to ((Life of RunicATarget) + (Damage taken))
what is wrong in it ? it looks fine (for me though)
 
Last edited:
Level 4
Joined
May 21, 2015
Messages
70
trigger wont work .. heres the ability >> If casted on units it forms a shield around that absorbs damage for a period of time. the prob is it doesnt absorb any damage at all . or like the casted unit takes damage even though the ability is still in effect.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
trigger wont work .. heres the ability >> If casted on units it forms a shield around that absorbs damage for a period of time. the prob is it doesnt absorb any damage at all . or like the casted unit takes damage even though the ability is still in effect.

Why do you "run trigger runic aura"? is it disabled in the world editor from start? In that case you need to turn it on, instead of running it. Otherwise it will do just that, run one time giving the unit 0 damage, since no actual event fired.
 
Level 4
Joined
May 21, 2015
Messages
70
tsk. ok now ive tried to test it again for the second time i put many enemy units in the map and suprisingly the trigger worked but it didnt worked when the 3 enemy attack him? why is that??
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Trigger illogical. Recommend using an existing damage absorption system.

You cannot heal a unit in response to taking damage because the damage is dealt after the trigger fires. You cannot simply use a 0 timeout delay to chance the order because then fatal damage does not get blocked. You then need to use a temporary health bonus to make sure the unit lives which has its own issues.

As such a pre-made damage absorption system is recommended.

Also you forgot to add the required absorption logic in the first place. Specifically to increment the absorbed amount when taking damage and to not absorb once the amount exceeds the maximum.
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
What about RunicADamageAbsorbed and RunicAMaxDamage? Do they have any separate trigger?

Set life of RunicATarget to ((Life of RunicATarget) + (Damage taken))

This will never work and I'll give you an example. Let's say RunicATarget's HP is 300. A unit attacks it and deals 50 damage. As it took damage, RunicATarget's HP decreases to 250 (clearly excluding armor's effect). Your trigger instead will add the damage taken (50) to the current life of RunicATarget (250) so in the end there will be no net change.

Additionally, unless the skill for Runic Aura is a one that casts instantly (e.g Berserk), you should replace Begins casting an ability with Starts the effect of an ability to avoid problems like the ability being cast when the caster stopped or got stunned.
 
Status
Not open for further replies.
Top