• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Trigger runs again and again and again...

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hi! I want to ask why when my trigger runs for the first time it heals with the normal amount of HP, but on the second time it heals double, so on the first time lets say it heals 10, second time - 20, third time 30... I will attach my map to see my problem, it is with the triggers called 'Trig 1' and 'Trig 2' in the folder 'Spells' (the unit is a hero called Ice Revenant and the spell is my Ice Barrier, that you probably hear for 100 time...). (my problem is prooved by that - i've created my trigger to write 'Trig 2 runs' when the trigger runs.On the first time it writes it once and on the second time it writes this twice...) Please help! (+rep of course)
 
Last edited:
Level 14
Joined
Aug 8, 2010
Messages
1,022
Mmmm no. First i use hashtables (i am a newbie at them, so... :D (i don't want my trigger be MUI)) And secondly i want to PREVENT that. My heal already increases.My magic is an absorbing shield, when it give HP equal to the damage taken it is like an absorb, right, so - when i cast it for first time everything is OK, but on the second time it gives mi TWICE HP as the damage taken, third time cast = THRICE (if there is a word like that :D) ...Better see my map if you really want to help me :wink:
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
Lawl! I don't want chain heal or whatever thing you mean. See - i have magic that i want to be fuckin' absorbing shield, right, so if i don't add the damage dealed from the attacking unit during the time to my unit as a HP it wount be any absorb - i cast my shield, monster does damage and my HP goes low - this is nothing...ahhh... just see my magic in my map and go to the hero owned by Player 2 and see! Just cast, make the hero attack and see the HP of my hero (the Ice Revenant) and then - see my triggers, ok? :wink:
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
I think this should work...

  • Trig1 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bloodlust (Neutral Hostile 1)
    • Actions
      • Hashtable - Save Handle Of(Target unit of ability being cast) as 2 of (Key (Target unit of ability being cast)) in HashTblIceBarr
      • Unit Group - Add (Target unit of ability being cast) to IceBarrUnGroup
      • Trigger - Add to Trig2 Copy <gen> the event (Unit - (Load 2 of (Key (Target unit of ability being cast)) in HashTblIceBarr) Takes damage)
  • Trig2 Copy
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in IceBarrUnGroup and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Load 2 of (Key (Picked unit)) in HashTblIceBarr) to ((Life of (Load 2 of (Key (Picked unit)) in HashTblIceBarr)) + (Damage taken))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Load 2 of (Key (Picked unit)) in HashTblIceBarr) has buff Frost Armor) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from IceBarrUnGroup
              • Hashtable - Clear all child hashtables of child (Key (Load 2 of (Key (Target unit of ability being cast)) in HashTblIceBarr)) in HashTblIceBarr
            • Else - Actions
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
LAWL!!! When i do that my triggers don't even run... (what mckill2009 say) :D

really?, well I have a test map, you wannt see what it will do?...I will upload when I get home...

see, the problem of your trigger is the triggering unit, like what I say, it should be target unit of ability being cast & picked unit for unit group...

also your trigger does not need to be ON coz its already ON...

so I've created another version of absorbing damage, anyway I will upload the map when I get home...
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
the problem of your trigger is the triggering unit, like what I say, it should be target unit of ability being cast & picked unit for unit group...
Yes! It don't worked, i try both picked&target unit of ability being cast AND the trigger you post. - It don't worked. Every triggering i repleace with target unit of ab. being cast and every attacked with picked! :sad:
 
Status
Not open for further replies.
Top