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?
Posts: 149
Reputation: 1,626

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.
Posts: 2,123
Reputation: 17,200

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests