[PLUGIN] FunctionForum Home > Construct 2 Development > Plugins for Construct 2
|Post Reply||Page 123 13>|
Topic: [PLUGIN] Function
Posted: 12 Nov 2011 at 11:44am
Please use official function object first!
Function (Update 2012/05/11)
Function plugin provides to define function(event). It's important for my plugin system.
Function plugin now provides three ways to call a function. Example
1. tradition way, like in C1
The 1st parameter of "expression:Call" is function name. 2nd, 3rd parameters are mapping into param, param
3. action:execute commands
The parameter of "action: Execute commands" is a string. It's similar to "expression:Call". 1st parameter is a function name, 2nd,3rd parameters are mapping to param, param.
There are two different between "action:execute commands" and "expression:Call".
1. parameters(not function name) will use "eval" to get number or string. If you want pass a string parameter, use single quotation marks, ex 'hi'.
2. two or more commands can concatenate by "\n"(newline) in a single string.
More usages will be introduced next time.
In Function plugin, expression:param is use to pass input parameters. There are two way to pass return value(s).
1. "Expression:Result" is use to return single value to "expression:Call"
2. "Expression:Ret" is use to pass more then one return values.
Action: Inject JS function objects
Debug mode property
Edited by rexrainbow - 12 Feb 2013 at 4:51pm
|Post Options Quote Reply Posted: 12 Nov 2011 at 11:46am|
amazing..ty a lot
|Post Options Quote Reply Posted: 14 Nov 2011 at 10:50am|
I had updated some code. Please download it again.
|Post Options Quote Reply Posted: 14 Nov 2011 at 10:26pm|
ty,already grabbed from your gitHub ^^
Commodore 64 + Datassette 1530
|Post Options Quote Reply Posted: 16 Nov 2011 at 4:07am|
Fix bug in "Action:Execute commands". Now, you can pass command string with null string parameter like "fn,".
("Action:Execute commands" is usually used by WorkSheet plugin)
Thank gonzdevour to find this bug.
Edited by rexrainbow - 17 Nov 2011 at 1:17am
|Post Options Quote Reply Posted: 16 Nov 2011 at 11:01pm|
Say that you wanted to pulled the value from a variable like this...
Variable1 = 123
...but with two variables holding "Variable" and a 1
How would you accquire that "123" with the function code?
Thank you for making this plug-in!
|Post Options Quote Reply Posted: 17 Nov 2011 at 1:33am|
Only method1 (traditional) can pass variable name = "Variable1", and value = 123. You can use "Action: Set parameter"
Sorry, I am not really understanding your question. Do I hit the target?
Edited by rexrainbow - 17 Nov 2011 at 1:35am
|Post Options Quote Reply Posted: 17 Nov 2011 at 7:34pm|
Kind of, and thank you for helping me!
I mean I'm used to coding something like this in Actionscript...
Variable1 = 123;
vara = 1;
grabbedvar = eval("Variable" + 1);
To obtain the value "grabbed" similar to this with your plugin, how could I accomplish that?
|Post Options Quote Reply Posted: 17 Nov 2011 at 8:11pm|
You should really check out/again the Beginners guide to C2, get used to expressions and check out the system expressions list.
You can directly use the name of your variable as expression.
If you want to get the value "123" out of "Variable1" and set it to "Variable2" for example:
Make a condition system set value global variable, pick "Variable2" and set value to "Variable1".
Variable2 will now contain Variable1's value.
This is covered and demonstrated in the beginner tutorial, and you can read more about variables in the How do I FAQ.
This article from Scirra's blog should be worth reading too.
Edited by Kyatric - 17 Nov 2011 at 8:15pm
|Post Options Quote Reply Posted: 17 Nov 2011 at 8:14pm|
It certainly does, thank you :)
|Post Reply||Page 123 13>|
|Forum Jump||Forum Permissions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum