Call Function from other Flow

Forums 💬 FlowCanvas ⚙️ Support Call Function from other Flow

  • This topic has 0 replies, 2 voices, and was last updated 7 years ago by Gavalakis.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #21901
    fweds
    Participant

      Hi,

      I bought FlowCanvas and I am really satisfied.

      By cons I would like to call for example a function from another flow because I need to pass several parameters at the same time and of different types.
      Custom events allow only one parameter to pass so they are not suitable.
      Creating variables would be heavy, hence the ability to call a function from another flow graph.

      How to do ?

      Thank you

      #21903
      Gavalakis
      Keymaster

        Hello and welcome to the forums.
        Thanks for purchasing FlowCanvas and I am glad you like it!

        While indeed the “normal” way of communicating between different flowscripts, is the Event Nodes, here is an alternative solution that would work better in such a case.

        1. Create a normal “Custom Function” (Functions/Custom/New Custom Function) in target flowScript.
        [attachment file=”CustomFunction.png”]

        2. In the other flowScript from which you want to call this function from, drag and drop the target flowScript (containing the custom function) into the canvas. This will popup a selection menu. from that menu, select “FlowScriptController/Methods/Call Function”.
        [attachment file=”DragDropGameObject.gif”]
        This method, is basically able to call a custom function created in the flowScript.

        3. Give the correct name of the function to call (in this example just “MyFunction”) and optionally, use the “Expose Parameters” option, which will expose the params object[] to individual ports and which can be very useful!
        [attachment file=”CallFunctionInspector.png”]

        4. Make some connections.
        [attachment file=”Call Function.png”]

        That’s it.
        There are of course some downsides in this solution, like for example working with string function names and object type parameters (instead of strongly typed, but it is still a valid solution 🙂
        I could make a dedicated custom node like “Call External Function” to handle these things easier though.

        Let me know if that works for you as expected.
        Thank you!

        #21902
        fweds
        Participant

          Thanks, it’s fine !

          But if you can make a dedicated custom node like “Call External Function”, it would be interesting 😉

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.