# Thread: Is it possible to wait a set time and THEN check for Conditions?

1. ## Is it possible to wait a set time and THEN check for Conditions?

Hey! I'm trying to write something where if a Condition is met it will wait a couple seconds and then it will check again for another condition and if the condition is met it will do the event I want it to do.

Sorta like:

*Value A = 10
+Wait 3 seconds
+Value B = 5

I think I tried this and it didn't work, but I could be wrong. Thanks in advance!

2. Personally I'd use the 'Function Eggtimer' object for this kind of thing, or just manually make a value that counts up, but the eggtimer is less hassle imo and you can queue events with ease.

3. Value A=10
Activate group AAA

Group AAA
Every 3 sec
+Value B = 5
.....
Every 3 sec
Deactivate Group AAA

4. You can simply use another variable the value of which will be increasing after the first condition, e.g:

Value A = 10 - Set Timer to 1

Timer=>1 : Timer +1

Timer>150
+Value B=5 : Do something

150 means roughly 3 seconds with 50 FPS

5. I usually use a combination of flags or a counter that holds the index of the state I am checking.
For example, a counter named "counter states" with the following indices would be used like this:

Index
1 -> first condition
2 -> second condition (in example after 3 seconds)
3 -> third condition (in example 3 seconds after the state 2)
...

Then the conditions and events would look like this:

Conditions Events
---------------------------------------------------------------------------------------
starting condition + counetr state = 0 -> counter state = 1 , Value A =10
counter state =1 + every 3 sec -> counter state = 2 , Value B =5
counter state =2 + every 3 sec -> do something
...
ending condition -> counter state = 0

Instead of a counter you can use a global value, an alterable value or like i said, flags.

6. The standard timer object has a 'fire event after X seconds/minutes' action, which is probably the simplest and quickest way I can think of doing it;
timedEvent1.png

7. I ended up doing this, thanks!
edit: idk how to use this forum but I mean to reply to one of the posts, dunno if it worked

8. Originally Posted by Sai
I ended up doing this, thanks!
edit: idk how to use this forum but I mean to reply to one of the posts, dunno if it worked
You just have to press "reply with quote"... and no... it didn't work lol.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•