How can I stop this from going into an infinite loop?

Slywolf15

Member
Reaction score
5
I'm having problems keeping this from going into an infinite loop. It works fine if the target has an item although if he doesn't, then it goes into the loop. I made a condition I thought checked for this but apparently I'm mistaken. The reason I have it run the trigger again so that if the trigger randoms a slot without an item it will run again. Any help on this issue is appreciated.

Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        ((Ability being cast) Equal to Band of Thieves (Slywolf)) and (((Target unit of ability being cast) has No item) Equal to False)
    Then - Actions
        Set BandofThievesTarget = (Target unit of ability being cast)
        Set BandofThievesTargetPoint = (Position of (Target unit of ability being cast))
        Set Random = (Random integer number between 1 and 6)
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Unit - Create 1 Warden for Neutral Passive at (BandofThievesTargetPoint offset by 100.00 towards (72.00 x (Real((Integer A)))) degrees) facing BandofThievesTargetPoint
                Special Effect - Create a special effect at ThiefPosition using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
                Special Effect - Destroy (Last created special effect)
                Set ThiefPosition = (Position of (Last created unit))
                Unit - Add a 2.00 second Animate Dead expiration timer to (Last created unit)
                Unit - Add Invulnerable (Neutral) to (Last created unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item carried by BandofThievesTarget in slot Random) Not equal to No item
            Then - Actions
                Set RandomItem = (Item carried by (Target unit of ability being cast) in slot Random)
                Hero - Give (Item carried by BandofThievesTarget in slot Random) to (Triggering unit)
                Item - Make RandomItem Undroppable
                Game Cache - Create a game cache from AgeOfWar.w3v
                Game Cache - Store (30.00 x (Real((Level of Band of Thieves (Slywolf) for (Triggering unit))))) as Item Time of Category in (Last created game cache)
                Wait (Load Item Time of Category from (Last created game cache)) seconds
                Item - Make RandomItem Droppable
                Hero - Give RandomItem to BandofThievesTarget
                Custom script:   call RemoveLocation (udg_BandofThievesTargetPoint)
                Custom script:   call RemoveLocation (udg_ThiefPosition)
            Else - Actions
                Trigger - Run (This trigger) (checking conditions)
    Else - Actions
        Do nothing
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
please post full trigger as evend and conditions
 

Slywolf15

Member
Reaction score
5
please post full trigger as evend and conditions

The event is just A unit starts the effect of an ability. All the abilities for this hero are in one trigger which is why I just posted the If then else function.

try instead of slot random, make a multiple -or- and put a condition for each slot

I wanted to let you know, I didn't really do exactly what you asked but instead did that in the first condition and it works great now.
 
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