• 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] Damage Engine problem... I think

Status
Not open for further replies.
Level 11
Joined
Nov 15, 2007
Messages
800
I think this is the weirdest problem I've ever run into with the World Editor. In fact, the problem is so nonsensical (to me and my limited knowledge of things) that the only way I found the cause was to delete all of the triggers in my map except the ones required to make this spell work, and then undo the deletions folder by folder until the problem came up again.

Here are the essential triggers:



  • Thorns3
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ThornsGroup and do (Actions)
        • Loop - Actions
          • Set int = (Player number of (Owner of (Picked unit)))
          • Set loc = (Position of (Picked unit))
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 200.00 of loc matching (((Matching unit) has buff Thorns (Slow Aura)) Equal to True)) and do (Actions)
            • Loop - Actions
              • Set DamageEventType = DamageTypeEarth
              • Unit - Cause Hero[int] to damage (Picked unit), dealing 6.00 damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\ThornsAura\ThornsAuraDamage.mdl
              • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_loc)
This is the broken trigger. Everything works as expected except that only a single unit in the group will be damaged.


  • Barkskinned Mod
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • DamageEventType Equal to DamageTypeEarth
    • Actions
      • Set int = (Player number of (Owner of DamageEventTarget))
      • Set DamageModifierDivisor = (DamageModifierDivisor - Barkskinned[int])
This is the problem trigger. All it does is set a variable that is used to reduce damage. Deleting it fixed the problem, which is how I knew it was the cause, and adding the condition
  • ((Owner of DamageEventTarget) controller) Equal to User
fixed it. I'm thinking because the maximum size of the array is 12 and the player number for neutral hostile units is higher than 12, it bugged out.



Now you're probably thinking, "Well if you fixed the issue why are you posting here?" - the answer to which is, I want to know WHY this happened. This has become one of life's great mysteries to me.

You see, setting that variable does nothing. It doesn't change the damage dealt directly, and only one other trigger references the variable - the trigger that actually modifies the damage. Disabling the damage modifying trigger does not fix the issue. So essentially a trigger that does NOTHING is causing another trigger to not function.

But wait, there's more! If I change the damage type in both triggers to any other damage type, the problem is "fixed" (except that my spell and damage reducer are effecting the wrong type of damage, so it's not really a fix) - I also have other triggers that do essentially the same thing, damage a group, and use the same damage type... and none of them are effected!

Oh, right, and one last layer of "wtf" to this mystery - the trigger was working fine yesterday, working fine earlier today, and suddenly stopped working with no changes to it or the problem trigger. Obviously the first thing I did was to revert all recent changes to see what went wrong, and eventually I went as far as to delete (without saving of course) all of the work I'd done since the last time the spell worked - and of course, it didn't fix it, because the problem-trigger had existed for over a day without actually effecting anything.

Basically: I no longer have any serious issue, this has already been resolved, but if anyone can shed some light on what the hell caused this I'd really appreciate knowing.

(Oh, one last note - disabling the damage engine, of course, "fixed" the problem as well.)
 
Status
Not open for further replies.
Top