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
15
S
5
G
2
Posts: 357
Reputation: 3,691

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
42
S
11
G
5
Posts: 269
Reputation: 10,790

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
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

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
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Sun Sep 30, 2012 9:16 pm

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

B
28
S
6
G
5
Posts: 248
Reputation: 5,463

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
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

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: totoe and 7 guests