delay time

For questions about using Classic.

Post » Fri Aug 05, 2011 12:54 pm

when i make an event (button, colission, etc...) and then make an action, for example make object visible. but i want this object to be visible after 2 seconds, not immediately. is it possible? I think it can be done with time delta, but i dont know exactly how
B
4
S
2
G
1
Posts: 143
Reputation: 1,211

Post » Fri Aug 05, 2011 1:30 pm

Hi I have found your solution >> Plugin!

You can download the Wait plugin here
Download

Enjoy! It is in (.rar) Format ok
B
7
S
2
G
1
Posts: 193
Reputation: 1,745

Post » Fri Aug 05, 2011 2:01 pm

I hate the wait object

While it is convenient, at the same time it leads to bad maintainable event sheets, whose logic is not easy to find out.

If someone wants to delay something without the wait object, here's how:

wait 2 seconds before making the object visible. Create a pv "timestamp" to the object of interest. Timer is a system expression (find it under System/Time/Get timer)

+ On button clicked
-> objectofinterest: Set 'timestamp' to Timer

+ objectofinterest: Value 'timestamp' Less or equal Timer - 2000
+ Trigger once
-> objectofinterest: Make visible

Instead of 2000, you may set any time to wait in milliseconds, e.g 3.5 seconds = 3500, 12 seconds = 12000, etc.

btw: Isn't the wait object part of the standard install of CC?
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Fri Aug 05, 2011 2:46 pm

@tulamide

Far be it of me to question someone with your far greater knowledge and experience with CC, but if 'wait' isn't bugged in any way, then isn't it far more understandable just to put 'Wait: Delay 2000 ms' rather than what you have done?

I've never had a problem with the wait command, but am willing to concede to you're experience if it is the case.

zenzenox982011-08-05 14:57:12
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,843
Reputation: 48,287

Post » Fri Aug 05, 2011 3:04 pm

[QUOTE=zenox98] @tulamide

Far be it of me to question someone with your far greater knowledge and experience with CC, but if 'wait' isn't bugged in any way, then isn't it far more understandable just to put 'wait 2000' rather than what you have done?

I've never had a problem with the wait command, but am willing to concede to you're experience if it is the case.

zen[/QUOTE]



It was just my personal opinion, nothing universally valid.
[QUOTE=tulamide] I hate the wait object

While it is convenient, at the same time it leads to bad maintainable event sheets, whose logic is not easy to find out.[/QUOTE]

You see, I confirmed it being convenient, but at the cost of easier maintainance.

+ on button clicked
-> create object
-> wait 100 ms
-> set color filter to red
-> wait 2000 ms
-> set color filter to blue
-> wait 2000 ms
-> set x to 40
-> wait 1500 ms
-> set x to 100
-> wait 1000 ms
-> set width to 300
-> wait 50 ms
-> set width to 280
-> wait 50 ms
-> set width to 260
-> wait 50 ms
-> set width to 240
-> wait 50 ms
-> set width to 220
-> wait 50 ms
-> set width to 200
-> wait 4000 ms
-> close application

I find this horrible. But it is valid. The problem is, it indicates that these are actions to be done when a button is clicked, but it isn't. It is a set of actions that cover a sequence of over 12 seconds and is indeed a little program of its own, stuffed into one event.

Now try to make changes. Like setting the color filter to blue only if another sprite is also blue...

But again, this is only my personal opinion. Nothing to worry about. If something fits your needs then use it. Seriously.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Fri Aug 05, 2011 5:18 pm

thanks very much "wait" object in cc works good for me :)
B
4
S
2
G
1
Posts: 143
Reputation: 1,211

Post » Mon Mar 12, 2012 2:29 am

hi all!

wait timer works nicely but it seems whenever I put one in the execution the script just "forgets" which object it was applied to and applies the script to ALL object.

Say for a on/off platform gameplay object;

on collision

wait timer 1000ms

make invisible and disable collision

it does all that to all instances of the objects so all platforms dissapear...

but without the timer the private selection works just fine...

thank you very much!
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Mon Mar 12, 2012 3:20 am

in fact both methods creates the same annoying result, even with the variable incrementation method, all instances seem to share the private value of the first platform that's been touched...
even if I specify that with every touch, reset your own timer to zero!

so there is clearly something I don't get with how construct selects instances and just how private those variables really are

B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Mon Mar 12, 2012 3:48 am

found the timer behavior that you can apply an object but it doesn't seem to handle more than one timer. feels like bugs to me.

If I execute a second timer when the first one is over, the game just crashes

tried many other configurations but any timer that isn't the first one seems to be considered completed at the start.

I simply want to make a platform that dissapear then reapear after a short while... spent all day trying to do that. XD oh well, going off to bed

sorry for the spam!

cheers!
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Mon Mar 12, 2012 8:00 pm

+ Platform: Value 'Trigger' Equal to "1"

+ System: Every 100 milliseconds
-> Platform: Add 1 to 'Timer'

+ Platform: Value 'Timer' Equal 20
-> Make Paltform invisible etc

+ Platform: Value 'Timer' Equal 50
-> Platform: Set 'Timer' to 0
-> Platform: Set 'Trigger' to 0
-> Make Paltform visible

http://dl.dropbox.com/u/12412965/Timer.capUnixRoot2012-03-12 20:24:01
B
7
S
2
G
2
Posts: 45
Reputation: 1,465

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests