How to catch the return of a function ?

Get help using Construct 2

Post » Sat Jul 02, 2016 11:55 am

Message: Andersonfrfilho can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I have this code and need the value of mmc , to handle the return value of the function ?
follows the image below
Image
link img
http://uploaddeimagens.com.br/imagens/sem_titulo-png--16341
B
4
Posts: 3
Reputation: 206

Post » Sat Jul 02, 2016 1:34 pm

@Andersonfrfilho

in an action after you call function MMC, you get set a variable to Function.ReturnValue

or use Function.ReturnValue in an expression
B
96
S
33
G
20
Posts: 438
Reputation: 17,665

Post » Sat Jul 02, 2016 4:31 pm

you can also use the expression Function.Call() which will trigger the function and return its value in the expression

"Function expressions
Call
Call a function directly from an expression. The expression returns the return value that was set in the function, or 0 if no return value was set. Additional parameters can optionally be added after the name of the function, e.g. Function.Call("CreateEnemy", 123, 456)."

https://www.scirra.com/manual/149/function
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

Post » Thu Feb 09, 2017 5:33 pm

AllanR, Aphrodite, very thanks !!!
B
4
Posts: 3
Reputation: 206


Return to How do I....?

Who is online

Users browsing this forum: dop2000, lahbach, Waltuo and 31 guests