Arbitrary param count for Conditions & Actions?

  • Is there an official way to make Conditions and Actions with unlimited params (variadic)?

    I know Expressions have the "ef_variadic_parameters" flag.

    And the Function object uses the "AddVariadicParams()" method for the "Call Function" Action, but I'm not sure if this method is for the Function object only, or if it's okay for general use in 3rd-party plugins.

    So, I'm curious if there is an official way to do this for Conditions and Actions.

    Thanks in advance for any info or suggestions.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • See the source code of official function plugin, line 172, line 260.

  • Thanks for the reply Rex,

    I looked over the Function runtime code.

    So it looks like "AddVariadicParams()" is passed as an array to the corresponding runtime function single parameter.

    Is it okay to use it for Plugins and Behaviors?

    Ashley mentioned in an older post that it was a hack for the Function object, and was not recommended for use in 3rd party plugins. Granted, he said that was not recommended, 'for the time being', and that was back in 2012.

    Do you know off hand if whatever limitations that existed then are no longer an issue?

    The plugin I'm working on would ideally be usable as a behavior.

  • fisholith

    Behavior does not support AddVariadicParams(). You might add an action to push a parameter, so that user could call it many times to have a parameter array.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)