Is there a wait command that you can use to pause actions?

For questions about using Classic.

Post » Sat Aug 28, 2010 3:24 pm

If not, can you make one using the system clock?
B
3
G
2
Posts: 26
Reputation: 727

Post » Sat Aug 28, 2010 4:31 pm

You can use the system clock if you want to.. but you'll need to setup variables. I believe there is a wait plugin, and also you can use the function plugin and call a function after a delay (in ms)
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Sat Aug 28, 2010 5:10 pm

Um, how do I actually get the time?
B
3
G
2
Posts: 26
Reputation: 727

Post » Sat Aug 28, 2010 6:01 pm

i think the date object can do it?
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Sat Aug 28, 2010 6:26 pm

Sorry, I meant the server time.
B
3
G
2
Posts: 26
Reputation: 727

Post » Sun Aug 29, 2010 6:30 am

There is a wait object that can put a delay into actions. It depends if you are trying to simply delay something within the action, or if you want it paused indefinitely.

To delay an action:

On <some condition>
--Do: create sprite1 at x,y
------ play sound "somesound.wav"
------ wait 2,000 ms
------ change animation to "DoneTaunting"

If you want the action paused indefinitely, then I have no idea how you might do that. I would look at using some kind of toggle condition rather than trying to switch at the action level. Something like:

Is global('Something') = 1
--Do: Set global('something') = 0
[color=#BF40FF:38lgnzs6]If you don't set it 0 immediately, then this action will repeat every tick (unless that's what you want it to do).[/color:38lgnzs6]
---- do other things

On SomeOtherCondition
--Do: set global('Something') = 1

Note:
I've found that wait acts strangely in loops. What I *think* is happening, is that each iteration of the loop starts another wait cycle in parallel, effectively nullifying it.
If I did:
ON SomeEvent
--Repeat 12 times
------- spawn an object
------- play a sound
------ wait 1000ms

I find that all 12 appear instantly, and all the sounds play seemingly at once. It's as though 12 'waits' are created simultaneously.
B
2
G
2
Posts: 42
Reputation: 734

Post » Sun Aug 29, 2010 6:51 am

You could try timescale here.
Unfortunately it effects everything that uses timedelta. Hopefully that will be remedied in C2.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sun Aug 29, 2010 6:57 am

Hah, yeah I was messing around with timescale a couple of days back. That was fun. I like the way sound effects slow down to match.

I'm glad I've tied all my events into timedelta now. I could have a slo-mo powerup that gives bullet time properties to my game. The firing control isn't in timedelta yet, but I think I'll leave it that way because of the way it turned out.
B
2
G
2
Posts: 42
Reputation: 734


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests