[PLUGIN] rex_Function2

Post your completed addons to share with the community

Post » Sat Nov 12, 2011 11:44 am

rex_function2
passing name-value to function

rex_function2M
passing name-value to function, and support multiple instance to organize functions more better.


rex_bfunction2
A behavior version of rex_function2 plugin, to run a private function of an object.
Last edited by rexrainbow on Thu Jun 23, 2016 4:09 am, edited 3 times in total.
B
97
S
22
G
178
Posts: 4,122
Reputation: 104,051

Post » Sat Nov 12, 2011 11:46 am

amazing..ty a lot
B
159
S
38
G
11
Posts: 229
Reputation: 17,361

Post » Mon Nov 14, 2011 10:50 am

I had updated some code. Please download it again.
B
97
S
22
G
178
Posts: 4,122
Reputation: 104,051

Post » Mon Nov 14, 2011 10:26 pm

ty,already grabbed from your gitHub ^^
B
159
S
38
G
11
Posts: 229
Reputation: 17,361

Post » Wed Nov 16, 2011 4:07 am

Update:

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.rexrainbow2011-11-17 01:17:31
B
97
S
22
G
178
Posts: 4,122
Reputation: 104,051

Post » Wed Nov 16, 2011 11:01 pm

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!

-D
B
4
G
1
Posts: 6
Reputation: 513

Post » Thu Nov 17, 2011 1:33 am

Only method1 (traditional) can pass variable name = "Variable1", and value = 123. You can use "Action: Set parameter"
[code]Set parameter ["Variable1"] to 123[/code]


Sorry, I am not really understanding your question. Do I hit the target?rexrainbow2011-11-17 01:35:01
B
97
S
22
G
178
Posts: 4,122
Reputation: 104,051

Post » Thu Nov 17, 2011 7:34 pm

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?

-Dan
B
4
G
1
Posts: 6
Reputation: 513

Post » Thu Nov 17, 2011 8:11 pm

@djbav : Even though C2 exports project as javascript in the end, the coding itself in C2 is different and relies on its own rules.
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.Kyatric2011-11-17 20:15:01
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Nov 17, 2011 8:14 pm

It certainly does, thank you :)
B
4
G
1
Posts: 6
Reputation: 513

Next

Return to Completed Addons

Who is online

Users browsing this forum: GoGugutiGames and 6 guests