For Loop isn't continuing properly

Chilling

New Member
Reaction score
1
Trigger:
  • Channeling
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Begin Channeling
    • Actions
      • Unit Group - Add (Triggering unit) to ChannelingUnits
      • Unit - Add Aid to (Triggering unit)
      • Unit - Add Sorcery to (Triggering unit)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is in ChannelingUnits) Equal to True
            • Then - Actions
              • Wait 1.00 seconds
              • Unit - Create 1 CastingTimeTypes[(Integer A)] for (Owner of (Triggering unit)) at (Center of Char Select Region <gen>) facing Default building facing degrees
              • Unit Group - Add (Last created unit) to CastingTimeGroup[(Player number of (Owner of (Triggering unit)))]
              • Floating Text - Create floating text that reads (String((Number of units in CastingTimeGroup[(Player number of (Owner of (Triggering unit)))]))) above (Triggering unit) with Z offset 0.00, using font size 20.00, color (15.00%, 75.00%, 100.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 120.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 1.25 seconds
              • Floating Text - Change the age of (Last created floating text) to 0.20 seconds
            • Else - Actions

The For Loop doesn't keep going, it just stops at 1. Why is that?
I don't even have the 'A unit stops casting, remove from ChannelingUnits' trigger enabled, so I don't think the caster could be removed from the group.
Any suggestions?

Thanks!
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Since you're adding the unit, and the unit is definitely in the group, why don't just remove that condition? And also, your trigger leaks :p
 

vypur85

Hibernate
Reaction score
803
> why don't just remove that condition?

I believe he/she wants to have the floating text popped only when the unit is channeling. There's probably another event which removes the unit from the group. Edit: As mentioned in first post.
 

NeuroToxin

New Member
Reaction score
46
Okay, just ignore me guys, love you too :p. I believe its the wait, because waits aren't MUI, therefore, it wont work.
 

DioD

New Member
Reaction score
57
he dont need group, just check current order of triggering unit for channeling spell order, if missmatch - unit doing something else.
 

HydraRancher

Truth begins in lies
Reaction score
197
Okay, just ignore me guys, love you too :p. I believe its the wait, because waits aren't MUI, therefore, it wont work.

I've had waits in loops work before. But apparently there are some issues with using them. It could be colliding with other loops.
 

HydraRancher

Truth begins in lies
Reaction score
197
waits doesn't causes MUI problems, it is user's fault.

Of course, so this trigger is completely my fault:

Trigger:
  • Proving_A_Point
    • Events
      • Unit - A unit dies
    • Conditions
    • Actions
      • Wait 5.00 seconds
      • Game - Display to (All players) for 3.00 seconds the text: (Name of (Dying Unit))
 

HydraRancher

Truth begins in lies
Reaction score
197
Also dying unit is MUI too.You can test it.

Dying Unit is only MUI for a short ammount of time. Unless Warcraft has had a sudden update.

yes, this your fault, replace with triggering unit and it will work fine.

1. It was an example.
2. I don't even know why you brought this up, it's irrelevant
3. Waits cause problems in loops.
 

HydraRancher

Truth begins in lies
Reaction score
197
That is because you are using same variable - your fault.

If you insist on carrying on this pointless argument riddled with your arrogance then PM me. Otherwise, contribute to the issue.


Now, if we get back to the point, if there is a wait in the loop it can cause collisions with other loops.
 

Chilling

New Member
Reaction score
1
I don't really want to use something like this:
Trigger:
  • Periodic Version of Channeling
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 CastingTimeTypes[(Integer A)] for (Owner of (Triggering unit)) at (Center of Char Select Region <gen>) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to CastingTimeGroup[(Player number of (Owner of (Triggering unit)))]
      • Floating Text - Create floating text that reads (String((Number of units in CastingTimeGroup[(Player number of (Owner of (Triggering unit)))]))) above (Triggering unit) with Z offset 0.00, using font size 20.00, color (15.00%, 75.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 120.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.25 seconds
      • Floating Text - Change the age of (Last created floating text) to 0.20 seconds

Because then you could start casting when the second is already halfway through and it would count as 1 second when you only spent like, .25 seconds.
I have used Wait in loops before...but that argument is over.
Anyway, what do you guys/girls think I should do?

EDIT: I put the wrong trigger up for a second...but I fixed it :p sorry
EDIT 2: Also, I forgot to pick every unit in ChannelingUnits...wow I fail
 

HydraRancher

Truth begins in lies
Reaction score
197
Try using your original trigger, but replace the For each Integer A with Integer (Variable).
 
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