New Event Sheet Feature: Gated Sections

Discussion and feedback on Construct 2

Post » Tue Dec 16, 2014 2:42 pm

As far as I can tell, sub-events to exactly what you describe already. Sub-events are "gated" by the truth of their parent events.

You may also be interested in looking in to functions to improve the modularity of your events.
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,756

Post » Tue Dec 16, 2014 2:47 pm

Thanks,

I haven't thought about subevents as gated states, but its a good idea and I will try it out, to see if this is what I was looking for.

Indeed i am using functions a lot, and also like it that functions can have different "versions", based on the conditions attached to them. This makes functions very powerful in C2.
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Post » Tue Dec 16, 2014 10:52 pm

The best thing about functions is that they can be almost completely modular; this really saves time because you can move such functions between projects effortlessly.

I used to use groups as pseduo-functions, but if you activate/deactivate a group at a point in the event sheet that is after the group itself, you have to wait till next tick for the change to take effect. This can really throw things. With functions, you can called them and get data back immediately. Now I tend to use groups more for organization, debugging (finer-grain cpu readings), or for turning large chunks of code on/off.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Thu Dec 18, 2014 4:56 pm

@Ashley @grossd

i think groups could improve by using toggle "current" group,
if you copy it, change the group name and your done
and it could also function as a run group once

i like to use them for a processes that i want to run for a period of time
i then start check for events that autoclose the process/group
an added bonus, is that you can easy see how "heavy" the process is in debug

i also made a custom function to toggle multiple groups,
ex: if file loaded, function toggle ('fileload","maineventloop") .. to chain groups
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Thu Dec 18, 2014 4:58 pm

nice, thanks.
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Post » Fri Dec 19, 2014 11:48 am

@grossd

if your interested, an easy way to do the function

on function "toggleGroup"
repeat function.paramCount times > system: set group function.Param(loopindex) Toggle Active

this way it will use every parameter (the groups in this case) and toggle them
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Sat Dec 20, 2014 7:40 pm

Thanks.

And, thanks for showing me how to use variable number of parameters in functions/
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: AndreasR and 5 guests