• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Trigger problem. Need imediate help.

Status
Not open for further replies.
I never thought I'd experience such trigger problem, but, everytime I attack a certain building, it drops me off the game. Here is the damage detection system:

  • Damage1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set DamageGroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in DamageGroup and do (Actions)
        • Loop - Actions
          • Trigger - Add to Greater Damage <gen> the event (Unit - (Picked unit) Takes damage)
      • Custom script: call DestroyGroup (udg_DamageGroup)
  • Damage 2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Greater Damage <gen> the event (Unit - (Triggering unit) Takes damage)
  • Greater Damage
    • Events
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Damage source)) Equal to Bomber (High)
          • (Unit-type of (Damage source)) Equal to Bomber
    • Actions
      • For each (Integer Bomber_Int) from 1 to 13, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to BuildingTypes[Bomber_Int]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Triggering unit) is A structure) Equal to False
                      • ((Triggering unit) is Undead) Equal to False
                      • ((Triggering unit) is Mechanical) Equal to False
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 10.00 damage of attack type Chaos and damage type Fire
                • Else - Actions
            • Else - Actions
              • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 10.00 damage of attack type Chaos and damage type Fire
 
The problem is that it normally attacks every building, except for this one, which is based off Guard Tower. Plus, I have changed the damage type to other possible combinations, but, it deals way too much of damage; I order it to deal 10.00 damage, and the enemy loses 80 health. Finally, the bomber is not supposed to deal greater damage against buildings, that is why that boolean value is there.

@ Reaper: Yes, Trigger Unit -> Trigger Unit. If I order the damage source to deal damage against the Trigger Unit, it will cause fatal error, because the damage source already damages the Trigger Unit. That is why I order the Trigger unit to damage itself.
 
Status
Not open for further replies.
Top