How do you make a function?

Get help using Construct 2

Post » Thu Feb 28, 2013 6:58 am

I apologize for asking what I would imagine to be a simple question, but I spent a good 20 minutes searching for the answer.

It seems that there is an official way to make functions, but in the tutorials I found it doesn't actually show me how specifically, and as far as I can actually tell by fiddling around with event sheets, there isn't an actual way to make functions officially in C2. Is such a simple time saving ability not implemented into C2 or am I just looking in the wrong places?
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu Feb 28, 2013 7:23 am

The function plugin let's you write a block of events that can be called and reused from other places in the event sheet. It can optionally set a return value. It's an "official" part of c2 and documented in the manual.

If you mean that you want to write a JavaScript function, then you can do that too - read the SDK documentation about creating a custom plugin.
B
8
S
2
G
3
Posts: 83
Reputation: 2,668

Post » Thu Feb 28, 2013 10:13 am

You need to drop the function object in before you can use functions in your event sheet. Same as you would with mouse, keyboard etc.
B
20
S
6
G
2
Posts: 157
Reputation: 3,109

Post » Thu Feb 28, 2013 6:16 pm

There's an excellent manual entry on Functions, complete with screenshot examples.

@Sushin, what more do you need to know?
B
105
S
20
G
12
Posts: 549
Reputation: 20,320


Return to How do I....?

Who is online

Users browsing this forum: Matthew de and 25 guests