Do functions happen the frame after they are called?

Discussion and feedback on Construct 2

Post » Thu Jul 16, 2015 1:00 pm

An action to call a function appears in my event sheet BEFORE the 'on-function-called' condition executing the function, so it should be able to occur in one frame, right? Well it looks as if the function is happening the frame AFTER it's called.

If that's not supposed to happen and somebody can guess what I might be doing wrong to cause it then it would be super nice if you told me. Thanks.
B
8
S
1
Posts: 54
Reputation: 824

Post » Thu Jul 16, 2015 1:25 pm

functions should happen immediately when they are called. there's an issue with your events.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Thu Jul 16, 2015 1:34 pm

Functions order in the event sheet is irrelevant, as they are pure trigger. As sqiddster said, a function call is executed and "end" even before the next action in the same event. Unless you have any wait call in the function or just before, it shouldn't run in the frame "after".
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Thu Jul 16, 2015 2:48 pm

Huh that's weird. I've copy-pasted the actions now instead of using a function and that's done the trick, so don't worry.
B
8
S
1
Posts: 54
Reputation: 824

Post » Thu Jul 16, 2015 3:57 pm

For my curiosity, could you tell us what were those actions?
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Wed Jul 22, 2015 11:49 am

Set the size of every instance of this object based on some instance variables.
B
8
S
1
Posts: 54
Reputation: 824

Post » Wed Jul 22, 2015 12:30 pm

Was there some newly created objects along the way per chance?
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Wed Jul 22, 2015 12:36 pm

Magistross wrote:Was there some newly created objects along the way per chance?


That would be a classic issue.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
85
S
27
G
21
Posts: 1,969
Reputation: 19,167

Post » Sun Aug 09, 2015 4:11 pm

Magistross wrote:Was there some newly created objects along the way per chance?

Yes!
B
8
S
1
Posts: 54
Reputation: 824

Post » Sun Aug 09, 2015 4:14 pm

Magistross wrote:Was there some newly created objects along the way per chance?

Every 1/8 seconds a function runs to correct the size of these fake 3d objects. The function also runs when one of them is first created. However, when that happens the newly created object is not immediately affected.
B
8
S
1
Posts: 54
Reputation: 824

Next

Return to Construct 2 General

Who is online

Users browsing this forum: jefftrier, vikuserro and 7 guests