Trigger Crashing My Map

BarzahdX

Active Member
Reaction score
18
I don't know why, on my old computer(an XP,) this trigger worked properly. Now on my new computer(Windows 7,) the game crashes when it triggers. I know it's a little poorly done or may appear sloppy, but it gets the job done.

Here's the trigger:

Trigger:
  • Spirit Bond Damage
    • Events
      • (Unit - Hero[5] Takes damage)
      • (Unit - Hero[6] Takes damage)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero[5] has buff Spirit Bond ) Equal to True
          • (Hero[6] has buff Spirit Bond ) Equal to True
          • (Triggering unit) Equal to Hero[5]
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) / 2.00))
          • Unit - Cause (Damage source) to damage Hero[6], dealing ((Damage taken) / 2.00) damage of attack type Hero and damage type Normal
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero[5] has buff Spirit Bond ) Equal to True
          • (Hero[6] has buff Spirit Bond ) Equal to True
          • (Triggering unit) Equal to Hero[6]
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) / 2.00))
          • Unit - Cause (Damage source) to damage Hero[5], dealing ((Damage taken) / 2.00) damage of attack type Hero and damage type Normal
        • Else - Actions


I'll need to test it again to see if it still works on my old computer, it's been awhile. I have WC3 running in compatibility mode of XP(Service Pack 3.)
 

FhelZone

Have a drink of a nice cold mellowberry juice!
Reaction score
103
Thats because the trigger loops forever. The damage is dealt back and fort for both heroes since they have some sort of return damage. Once Hero 5 damages hero 6 the return damage kicks in and Hero 6 counter damages hero 5, in an instance hero 5 will return the returned damage as well, it goes bac kand fort and it will go forever causing a crash.
 

BarzahdX

Active Member
Reaction score
18
Hahahah! Duh! I totally missed that, lol. Thank you. :) How should I remedy this?
 

DuelPlayer

Member
Reaction score
21
split it into 2 triggers can turn off and on at the right points
Meaning: before damage done turn off the other
after damaged done turn on the other
 

BarzahdX

Active Member
Reaction score
18
I have a better idea, gimme a sec to change it. I'll edit this post.

EDIT:
Trigger:
  • Spirit Bond Damage
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero[5] has buff Spirit Bond ) Equal to True
          • (Hero[6] has buff Spirit Bond ) Equal to True
          • (Triggering unit) Equal to Hero[5]
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) / 2.00))
          • Unit - Set life of Hero[6] to ((Life of Hero[6]) - ((Damage taken) / 2.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero[5] has buff Spirit Bond ) Equal to True
          • (Hero[6] has buff Spirit Bond ) Equal to True
          • (Triggering unit) Equal to Hero[6]
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Damage taken) / 2.00))
          • Unit - Set life of Hero[5] to ((Life of Hero[5]) - ((Damage taken) / 2.00))
        • Else - Actions


Bam. It's even better this way because now there won't be double armor stacking--an error on my part.
 

FhelZone

Have a drink of a nice cold mellowberry juice!
Reaction score
103
Though once the damage is greater than the remaining life of the damager there would be no killer.
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Calculate the damage first, if the damage is equal to or greater than the target's current HP,
Cause SomeUnit to damage SomeTarget for 99999999.00 damage <-- Lol, sth like that? o.0
 

FhelZone

Have a drink of a nice cold mellowberry juice!
Reaction score
103
The most simple solution for a damage return against damage return in GUI is to create a dummy, instead of the Hero dealing the damage use the dummy. As for the trigger that returns the damage add a condition that the damage source is not equal to unit type dummy. That way the damage won't circulate. And by the way, try to search the tutorials and resources section for the GDD system, would help you much for GUI detection, no leak and you can use an event instead of using two triggers to make the damage detect work.
 

BarzahdX

Active Member
Reaction score
18
Calculate the damage first, if the damage is equal to or greater than the target's current HP,
Cause SomeUnit to damage SomeTarget for 99999999.00 damage <-- Lol, sth like that? o.0

Yeah I was considering that, didn't think ti would be a big deal, but that's an easy fix, so thank you for that.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top