will this work:psudo functions with event sheets?

Discussion and feedback on Construct 2

Post » Sat Sep 29, 2012 10:12 pm

If I create an event sheet called say "myfunction", and in it have one event:

System 0 = 0 -> bunch of actions

Then import the sheet in several different events in the main event sheet, will this work like a function call?

It seems to.

I.e. can I call the myfunction several times (not just once) from the main sheet.nutmix2012-09-29 22:12:40
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Sun Sep 30, 2012 2:02 am

why don't you try activating and deactivating groups... I think that's the easy way
Image
B
58
S
13
G
6
Posts: 271
Reputation: 12,128

Post » Sun Sep 30, 2012 6:18 pm

You should not do this, because event sheets can only be run once per tick (to prevent cyclic includes). If two of your includes try to run in one tick, the second will not run at all.

There's a function plugin, and we also have built-in function features planned as well.
Scirra Founder
B
399
S
236
G
89
Posts: 24,546
Reputation: 195,436

Post » Sun Sep 30, 2012 9:11 pm

Thanks Ashley. Is the layouts event sheet run in its entirety from top to bottom per tick? If so, then as you say I could be "calling" the other event sheet twice.

I am testing out the function plugin, but Id rather be able to throw and catch my own event!
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Sun Sep 30, 2012 9:16 pm

[QUOTE=Ashley] ... and we also have built-in function features planned as well.[/QUOTE]

B
30
S
6
G
5
Posts: 251
Reputation: 5,612

Post » Sun Sep 30, 2012 11:38 pm

I was curious about this, too. I would love to be able to know how to use multiple sheets per layout without causing massive lag. Mostly what I want is it to run once when I call it then stop.Helladen2012-09-30 23:43:00
Image
B
20
S
4
Posts: 105
Reputation: 2,315

Post » Sun Sep 30, 2012 11:52 pm

@Helladen: you can use groups or simply conditions/trigger.

The on button click is a trigger that requires a user action.
But with conditions, it's your job to make sure that the condition can only be true one tick (at a time or ever).

Edit: example capx for one condition
It works because the include is considered a sub event of event one. But event one condition is true only one tick and so its sub event executed only once.Kyatric2012-10-01 00:00:18
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
294
S
117
G
96
Posts: 7,312
Reputation: 71,092

Post » Mon Oct 01, 2012 12:17 am

Thank you. Helladen2012-10-01 00:17:33
Image
B
20
S
4
Posts: 105
Reputation: 2,315


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests