• 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.

[Trigger] Trouble with Unit is Damaged Command

Status
Not open for further replies.
Level 7
Joined
Apr 1, 2010
Messages
289
I have been working on a flanking system, does anyone no how you are supposed to refer to a unit is Damaged?

  • Flanking
    • Events
      • Unit - (the unit) Takes damage
    • Conditions
    • Actions
      • Set Loc_to_remove = (Position of (Triggering unit))
      • Set TempPoint = (Position of (Damage source))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between Loc_to_remove and TempPoint) Less than or equal to 340.00
        • Then - Actions
          • Set zzangle = ((Facing of (Damage source)) - (Facing of (Triggering unit)))
          • Set zzdamagbonus = 0.00
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • zzangle Not equal to (Abs(zzangle))
            • Then - Actions
              • Set zzangle = (zzangle + 360.00)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • zzangle Greater than or equal to 280.00
                  • zzangle Less than or equal to 80.00
            • Then - Actions
              • Set zzdamage = (Damage taken)
              • Set zzdamagbonus = (zzdamagbonus + 0.20)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • zzangle Greater than or equal to 310.00
                      • zzangle Less than or equal to 50.00
                • Then - Actions
                  • Set zzdamagbonus = (zzdamagbonus + 0.20)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • zzangle Greater than or equal to 340.00
                          • zzangle Less than or equal to 20.00
                    • Then - Actions
                      • Set zzdamagbonus = (zzdamagbonus + 0.20)
                    • Else - Actions
                • Else - Actions
              • Set zzdamage = (zzdamagbonus x zzdamage)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • zzdamage Less than 1.00
                • Then - Actions
                  • Set zzdamage = 1.00
                • Else - Actions
              • Set zzDamageConverer = (Integer(zzdamage))
              • Set zzdamage = (Real(zzDamageConverer))
              • Unit - Cause (Damage source) to damage (Triggering unit), dealing zzdamage damage of attack type Chaos and damage type Normal
              • Floating Text - Create floating text that reads (String(zzdamage)) above (Damage source) with Z offset 0.00, using font size 10.00, color (100.00%, 30.00%, 30.00%), and 10.00% transparency
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
              • Floating Text - Change (Last created floating text): Disable permanence
            • Else - Actions
        • Else - Actions

The Event that I think causes the game to Crash is this action
  • Unit - Cause (Damage source) to damage (Triggering unit), dealing 1.00 damage of attack type Chaos and damage type Normal
 
Level 5
Joined
Jan 4, 2007
Messages
103
You could do generic Unit is Attacked, then a condition Attacked Unit Equals to Your Unit, or Do another trigger and add a new event, Trigger - Add New Event Unit Takes Damage to your first Trigger, here:
  • Trigger - Add to (Your First Trigger) the event (Your Unit) Takes damage)
Hope it helps:)
 
Level 7
Joined
Apr 1, 2010
Messages
289
I already have that

You could do generic Unit is Attacked, then a condition Attacked Unit Equals to Your Unit, or Do another trigger and add a new event, Trigger - Add New Event Unit Takes Damage to your first Trigger, here:
  • Trigger - Add to (Your First Trigger) the event (Your Unit) Takes damage)
Hope it helps:)

The_DooM thats isn't exactly the problem, i already have a trigger that adds an event i was added
  • Unit - (the unit) Takes damage



I have tested it so and made it turn off (add the turn off trigger event to prevent an Infinate loop) but the Trigger still causes the game to crash
to show what event i was using

That's all right doom thanks:)
I have Solved this post, i looked at, a different thread, where someone had problem with a similar thing thanks D4RK_G4ND4LF +rep
 
Last edited:
Status
Not open for further replies.
Top