How do I Send Text to a Function

Get help using Construct 2

Post » Fri May 16, 2014 10:31 pm

Hey there,
I have been playing around with Functions and I am curious as to how I would send text to the Function. Currently, I just call a Function with parameters 0,1,2 etc etc. Then the function would display the predetermined text. But what if I wanted the user to input their own text? How would I pass that to the Function?

In the screen below you can get an idea of what I am working with right now.
You do not have the required permissions to view the files attached to this post.
B
56
S
15
G
13
Posts: 826
Reputation: 17,675

Post » Fri May 16, 2014 10:49 pm

you can pass a text as a parameter of a function, for exemple if you pass the value "I like eating chocolate" as the second parameter(parameter number 1) of your function along with the value 1 to the first parameter (parameter number 0), and you add an action :

SystemMessage : Set text to Function.Param(1)

Then the text displayed will be
Code: Select all
I like eating chocolate
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123


Return to How do I....?

Who is online

Users browsing this forum: NN81, pmerineau and 21 guests