Call Function from other Flow

FlowCanvas Forums Support Call Function from other Flow

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1849
    DarkNBlood
    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

    #1852
    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.
    CustomFunction

    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”.
    DragDropGameObject
    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!
    CallFunctionInspector

    4. Make some connections.
    Call-Function

    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!

    Join us on Discord: https://discord.gg/97q2Rjh

    Attachments:
    You must be logged in to view attached files.
    #1864
    DarkNBlood
    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.