Trigger Once not working

For questions about using Classic.

Post » Mon May 31, 2010 2:08 pm

Hello People!

Well like the Title of this Topic says, for some very weird reason the "Trigger Once" command doesn't work. (either that or I'm dumb XD ).



^ That's the event, and I can't seem to find the Mistake. What it does is making the "Speech Layer" appear right from the start of the Frame, but not after 10 Seconds.

Any Idea's how I can fix this? Any help would be greatly appreciated! :)

Regards,

Mr. Snooley
B
3
G
2
Posts: 67
Reputation: 809

Post » Mon May 31, 2010 2:25 pm

Well first you have to ask 10 seconds since what, or more importantly the system has to ask that since its a system action. In other words the system thinks 10 seconds has already passed. Also Trigger once(while true) isn't designed to work in the same condition, better to put it in a sub event, but again since every x milliseconds is a system action it will always be true.

Might want to take a look at the Function object... Call function after delay, or one of the other timer type objects, timeline, etc.

Edit:
Yeah what Tulamide said, except I didn't think about the fact it starts at 0.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon May 31, 2010 2:26 pm

The "every x ..." is a loop. It triggers the event on every 10000ms in your case. So the event will be triggered on 0ms, 10000ms, 20000ms, etc.

Combinig this with trigger once is odd, but what at least happens is that the event is triggered first on 0ms.

If you just want to make the layer visible after 10 seconds of the layouts playing time has passed, system compare against the timer:

+Timer greater than or equal 10000
Trigger once
->your actions

I wouldn't use "Timer equal to", because it is not guaranteed that you will catch the exact moment of 10000ms
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Mon May 31, 2010 3:15 pm

Hey thanks, that with the Timer eagual / greater than 10000 worked! :)

Just one little Question, is the "Timer" the timer of one Layout or of the whole Application? If it is the latter then this would logically not work.

Thanks alot people!

Regards,

Mr. Snooley
B
3
G
2
Posts: 67
Reputation: 809

Post » Mon May 31, 2010 4:33 pm

[quote="Mr. Snooley":35wck7rk]Hey thanks, that with the Timer eagual / greater than 10000 worked! :)

Just one little Question, is the "Timer" the timer of one Layout or of the whole Application? If it is the latter then this would logically not work.

Thanks alot people!

Regards,

Mr. Snooley[/quote:35wck7rk]

Puh you caught me in the last minute, I'm almost out of the door :)

Everything related to a layout is resetted, when the layouts are switched. That's why the timer counts from zero everytime you switch to another layout (or just call the same layout again). The method is safe for your needs :)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Mon May 31, 2010 4:34 pm

Very nice, thanks alot!

Greatly appreciate it. :)

Mr. Snooley
B
3
G
2
Posts: 67
Reputation: 809

Post » Mon May 31, 2010 6:03 pm

[quote:36bguidd]I wouldn't use "Timer equal to", because it is not guaranteed that you will catch the exact moment of 10000ms[/quote:36bguidd]
Actually go ahead and use "Timer equal to" because according to construct's source, this:
[code:36bguidd]+Timer equal to 10000
->your actions[/code:36bguidd]
Behaves exactly the same as:
[code:36bguidd]+Timer greater than or equal 10000
Trigger once
->your actions[/code:36bguidd]
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests