• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Wc3 closes by using this?

Status
Not open for further replies.
Level 15
Joined
Sep 27, 2009
Messages
676
My wc3 closes when i use item that is triggered by this trigger:
  • Counter
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamagedUnit has buff Counter Bones ) Equal to True
    • Actions
      • Unit - Cause GDD_DamagedUnit to damage GDD_DamageSource, dealing (1.50 x GDD_Damage) damage of attack type Spells and damage type Normal
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GDD_Damage Greater than 50.00
        • Then - Actions
          • Unit - Set life of GDD_DamagedUnit to ((Life of GDD_DamagedUnit) + 5.00)
        • Else - Actions
It should return damage to attacker, but when i do an item and someone hits me, wc3 closes... :vw_wtf:
 
You are causing an infinite loop. GDD_Event becomes 0.00 when a unit is damaged. In that trigger, you use this line:
  • Unit - Cause GDD_DamagedUnit to damage GDD_DamageSource, dealing (1.50 x GDD_Damage) damage of attack type Spells and damage type Normal
That causes the trigger to fire again and again because a unit is constantly damaged. It causes an infinite loop and it crashes. :)

To fix it, just do this:
  • Counter
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamagedUnit has buff Counter Bones ) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Cause GDD_DamagedUnit to damage GDD_DamageSource, dealing (1.50 x GDD_Damage) damage of attack type Spells and damage type Normal
      • Trigger - Turn on (This trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GDD_Damage Greater than 50.00
        • Then - Actions
          • Unit - Set life of GDD_DamagedUnit to ((Life of GDD_DamagedUnit) + 5.00)
        • Else - Actions
It will prevent the event from being fired from that damage. ;D
 
Status
Not open for further replies.
Top