Formulas that return vectors, or multiple values?

0 favourites
  • 1 posts
From the Asset Store
Platform HTML5 game, where the little Dinosaur must cross the forest, desert and snow forest.
  • Hi all, :)

    Regarding ACEs, is there a best practice for implementing a formula that returns a vector?

    I'm building a math plugin, and I was interested in adding an expression to return the intersection point between two lines.

    To return a point, I need to return the X and Y value for that point.

    The issue I'm running into is that C2 Expressions can't return vectors, and even if they could, there's no vector variable type in C2 to my knowledge, so there'd be nowhere to put the vector anyway. So I'm thinking I may have to use a combination of actions and expressions, to set parameters and retrieve the vector components individually.

    Is there a good or standard way to do this?

    Am I overlooking a way to do this purely with expressions?

    It seems technically possible to make an expression that sets internal variables rather than returning a value, but I suspect using the execution of an expression to change the internal state of an object is not encouraged. :D

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)