• 🏆 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] Why does this cause fatal errors?

Status
Not open for further replies.
Level 8
Joined
Jan 16, 2008
Messages
156
I believe the trigger below is causing fatal errors. Any ideas why?

  • Desperation Desistance Burning Blade
    • Events
      • Unit - A unit owned by Player 5 (Yellow) Is attacked
      • Unit - A unit owned by Player 10 (Light Blue) Is attacked
      • Unit - A unit owned by Player 11 (Dark Green) Is attacked
      • Unit - A unit owned by Player 12 (Brown) Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Desperation (Dummy) for (Attacking unit)) Not equal to 0
          • ((Triggering unit) is A structure) Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DespPrevTarget_Copy Not equal to (Triggering unit)
            • Then - Actions
              • Set DespCounter_Copy = (DespCounter_Copy / 2)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DespCounter_Copy Less than 17
                • Then - Actions
                  • Set DespCounter_Copy = (DespCounter_Copy + 1)
                • Else - Actions
                  • Set DespCounter_Copy = 17
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Desperation for (Attacking unit)) Equal to 0
            • Then - Actions
              • Unit - Add Desperation to (Attacking unit)
            • Else - Actions
          • Unit - Set level of Desperation for (Attacking unit) to (DespCounter_Copy x (Level of Desperation (Dummy) for (Attacking unit)))
          • Set DespPrevTarget_Copy = (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Desistance for (Attacking unit)) Greater than 0
          • ((Attacked unit) is A structure) Equal to False
          • ((Attacked unit) is Mechanical) Equal to False
          • (Life of (Attacked unit)) Less than (25.00 + ((Real((Level of Desistance for (Attacking unit)))) x 125.00))
        • Then - Actions
          • Animation - Play (Attacking unit)'s attack animation
          • Wait 0.15 seconds
          • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing 5000.00 damage of attack type Siege and damage type Death
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacked unit)) Equal to Burning Blade Warrior
          • (Percentage life of (Attacked unit)) Less than 40.00
        • Then - Actions
          • Unit - Change ownership of (Attacked unit) to Neutral Hostile and Retain color
        • Else - Actions
 
Last edited:
Level 22
Joined
Nov 14, 2008
Messages
3,256
  • Desperation Desistance Burning Blade
    • Events
      • Unit - A unit owned by Player 5 (Yellow) Is attacked
      • Unit - A unit owned by Player 10 (Light Blue) Is attacked
      • Unit - A unit owned by Player 11 (Dark Green) Is attacked
      • Unit - A unit owned by Player 12 (Brown) Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Desperation (Dummy) for (Attacking unit)) Not equal to 0
          • ((Triggering unit) is A structure) Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DespPrevTarget_Copy Not equal to (Triggering unit)
            • Then - Actions
              • Set DespCounter_Copy = (DespCounter_Copy / 2)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DespCounter_Copy Less than 17
                • Then - Actions
                  • Set DespCounter_Copy = (DespCounter_Copy + 1)
                • Else - Actions
                  • Set DespCounter_Copy = 17
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Desperation for (Attacking unit)) Equal to 0
            • Then - Actions
              • Unit - Add Desperation to (Attacking unit)
            • Else - Actions
          • Unit - Set level of Desperation for (Attacking unit) to (DespCounter_Copy x (Level of Desperation (Dummy) for (Attacking unit)))
          • Set DespPrevTarget_Copy = (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Desistance for (Attacking unit)) Greater than 0
          • ((Attacked unit) is A structure) Equal to False
          • ((Attacked unit) is Mechanical) Equal to False
          • (Life of (Attacked unit)) Less than (25.00 + ((Real((Level of Desistance for (Attacking unit)))) x 125.00))
        • Then - Actions
          • Animation - Play (Attacking unit)'s attack animation
          • Wait 0.15 seconds
          • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing 5000.00 damage of attack type Siege and damage type Death
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacked unit)) Equal to Burning Blade Warrior
          • (Percentage life of (Attacked unit)) Less than 40.00
        • Then - Actions
          • Unit - Change ownership of (Attacked unit) to Neutral Hostile and Retain color
        • Else - Actions
explain a little bit more about the spell
 
Level 8
Joined
Jan 16, 2008
Messages
156
I'm not sure what is so confusing.

There are 3 triggers that share those events. Desperation (a hero spell), Desistance, (another hero spell), and finally Burning Blade Warrior, which turns a unit neutral hostile when it goes below 40% health.

The first is Desperation, which works similar to Primal Rage in DOTA, gives increasing attackspeed for every hit.

The second is Desistance, a passive skill that automatically kills enemy units under a certain amount of HP (which is level of Desistance, which is set in another trigger).

Finally, you have a trigger that turns Burning Blade Warriors neutral hostile when they goes below 40% health.
 
Status
Not open for further replies.
Top