• 🏆 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!

[Solved] Wonder Why That Crashes My Game

Status
Not open for further replies.
Level 3
Joined
Nov 21, 2016
Messages
30
I want to achieve the effect below but what i triyed untill now doesn't do anything or just crashes my game

Active

Activate to deal 1.2x to an enemy creep


Passive

Increases your attack damage vs creeps by 15%

  • Throwing Axe 2
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Triggering unit) is in ThrowingAxe[0]) Equal to True
          • ((Triggering unit) is in ThrowingAxe[1]) Equal to True
      • ((Attacking unit) is A Hero) Equal to True
    • Actions
      • Trigger - Add to Throwing Axe <gen> the event (Unit - (Attacked unit) Takes damage)
  • Throwing Axe
    • Events
    • Conditions
      • ((Damage source) has an item of type Throwing Axe) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • ((Attacked unit) is in ThrowingAxe[0]) Equal to True
          • ((Attacked unit) is in ThrowingAxe[1]) Equal to True
    • Actions
      • Set Valor1 = ((Damage taken) / 100.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Attacked unit)) is an ally of (Owner of (Damage source))) Not equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ThrowingAxeAttack[(Player number of (Owner of (Damage source)))] Equal to 1
            • Then - Actions
              • Set ThrowingAxeAttack[(Player number of (Owner of (Triggering unit)))] = 0
              • Unit - Cause (Damage source) to damage (Attacked unit), dealing (Valor1 x 20.00) damage of attack type Hero and damage type Normal
            • Else - Actions
          • Unit - Cause (Damage source) to damage (Attacked unit), dealing (Valor1 x 15.00) damage of attack type Hero and damage type Normal
        • Else - Actions
  • Throwing Axe 3
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Throwing Axe
    • Actions
      • Set ThrowingAxeAttack[(Player number of (Owner of (Triggering unit)))] = 1
BTW=i'm setting the unit group in another trigger but i'm shure that is all correct the damaged unit is on the unit group
 
Level 39
Joined
Feb 27, 2007
Messages
5,019
It's crashing because the "Unit - cause unit to damage target" in the 'on damaged' trigger causes the trigger to run again, which causes the trigger to run again, which.... It's an infinite loop. Disable the trigger before you cause the caster to damage the creeps, and enable it right after.

However, I should mention that the method you're using to add 'unit damaged' events to your map is pretty flawed. It re-adds the event every time a creep is attacked. It's checking some ThrowingAxe[0]/[1] groups that aren't set in the other trigger. Your damage trigger doesn't use ThrowingAxeAttack[]. You would be best served by picking up a (GUI friendly) Damage Detection System (DDS) from the resources section. People seem to like Looking_For_Help's but I've never used it. Make sure you read the documentation.
 
Level 3
Joined
Nov 21, 2016
Messages
30
It's crashing because the "Unit - cause unit to damage target" in the 'on damaged' trigger causes the trigger to run again, which causes the trigger to run again, which.... It's an infinite loop. Disable the trigger before you cause the caster to damage the creeps, and enable it right after.

However, I should mention that the method you're using to add 'unit damaged' events to your map is pretty flawed. It re-adds the event every time a creep is attacked. It's checking some ThrowingAxe[0]/[1] groups that aren't set in the other trigger. Your damage trigger doesn't use ThrowingAxeAttack[]. You would be best served by picking up a (GUI friendly) Damage Detection System (DDS) from the resources section. People seem to like Looking_For_Help's but I've never used it. Make sure you read the documentation.
thanks man now i see so i'm gonna disble the trigger before do the damage then enable it again
 
Status
Not open for further replies.
Top