Why does this trigger keep making WarCraft crash?

KMDK

Cool Member
Reaction score
1
Code:
Stout Shield
    Events
        Unit - A unit Acquires an item
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Item-type of (Item being manipulated)) Equal to Stout Shield
                (Item-type of (Item being manipulated)) Equal to Stout Shield - Melee
                (Item-type of (Item being manipulated)) Equal to Stout Shield - Ranged
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Hero manipulating item) is A ranged attacker) Equal to True
            Then - Actions
                Item - Remove (Item being manipulated)
                Hero - Create Stout Shield - Ranged and give it to (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Hero manipulating item) is A melee attacker) Equal to True
            Then - Actions
                Item - Remove (Item being manipulated)
                Hero - Create Stout Shield - Melee and give it to (Triggering unit)
            Else - Actions

Just like in DotA, it's just supposed to make it so that when a Hero picks up the Stout Shield, if you're ranged, you get the ranged item and vice versa. But this thing keeps crashing on me. I don't get it @_@ Any help please? :D
 

KMDK

Cool Member
Reaction score
1
I also did this:
Code:
Stout Shield
    Events
        Unit - A unit Acquires an item
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Item-type of (Item being manipulated)) Equal to Stout Shield
                (Item-type of (Item being manipulated)) Equal to Stout Shield - Melee
                (Item-type of (Item being manipulated)) Equal to Stout Shield - Ranged
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Hero manipulating item) is A ranged attacker) Equal to True
            Then - Actions
                Item - Remove (Item being manipulated)
                Hero - Create Stout Shield - Ranged and give it to (Hero manipulating item)
            Else - Actions
                Item - Remove (Item being manipulated)
                Hero - Create Stout Shield - Melee and give it to (Hero manipulating item)

and it still crashes....

I also tried making them separate triggers each but still, it crashes
 

Laiev

Hey Listen!!
Reaction score
188
Infinity loop...

Turn off the trigger before create and give the item, then turn on again :)
 

KMDK

Cool Member
Reaction score
1
So i create 2 triggers? One that turns the other one on when i acquire the item?
 

Grags_1977

Ultra Cool Member
Reaction score
32
Trigger:
  • Stout Shield
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Stout Shield
          • (Item-type of (Item being manipulated)) Equal to Stout Shield - Melee
          • (Item-type of (Item being manipulated)) Equal to Stout Shield - Ranged
    • Actions
      • Trigger - Turn off (This Trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) is A ranged attacker) Equal to True
        • Then - Actions
          • Item - Remove (Item being manipulated)
          • Hero - Create Stout Shield - Ranged and give it to (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) is A melee attacker) Equal to True
        • Then - Actions
          • Item - Remove (Item being manipulated)
          • Hero - Create Stout Shield - Melee and give it to (Triggering unit)
        • Else - Actions
      • Trigger - Turn on (this trigger)


Alternatively

Trigger:
  • Stout Shield
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Stout Shield
          • (Item-type of (Item being manipulated)) Equal to Stout Shield - Melee
          • (Item-type of (Item being manipulated)) Equal to Stout Shield - Ranged
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) is A ranged attacker) Equal to True
        • Then - Actions
          • Item - Remove (Item being manipulated)
          • Trigger - Turn off (This Trigger)
          • Hero - Create Stout Shield - Ranged and give it to (Triggering unit)
          • Trigger - Turn on (this trigger)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) is A melee attacker) Equal to True
        • Then - Actions
          • Item - Remove (Item being manipulated)
          • Trigger - Turn off (This Trigger)
          • Hero - Create Stout Shield - Melee and give it to (Triggering unit)
          • Trigger - Turn on (this trigger)
        • Else - Actions
 

merlinds

Member
Reaction score
15
what is happening, is that inside the actions of the trigger there is one that gives an item to the unit and the event of the trigger starts when a unit recives an item, so whenever the trigger starts it gives the item to the unit, but then starts again and again and infinit times again making your WE crash. So to avoid this, every time you put an action inside a trigger that can make the trigger starts you have to turn the trigger off in the start and turn it on in the end.
 
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