Arbitrary parameter count for Conditions and Actions?

For developers using the Construct 2 Javascript SDK

Post » Mon Mar 23, 2015 12:33 pm

Is there a good way to make Conditions and Actions that take an arbitrary number of arguments?

I notice that the Function object uses

AddVariadicParams()

to do this, but when I searched the forums, I only found one post on the topic explaining that it sort of a hack, built specifically for the Function object. Granted the post was from a few years ago so I don't know if AddVariadicParams has changed since then.

The best work around I've found other than that is to provide a single do-nothing parameter, from which you can call an expression that has the side effect of passing its variable arguments into an array behind the scenes, which can then be used by the Actions or Condition.

Any thoughts or suggestions welcome.
B
26
S
17
G
8
Posts: 323
Reputation: 6,019

Post » Mon Mar 23, 2015 2:01 pm

I had used this feature in my plugin, but it would not work in behavior. Or you might make a "push action" to do the same thing.
B
108
S
26
G
252
Posts: 4,404
Reputation: 142,125


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests