# Problem in Loop actions (the timer)

#### JJhonJames

Level 4
• Events
• Unit - A unit Starts the effect of an ability
• Conditions
• (Ability being cast) Equal to Shadow
• Actions
• Set C_Start = (C_Start + 1)
• Set C_Caster[C_Start] = (Triggering unit)
• Unit - Add Ghost Stealth to C_Caster[C_Start]
• Set C_Timer[C_Start] = 0.00
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• C_Start Equal to 1
• Then - Actions
• Trigger - Turn on Shadow Period <gen>
• Else - Actions
• Events
• Time - Elapsed game time is 0.03 seconds
• Conditions
• Actions
• For each (Integer C_CIndex) from 1 to C_Start, do (Actions)
• Loop - Actions
• Set C_Timer[C_CIndex] = (C_Timer[C_CIndex] + 0.03)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• C_Timer[C_CIndex] Equal to 5.00
• Then - Actions
• Unit - Remove Ghost Stealth from C_Caster[C_CIndex]
• Set C_Caster[C_CIndex] = C_Caster[C_Start]
• Set C_Timer[C_CIndex] = C_Timer[C_Start]
• Set C_Start = (C_Start - 1)
• Set C_CIndex = (C_CIndex - 1)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• C_Start Equal to 0
• Then - Actions
• Trigger - Turn off (This trigger)
• Else - Actions
• Else - Actions

Seriously, what's wrong with this trigger ? The "Unit - Remove ability" part is not working. The unit becomes invisible FOREVER.

#### KILLCIDE

Level 36
 If - Conditions C_Timer[C_CIndex] Equal to 5.00
0.03 isn't a factor of 5.00. The counter will go from 4.98 -> 5.01, meaning that the condition will never be met. Change "Equal to" to "Greater than or equal to".

#### Meatmuffin

Level 11
Trump for president? Really man? Really?

#### Warseeker

Level 23
The "Unit - Remove ability" part is not working. The unit becomes invisible FOREVER.
Depend on the Index, and what do you mean the unit become invisible, I don't see anything wrong with the trigger?

Last edited:

Level 11

#### Warseeker

Level 23
Ya, I see but I wanna know what he mean by the unit become invisible!?

#### Meatmuffin

Level 11
Invisibility buff, duh? It is just never removed in the loop because of the loop issue KILLCIDE pointed out, that's why it is permanent.

#### JJhonJames

Level 4

Look at the loop EVENT HASIUHSAIUASHU.
And that condition. xd

#### BloodDrunk

Level 18

Look at the loop EVENT HASIUHSAIUASHU.
And that condition. xd

I was just about to tell you, you have Elapsed game time is 0.03 seconds, instead of every 0.03125 seconds.

How come nobody noticed it?

#### Meatmuffin

Level 11
BloodDrunk, because GUI uses 0.03 because only two numbers can be written after the decimal point; it is most commonly used.

The only way to use 0.031250 in GUI is to tick down every 1/32 of a second.

#### KILLCIDE

Level 36
How come nobody noticed it?
Uhm?
0.03 isn't a factor of 5.00. The counter will go from 4.98 -> 5.01, meaning that the condition will never be met. Change "Equal to" to "Greater than or equal to".

The only way to use 0.031250 in GUI is to tick down every 1/32 of a second.
You could also just do this:
 Set PeriodicTimer = (1.00 / 32.00) Trigger - Add to Loop the event (Time - Every PeriodicTimer seconds of game time)

#### Meatmuffin

Level 11
OH LOL I just got what BloodDrunk said. It's "Elapsed Game Time" not "Every X Seconds Of Game Time"

Last edited:

Level 18

Replies
7
Views
726
Replies
15
Views
865
Replies
15
Views
873
Replies
2
Views
388
Replies
9
Views
662