How do I use 'on return value' in function?

Just started using Construct 2? Post your questions here

Post » Sun Jun 07, 2015 2:29 pm

Hello all,

Can anyone give me an example on how the 'on return value' can be used usefully?. I mean I generally use functions to just call events with different parameters. I've never used the 'call expression' or 'on return value' . So how can I make use of these?
B
16
S
4
Posts: 140
Reputation: 1,458

Post » Sun Jun 07, 2015 6:46 pm

Call expression is only useful if you have enough parameter that the classic call function cannot keep up with them (I know at a high number of parameters, the window just cannot go larger, even though in most cases it is just not needed).

When you set a return value, it will basically be the value used when you are using Function.Call in an expression, for exemple, lets imagine..

Global variable Number = 3
On function "double", return value: 2*function.param(0)

On start of layout:
Set Number to Function.Call("double", Number)


Number will be equal to 6 after the layout starts once.
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 Beginner's Questions

Who is online

Users browsing this forum: brunopalermo and 0 guests