Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

FlowCanvas - Visual Scripting Similar to Unreal Blueprints

Discussion in 'Assets and Asset Store' started by nuverian, Apr 14, 2015.

  1. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    367
    Besides the question from above, I'm also interested in this.
    I have been working with the asset called Curvy. It is a pretty awesome Spline Tool.

    This thing has a couple of events that can happen:
    http://www.fluffyunderware.com/curvy/documentation/controllers/events

    I have a couple of SplineControllers on a couple of game objects. This SplineControllers basically tell that object how to move on the spline.

    I can also call events on the SplineController like this:


    As you can see, whenever I am over a Control Point (the spline is made of many control points), I send an event called "test" to a particular game object.

    This is what I want to do, and I don't know how!

    1. I need to know WHO send this event. What SplineController did this?
    2. I need to know over WHAT ControlPoint I was.

    Basically whenever I go over a ControlPoint, I send a message. I need to find out what is the ControlPoint in order to check if it has a FlowCanvas script. Then I need to know which SplineEvent send this event in order to change some settings on the SplineController.

    This sends that event whenever it moves on ALL Control Points, but I'm only interested in the ControlPoints that have a FlowCanvas script, that also has a BOOL :D If that BOOL is true, the SplineController will have some settings changed.



    I have allready added those in the Preffered Type.

    I see some events like this:


    But I'm not really sure what to do with them.

    This is how the code looks from the example:
    Code (CSharp):
    1.         void OnCPReached(CurvySplineMoveEventArgs e)
    2.         {
    3.             var jc = e.ControlPoint.GetMetadata<MDJunctionControl>();
    4.             if (jc)
    5.             {
    6.                 if (jc.UseJunction)
    7.                 {
    8.                     e.Follow(e.ControlPoint.Connection.OtherControlPoints(e.ControlPoint)[0]);
    9.                     // Set the controller to use the new spline
    10.                     SplineController controller = (SplineController)e.Sender;
    11.                     controller.Spline = e.Spline;
    12.                     controller.RelativePosition = e.TF;
    13.                 }
    14.             }
    15.         }
    This is kind of what I'm trying to do. If the ControlPoint has a BOOL set to True. I want to change the Spline of the Spline Controller:


    To a new spline.

    Thanks!
     
  2. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hey,

    [ExecuteInEditMode] flowScripts are not really possible at this time. I've previously thought about allowing flowScripts to execute in edit mode, but because of the various "accidents" it can produce if one is not careful enough, I ended up not implementing this in the end, and is something I would really prefer avoid adding for that reason :)


    Unfortunately this will not work exactly out of the box, but it can be worked around with a very simple script that will act as a "bridge" / "dispatcher" from the Spline Controller to a flowScript.
    I don't own Curvy, but for your convenience I try replicate the naming I see in the screenshots you've posted to walk you through what you can do as follows:

    1) Create this simple script, which will act as our "bridge".
    Code (CSharp):
    1. using UnityEngine;
    2. using FlowCanvas;
    3.  
    4. public class EventDispatcher : MonoBehaviour {
    5.  
    6.     //The target FlowScriptController to dispatch the event to
    7.     public FlowScriptController controller;
    8.     //The event node name to call
    9.     public string eventName;
    10.  
    11.     public void OnControlPointReached(CurvySplineMoveEventArgs args){
    12.         controller.SendEvent<CurvySplineMoveEventArgs>(eventName, args);
    13.     }
    14. }
    2) Attach this script on the same gameobject where the Spline Controller is (replica in this image), then in that Spline Controller Unity Event inspector, assign the EventDispatcher itself in the object space and select the "EventDispatcher.OnControlPointReached" in the menu on the right for the function to call (this is the function of our script).
    EventDispatcher.png
    Set the variables of EventDispatcher to match the Target FlowScriptController you want to send the event to, as well as the Event Name node in the flowScript to call.

    3) Finally in that FlowScript and as expected, you need to create a Custom Event<CurveSplineMoveEventArgs> and set the event name to await to be the same as the one you set in the EventDispatcher ("ControlPointReached" for this example).
    EventNode.png
    The EventValue output, will contain all the variable arguments that Curvy is providing for it's event (as explained in the Curve documentation page you posted).

    With all that said, in the roadmap for the next version, I have just added the ability to subscribe to such UnityEvents directly within a flowScript, so that all of this can be achieved much easier and with a single node! :)

    Let me know if that works for you :)
    Thanks!
     
    GamerPET likes this.
  3. blamejane

    blamejane

    Joined:
    Jul 8, 2013
    Posts:
    228
    I love the look and feel of your flow canvas asset, but I actually need it to be used in a rendered scene rather than as an editor extension. I want to create a scene with rendered nodes/children in a hierarchy.

    Would it be possible to use your asset like this: https://www.assetstore.unity3d.com/en/#!/content/51304
     
  4. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Hi,

    I look for an asset that I can visualize my own script ( my own C sharp classes and interactions ). So, I do not want to create visual scripts, I just want to keep writing my codes in monobehaviour but I want to visually see their sequences, interactions, etc..

    Can this asset do this ? or Does it for only creating brand new visual scripts and actions ?

    Regards.
     
  5. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hello and sorry for the late replies due to summer vacation.

    Hey,
    Thanks. I am glad you like the UI! Unfortunately FlowCanvas editor can not be used in runtime Unity UI, because it is using a lot of the UnityEditor API, which as you may know, is not available in runtime at all. Having FlowCanvas "render" with runtime UI will require a huge amount of work, basically recreating another totally separate UI from scratch only for that reason and I am not sure whether there is much demand of this to justify the work required, but if there is, I might reconsider this :)
    Thank you!

    Hey,
    Thanks for your interest in FlowCanvas.
    FlowCanvas is build with the intention of creating new visual scripts within the FlowCanvas editor only, thus it can't visualize existing c# scripts.
    Thank you!
     
  6. vit_lipatov

    vit_lipatov

    Joined:
    Dec 6, 2016
    Posts:
    1
    Hello! Thank you for FC, its great tool.
    Is it possible to set the default values for the input variables in the node(in case the port is not connected)? I created the custom node inherited from SimpleNode, but I see no way to set the default value for ValueInput <T>.
     
    nuverian likes this.
  7. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hello,
    Thanks as well! I am glad you like FlowCanvas :)
    It is not yet possible, but here is a quick solution for that.
    Please open up SimplexNode.cs and add the following piece of code at the very end of method RegisterPorts at about line #58:
    Code (CSharp):
    1. #if UNITY_EDITOR
    2.             //set default parameter values if any
    3.             foreach(var parameter in parameters){
    4.                 if (parameter.IsOptional){
    5.                     var inPort = node.GetInputPort(parameter.Name.SplitCamelCase()) as ValueInput;
    6.                     if (inPort != null){
    7.                         inPort.serializedValue = parameter.DefaultValue;
    8.                     }
    9.                 }
    10.             }
    11. #endif
    Doing so, you will then be able to set the default value of the Invoke method parameters for SimplexNode inherited nodes, like for example:
    Code (CSharp):
    1.     public class LogText : CallableActionNode<string>{
    2.         public override void Invoke(string text = "Hello World"){
    3.             Debug.Log(text);
    4.         }
    5.     }
    Please let me know if that works for you.
    Thanks again!
     
  8. Barabicus

    Barabicus

    Joined:
    Jun 5, 2013
    Posts:
    159
    Hey,

    Sorry if its being asked before but I just picked up FlowCanvas and I was to start a Sub Behaviour Tree from NodeCanvas as part of one of the FlowCanvas tasks. I see in the NodeCanvas bridge, you can create Flowscripts in NodeCanvas' Behaviour Tree and FSM but not vice versa. I also see you can use action tasks in Flowcanvas but I can't actually start a behaviour tree or fsm. So I was wondering how would I go about doing this?
     
  9. Acquire

    Acquire

    Joined:
    Oct 22, 2015
    Posts:
    2
    I would like to add a new structure to the Preferred Types Editor.
    (Eg "user" structure with "id (integer), name (string), hp (integer)")
    How can I add it?
     
  10. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    143
    Hi there, I have a question regarding AOT platforms (consoles). Are the Macros supposed to be supported on these platforms?

    Generating the «AOTClasses.cs» and link files solved the vast majority of our issues with flows, but we still have a couple unsolved ones :
    -weirdly enough setting a material color wouldn't work, even after adding all renderer/material related classes. Not a huge deal, we created a custom node to replace that
    -Macros are not working, raising several errors :
    Code (CSharp):
    1. <b>(Deserialization Error)</b>: Constructor of FlowCanvas.BinderConnection`1[System.Single] threw an exception when creating an instance
    2.   at ParadoxNotion.Serialization.FullSerializer.fsMetaType.CreateInstance () [0x00122] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Reflection\fsMetaType.cs:352
    3.   at ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter.CreateInstance (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType) [0x00014] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Converters\fsReflectedConverter.cs:111
    4.   at ParadoxNotion.Serialization.FullSerializer.fsSerializer.InternalDeserialize_3_Inheritance (System.Type overrideConverterType, ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Collections.Generic.List`1& processors) [0x00104] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:845
    5.   at ParadoxNotion.Serialization.FullSerializer.fsSerializer.InternalDeserialize_1_CycleReference (System.Type overrideConverterType, ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Collections.Generic.List`1& processors) [0x0005b] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:744
    6.   at ParadoxNotion.Serialization.FullSerializer.fsSerializer.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Type overrideConverterType, System.Object& result) [0x00049] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:705
    7. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    8. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    9. UnityEngine.Logger:Log(LogType, Object)
    10. UnityEngine.Debug:LogError(Object)
    11. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:716)
    12. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:678)
    13. ParadoxNotion.Serialization.FullSerializer.Internal.fsIEnumerableConverter:TryDeserialize(fsData, Object&, Type) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Converters\fsIEnumerableConverter.cs:73)
    14. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_5_Converter(Type, fsData, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:887)
    15. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_4_Cycles(Type, fsData, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:879)
    16. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_3_Inheritance(Type, fsData, Type, Object&, List`1&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:858)
    17. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_1_CycleReference(Type, fsData, Type, Object&, List`1&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:744)
    18. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:705)
    19. ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter:TryDeserialize(fsData, Object&, Type) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Converters\fsReflectedConverter.cs:97)
    20. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_5_Converter(Type, fsData, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:887)
    21. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_4_Cycles(Type, fsData, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:879)
    22. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_3_Inheritance(Type, fsData, Type, Object&, List`1&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:858)
    23. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_1_CycleReference(Type, fsData, Type, Object&, List`1&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:744)
    24. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:705)
    25. ParadoxNotion.Serialization.JSONSerializer:Deserialize(Type, String, List`1, Object) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\JSONSerializer.cs:96)
    26. ParadoxNotion.Serialization.JSONSerializer:Deserialize(String, List`1, GraphSerializationData)
    27. NodeCanvas.Framework.Graph:Deserialize(String, Boolean, List`1) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:117)
    28. NodeCanvas.Framework.Graph:Deserialize() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:73)
    29. NodeCanvas.Framework.Graph:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:43)
    30.  
    31. (Filename: D Line: 0)
    32.  
    33. <b>(Deserialization Error:)</b> System.NullReferenceException: A null value was found where an object instance was required.
    34.   at NodeCanvas.Framework.Internal.GraphSerializationData.Reconstruct (NodeCanvas.Framework.Graph graph) [0x00015] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Internal\GraphSerializationData.cs:64
    35.   at NodeCanvas.Framework.Graph.LoadGraphData (NodeCanvas.Framework.Internal.GraphSerializationData data, Boolean validate) [0x0003e] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:149
    36.   at NodeCanvas.Framework.Graph.Deserialize (System.String serializedGraph, Boolean validate, System.Collections.Generic.List`1 objectReferences) [0x00031] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:118
    37. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    38. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    39. UnityEngine.Logger:Log(LogType, Object, Object)
    40. UnityEngine.Debug:LogError(Object, Object)
    41. NodeCanvas.Framework.Graph:Deserialize(String, Boolean, List`1) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:130)
    42. NodeCanvas.Framework.Graph:Deserialize() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:73)
    43. NodeCanvas.Framework.Graph:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:43)
    44.  
    45. (Filename: D Line: 0)
    46.  
    47. UnloadTime: 2.697000 ms
    48.  
    49. <b>(Deserialization Error)</b>: Constructor of FlowCanvas.BinderConnection`1[System.Single] threw an exception when creating an instance
    50.   at ParadoxNotion.Serialization.FullSerializer.fsMetaType.CreateInstance () [0x00122] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Reflection\fsMetaType.cs:352
    51.   at ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter.CreateInstance (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType) [0x00014] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Converters\fsReflectedConverter.cs:111
    52.   at ParadoxNotion.Serialization.FullSerializer.fsSerializer.InternalDeserialize_3_Inheritance (System.Type overrideConverterType, ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Collections.Generic.List`1& processors) [0x00104] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:845
    53.   at ParadoxNotion.Serialization.FullSerializer.fsSerializer.InternalDeserialize_1_CycleReference (System.Type overrideConverterType, ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Collections.Generic.List`1& processors) [0x0005b] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:744
    54.   at ParadoxNotion.Serialization.FullSerializer.fsSerializer.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Type overrideConverterType, System.Object& result) [0x00049] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:705
    55. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    56. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    57. UnityEngine.Logger:Log(LogType, Object)
    58. UnityEngine.Debug:LogError(Object)
    59. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:716)
    60. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:678)
    61. ParadoxNotion.Serialization.FullSerializer.Internal.fsIEnumerableConverter:TryDeserialize(fsData, Object&, Type) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Converters\fsIEnumerableConverter.cs:73)
    62. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_5_Converter(Type, fsData, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:887)
    63. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_4_Cycles(Type, fsData, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:879)
    64. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_3_Inheritance(Type, fsData, Type, Object&, List`1&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:858)
    65. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_1_CycleReference(Type, fsData, Type, Object&, List`1&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:744)
    66. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:705)
    67. ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter:TryDeserialize(fsData, Object&, Type) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\Converters\fsReflectedConverter.cs:97)
    68. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_5_Converter(Type, fsData, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:887)
    69. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_4_Cycles(Type, fsData, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:879)
    70. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_3_Inheritance(Type, fsData, Type, Object&, List`1&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:858)
    71. ParadoxNotion.Serialization.FullSerializer.fsSerializer:InternalDeserialize_1_CycleReference(Type, fsData, Type, Object&, List`1&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:744)
    72. ParadoxNotion.Serialization.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\Full Serializer\fsSerializer.cs:705)
    73. ParadoxNotion.Serialization.JSONSerializer:Deserialize(Type, String, List`1, Object) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\_Commons\Runtime\Serialization\JSONSerializer.cs:96)
    74. ParadoxNotion.Serialization.JSONSerializer:Deserialize(String, List`1, GraphSerializationData)
    75. NodeCanvas.Framework.Graph:Deserialize(String, Boolean, List`1) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:117)
    76. NodeCanvas.Framework.Graph:Deserialize() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:73)
    77. NodeCanvas.Framework.Graph:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:43)
    78. UnityEngine.Object:Internal_CloneSingle(Object)
    79. UnityEngine.Object:Instantiate(Macro)
    80. NodeCanvas.Framework.Graph:Clone(Macro)
    81. FlowCanvas.Macros.MacroNodeWrapper:CheckInstance() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Module\Macros\MacroNodeWrapper.cs:53)
    82. FlowCanvas.FlowGraph:OnGraphStarted() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Module\FlowGraph.cs:44)
    83. NodeCanvas.Framework.Graph:StartGraph(Component, IBlackboard, Boolean, Action`1) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:553)
    84. NodeCanvas.Framework.GraphOwner:StartBehaviour() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\GraphOwner.cs:104)
    85. NodeCanvas.Framework.GraphOwner:Start() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\GraphOwner.cs:211)
    86.  
    87. (Filename: D Line: 0)
    88.  
    89. <b>(Deserialization Error:)</b> System.NullReferenceException: A null value was found where an object instance was required.
    90.   at NodeCanvas.Framework.Internal.GraphSerializationData.Reconstruct (NodeCanvas.Framework.Graph graph) [0x00015] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Internal\GraphSerializationData.cs:64
    91.   at NodeCanvas.Framework.Graph.LoadGraphData (NodeCanvas.Framework.Internal.GraphSerializationData data, Boolean validate) [0x0003e] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:149
    92.   at NodeCanvas.Framework.Graph.Deserialize (System.String serializedGraph, Boolean validate, System.Collections.Generic.List`1 objectReferences) [0x00031] in D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:118
    93. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    94. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    95. UnityEngine.Logger:Log(LogType, Object, Object)
    96. UnityEngine.Debug:LogError(Object, Object)
    97. NodeCanvas.Framework.Graph:Deserialize(String, Boolean, List`1) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:130)
    98. NodeCanvas.Framework.Graph:Deserialize() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:73)
    99. NodeCanvas.Framework.Graph:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:43)
    100. UnityEngine.Object:Internal_CloneSingle(Object)
    101. UnityEngine.Object:Instantiate(Macro)
    102. NodeCanvas.Framework.Graph:Clone(Macro)
    103. FlowCanvas.Macros.MacroNodeWrapper:CheckInstance() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Module\Macros\MacroNodeWrapper.cs:53)
    104. FlowCanvas.FlowGraph:OnGraphStarted() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Module\FlowGraph.cs:44)
    105. NodeCanvas.Framework.Graph:StartGraph(Component, IBlackboard, Boolean, Action`1) (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\Graph.cs:553)
    106. NodeCanvas.Framework.GraphOwner:StartBehaviour() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\GraphOwner.cs:104)
    107. NodeCanvas.Framework.GraphOwner:Start() (at D:\Test - PS4\Assets\ParadoxNotion\FlowCanvas\Framework\Runtime\Graphs\GraphOwner.cs:211)
    108.  
    109. (Filename: D Line: 0)
    The macro in this scene is just a simple Wait>Toggle gameobject wrapper, which work when done outside the macro.

    Thanks.
     
  11. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052

    Hey,

    Sorry for the late reply and thanks a lot for getting FlowCanvas!
    The reason why BTs, or FSMs can not be added in a FlowScript as a nested graph, is to avoid complexity and to streamline the available options of what can be nested where. I think that a Behaviour Tree or FSM does not make a lot of sense to be a nested part of a FlowScript logic, but of course it makes a lot of sense to be able to control (start/stop) a Behaviour Tree, or FSM from a FlowScript :)

    Thus, if you want to start a Behaviour Tree, or FSM from within a FlowScript, the easiest way would be to Drag & Drop the gameobject that has the BehaviourTreeOwner (or FSMOwner) attached into the FlowScript canvas, and from the menu that will pop-up by doing this, select "BehaviourTreeOwner/Methods/More/StartBehaviour()". This will add a node in the FlowScript that when called, will start the Behaviour Tree, just as expected.
    Drag & Dropping a gameobject into the FlowScript canvas, is the easiest way to call methods or get/set properties of components that exist on that dragged gameobject.

    DragDrop.png

    StartBehaviour.png

    Please let me know if that works for you, or if I misunderstood your question.
    Thanks again!


    Hello,

    You will first need to create the structure in the normal c# way, like for example:
    Code (CSharp):
    1. public struct User {
    2.     public int id;
    3.     public string name;
    4.     public int hp;
    5. }
    After you have the structure type in your project, you will be able to find it in the Preferred Types editor search bar to add it along with any other type you'd like of course.

    If you want to create the structure to be used within a flowscript for reading/writing it's members, then I suggest that rather from using fields, you use properties instead, since properties are supported by FlowCanvas, while at least right now, fields are not. As such, you could create your struct like-so instead of the previous code I posted:
    Code (CSharp):
    1. public struct User {
    2.     public int id {get;set;}
    3.     public string name {get;set;}
    4.     public int hp {get;set;}
    5. }
    Finally by doing the above steps (create struct with properties and adding it into the Preferred Types list editor), you will be able to use it normally just like any other type, like for example:
    ReadStruct.png

    Let me know if that works for you.
    Thanks!


    Hey,

    Yes, Macros should work on AOT platforms just the same.
    Hmm. I see that the errors are related to a generic type with float being the argument. Can you please confirm that you still have the float type in the Preferred Types list editor and that the AOTClasses.cs was generated with float being in the list. By default float is in the list, but could it be that you accidentally removed it?
    If float is not still in the preferred types list, can you please add it, regenerate the AOTClasses and let me know if the problems are gone?

    Thanks in advance!
     
  12. Barabicus

    Barabicus

    Joined:
    Jun 5, 2013
    Posts:
    159
    Hey, that actually does really help. It only hit me earlier today that what I was trying to achieve wasn't with controlling a behaviour tree from within the flowcanvas but to start one on another gameobject. Thanks for your response :)
     
    nuverian likes this.
  13. DeepShader

    DeepShader

    Joined:
    May 29, 2009
    Posts:
    667
    Hello,
    if I'm using NodeCanvas and I want to visually "code"/use a 3rd parti asset (which isn't supported by NodeCanvas), I can use FlowCanvas to integrate/use it in NodeCanvas, right?
     
  14. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    143
    @nuverian : so your guess was right. floatwas not in my list. However adding it wasn't working, it kept wanting to add it as «System.Single» which was already in the list (but not caught as float at runtime it seems).
    Don't know where that comes from, if you need any files/debug to look into it, let me know.

    I've edited the file manually to add the «float» ref in the mean tmie and it's working :)
     
  15. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    709
    Hey got a few questions about Flow canvas.

    1. Does flow Canvas this work with Unity 2017.1?
    2. Is there any integration with UFPS?
     
  16. DeepShader

    DeepShader

    Joined:
    May 29, 2009
    Posts:
    667
    @HeadClot88

    1. I think so
    2. As I understand it there's nothing integrated directly, because you would call the functions of an Asset via Reflections.


    What you looking for is maybe something like NodeCanvas (same developer).

    One thing I badly noticed is that the developer needs time to answer. Sometimes days, which is very bad in a production workflow.

    I really love what I see in YouTube Videos (which are really rar) for Node- and FlowCanvas, but without fast Support/Responses (just look at the dates of the posts in this thread or in the NodeCanvas Thread) it's not very useful at all.

    Hopefully things change.
     
  17. Acquire

    Acquire

    Joined:
    Oct 22, 2015
    Posts:
    2
    What is the license of FlowCanvas? (e.g. GPL, MIT ...)
     
  18. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    367
    Well... I'm in need of help, yet again :(

    I'm still trying to figure it out how to access components that are not part of Unity. Right now I'm doing something using Corgi which is a 2D Platfomer.

    Corgi has a Prefab that is the player... and has a lot of scripts attached. That prefab is getting instantiated into the scene at runtime.



    As you can see there are many components on this prefab. What I want to access is the "Character Horizontal Movement" script and then the variable Walk Speed.

    I opened that script so I can see how the classes are called and it's something like this:
    namespace MoreMountains.CorgiEngine

    And the class is:
    public class CharacterHorizontalMovement : CharacterAbility

    Ok so I'm trying to put those things together and do something like this:



    Is this correct? When I will access this I will 100% have the $mainPlayer populated with the new instantiated prefab.

    Am I on the right track? How do I do this myself? I think that once I figure this out all my main problems will be kind of resolved :D I always drag S*** around and HOPE to finally get some kind of Component that I require. :(

    Thanks
     
  19. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hey,
    NodeCanvas already has the capability of calling functions and getting/setting properties via reflection, thus possible to utilize most existing 3rd party assets, but FlowCanvas offers a lot more control and power over utilizing existing assets since the whole FlowCanvas system is basically built around making use of reflection, but also with great performance in comparison to typical reflection usage.
    Integration of FlowCanvas with NodeCanvas if required is definitely possible and you can for example use a NodeCanvas State Machine system, where each state is modeled using a FlowCanvas flowscript!

    Hey,
    Thanks for the follow up and glad to know you got it working :)
    Just to confirm, when you say you edited the file to add the float type, do you mean the AOTClasses file?

    Thanks!

    Hello,
    - Yes, FlowCanvas works with Unity 2017.x, even though at this time there are a few totally harmless deprecation warnings, which will of course be fixed in the next version coming within the weekend.
    - There is no explicit integration package with UFPS, but the power of FlowCanvas is that it is possible to manipulate existing API/code, both of Unity as well as 3rd party assets, like calling functions and getting/setting properties, without having to create explicit integrations. :)
    In the rare cases where a 3rd party asset can't be controlled efficiently through the existing feature-set of FlowCanvas, I'd be more than happy to take requests on creating explicit 3rd party asset integrations!

    If you have any other questions, or need any more info on the above, please let me know.
    Thanks!

    Hey,
    For support inquires, I'd highly recommend to please use the official forums for FlowCanvas and NodeCanvas respectively. By policy, I tent to answer support questions on the official forums faster than the forums here, simply because on the official forums, discussion and solution can be tracked easier since each issue there has it's own thread.
    Thanks.

    Hello,
    The license for all assets on the Unity Asset Store, unless explicitly provided otherwise by the publisher, is governed by the Asset Store Terms of Service and EULA. FlowCanvas falls under this license as well.
    If you have any other questions, please let me know.
    Thanks!

    Hey!
    Yes, what you are doing here is pretty much correct, but I'd suggest that you use the generic version of GetComponent (found under "Functions/Utility/GetComponent<T>"), so that the "Value" output of the node would be already of the correct type and avoid having to cast it to the correct type. As such you should be able to do something like this:
    GetComponent.png

    Please note that I don't own Corgi, and the above is but an example with a stub class just having the same name as with your example.

    Also, remember that you could directly connect the "$mainPlayer" variable to the the input of "Set Walk Speed" and let FlowCanvas automatically do the intermediate GetComponent stuff for you! :)
    AutoConvert.png

    Let me know if this works for you.
    Thanks!
     
    GamerPET likes this.
  20. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    367
    It kind of worked. I'm still a bit confused.

    I have a prefab that has a Blackboard script. I want to access the variables of that Blackboard script.

    The problem is this:

    1. I must be sure that I will access the variables from the instantiated prefab and not the actual prefab. So because of this, I have an event like this:

    The Event Value is actually the Game Object that I want. So... how do I extract the Blackboard script from that Event Value?

    Normally I wanted to drag & drop the Blackboard script from the prefab and do "Get Variable name, type". That way I get the node that I will feed into the Event Value. That... will work. Any other way to do this? Is this the correct way? If I GetComponent<T> you suggested, I only see Unity's component's there...

    Now I have another problem. The variables I want are FLOATS. There are no Floats in the Type of that Blackboard node:


    ... I must investigate ...

    edit:
    2 MINUTES LATER ....



    I forgot about the Get Value node. It's good that I created a tutorial... so I can use it myself :D

    edit2:

    Now I'm trying to make my player do a Double Jump & change the height of the jump. Corgi has this script:


    The variable I want to access is Number of Jumps that it looks like this:


    So I can clearly see the variables in the code... yet when I go to flow Canvas I only see those:


    So you can clearly see my dilema. There is that "SetNumberOfJumpsLeft" but that's something else and it heaves differently. Besides that I don't see the JumpHeight.

    So it seems that I can't access some of those variables :/
     
    Last edited: Sep 22, 2017
    nuverian likes this.
  21. Barabicus

    Barabicus

    Joined:
    Jun 5, 2013
    Posts:
    159
    Hey is there anyway we can set categories on the macros we create so they could be under Macros/My/Name for example. And if not is there anyway we could get this functionality in a future update? I try not creating scripts when not necessary but it is handy how we can specify a category since a large collection of macros can be annoying to look through. I know we can live search but sometimes its just handy for the category name refresher if you get me. Since I don't always remember the exact name of the macro I'm looking for.
     
    nuverian likes this.
  22. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    143
    Yeah, that file. I replaced the Single reference with a reference to float.
     
    nuverian likes this.
  23. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052

    Hey,

    Thanks for the follow up. I have recently replied to your email about this. FlowCanvas currently supports only reading/writing Properties, and not Fields, for performance reasons, but in the next version, reading/writing fields will also be supported as well! :)

    Thanks!

    Hey,
    It's not currently possible to categorize Macros, but I think it's a good idea :)
    I will try to squeeze that in for the next version.
    Thanks for the suggestion!

    Thanks for letting me know.
     
    GamerPET and Barabicus like this.
  24. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    367
    Is there a way to create some kind of "Temporary Variable" that is only used in a particular scenario?
    I'm only using it to calculate some stuff during a "flow event" and I would hate to clog my blackboard with this kind of variables.

    Is there a way to send an event with multiple type of values?

    I'm running into a small problem where a GameObject it's sending itself and the game manager checks for the Variables that the GameObject has, the problem is that after that I'm destroying that GameObject so there are no variables :D Normally it wasn't a problem because I was always destroying the object after I was sure I'm done with it, but now things get a bit more complicated and I'm curious if there is a way to just send a couple of values (Int, float, bool, gameobject) and then be done with it.
     
    Last edited: Oct 3, 2017
  25. dancinLion

    dancinLion

    Joined:
    Jul 16, 2012
    Posts:
    13
    Hey, I'm getting back into Node Canvas/Flow Canvas and started with some prototyping. In order to explain the flow for my colleagues, I added some comments to the nodes. Unfortunately it looks like comments are deleted when you refresh ports on a macro. Would be great if you could have a look into that. Thanks!

    Edit: Another question: is there a way to get a dropdown of backboard variables for value input ports on macros?
     
  26. A-Zhdanov

    A-Zhdanov

    Joined:
    Sep 26, 2015
    Posts:
    3
    Hi!
    Does FlowCanvas had some tools for replace references to variables in flow script from one blackboard to another? For example: i have blackboard with name GameValues with variable "duration" which referenced in N flow scripts, but after refactoring i moved "duration" variable to new blackboard GlobalAnimationsValues and now i should manually fix those references?
     
  27. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hey,

    If you absolutely don't want to use a Blackboard, there is a small feature that allows you to Write and Read temporary parameters (variables) within a single flow signal, with the nodes "Read/Write Flow Parameter". By saying "within a flow signal", that means that these variables live only for as long as the Flow signal lives (because they are part of that signal), and every Flow signal can have it's own set of such variables/parameters. Here is a usage example.
    ReadWriteFlowParameter.png

    Events, at least right now, only support 1 argument, but you could create a simple data struct/class with the data desired, and use that type of struct/class as the argument. If you need more help with this, just let me know!

    Can you please clarify your last question? Or is this relevant to the previous two? :)
    Let me know.
    Thanks!

    Hey,

    Welcome back! :)
    The comments on a Macro node are retrieved from the description that the Macro has automatically. As such, a Macro node is basically always displaying the description of the Macro. You can of course select the Macro asset in your project and in the unity normal inspector, write a description for the Macro. That will then in turn display as comments for the Macro node.
    Now that I am thinking of this more though, it's not really a good idea to do it this way :)
    I will change it in the next version, but you can also quickly change it right now, by simply opening up MacroNodeWrapper.cs and delete the "description" property that it is overriding.

    I have previously thought of giving the ability to directly select a blackboard variable for port values, but it's not possible right now, similar to how value ports works for all nodes. You can of course however, drag and drop the blackboard variable in the canvas to create a variable node and connect it to the port as always.
    I will certainly rethink the ability of allowing direct blackboard variable selection for value ports, thus to avoid the extra node required, which is always a good think :)

    Thanks!

    Hello!
    Generally speaking, if the name of the variable as well as it's type remains the same between the two blackboards, then the node will be able to read/write to it without any problems. Are you refering to the "Get/Set Other Of Type" nodes?

    Thanks.
     
    GamerPET likes this.
  28. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    367
    Even that the new thing I just learn about, the Write & Read Flow Parameter fixes some of my problems, I wouldn't mid knowing more about struct/class data stuff.

    Right now I guess I could take the event, Write Flow Parameter of all the variables I need to use, Destroy the prefab since I don't need it anymore and then just Read Flow Parameter.

    By the way, since the new version, I can't see the colors of the variables on the blackboard.


    This is how it used to be In the past. Now I don't see the green & blue for INT & FLOAT variables. There are no colors, so I don't know what type my variable is :((
     
  29. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hey,
    Sorry, I missed your post. Can you please consider using the official forums for support? :)
    Yes, you can certainly use Write Flow Parameters, Destroy and Read Flow Parameters.
    There is no change in the variable colors code in the new version and it should still work the same. It works fine here. Hmm. What version of unity are you using? Can you please post a screenshot of how it looks on your end?
    Thanks.
     
    GamerPET likes this.
  30. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hello everyone. I am very happy to announce the new iteration of FlowCanvas, soon to be released.
    Without further ado, the changes!

    EDITOR GUI
    • New: GUI Icons for nodes, types and ports.
    • New: Robust Graph Minimap.
    • New: Visual Debugging Flow Animations.
    • New: Graph Debug Console Window. Logs Graph related stuff and clicking on the logs, automatically opens up the relevant graph and focuses the relevant node.
    • New: GUI option for Colored Headers. (as shown in the screenshots bellow).
    • New: Assets like Prefabs and Textures, now show preview in the variable node within the editor.
    • New: The Node Browser is now multi-threaded and as such loads up very fast and remains responsive.
    • New: When dragging any value port type, it is now appended to all generic nodes and methods without need to add the type to Preferred Types Editor.
    • New: When dragging any value port type, generic nodes that the dragged type can be used with, are no longer shown within convoluted sub-menus of the type's namespace.
    • New: Node and Variables inspector panels are now re-sizable. Yei!
    • New: Node documentation now show on mouse over as a popup.
    • New: Connections are now clickable directly on the curve.
    • New: Support for Control Copy/Cut/Paste shortcuts.
    • Mod: Reorganized node categories to be more tidy.
    • Fix: A lot of improvement in Editor Performance when zoom out.
    • Fix: Ports floating around sometimes when dragging nodes.
    FUNCTIONALITY
    • New: Further reflection optimizations by using IL for JIT platforms. A big shout thanks to @mf_andreich for his collaboration and work in making reflection in FC work better.
    • New: Reflected Constructor Nodes for all types. (Previously: only for specific types).
    • New: Reflected Extractors Nodes for all Value Types with option to choose what to expose among properties and fields. (Previously: only specific types)
    • New: Support for reflected Generic Methods.
    • New: Reflected methods with params array, now have option to expose params to individual ports.
    • New: Better support for ref and out parameters of reflected methods.
    • New: Wild Definition feature for Nodes and Ports. Automatically change T type, to the type connected.
    • New: Support for any Unity and C# Event Callbacks with any number of arguments and two ways of registration (Auto/Manual).
    • New: Support for Custom Delegate Event registrations. (For advanced users, or those familiar with Blueprints Dispatchers).
    • New: Support for custom type operators (like Equals, Add, Multiply etc).
    MORE FUNCTIONALITY
    • New: Support for multiple targets in all Object based Event Nodes. Allows to use a single Event Node (like for example Trigger Enter), but listen to to any number of objects that invoke that event.
    • New: "Break" Flow Control Node. To be used as an alternative way of breaking out of For Loop and While nodes.
    • New: A handful of new Unity UI-Based Event Nodes.
    • New: Animator Events Node.
    • New: Try/Catch/Finally Flow Control Node.
    • New: Yield Frame, Yield End of Frame, Yield Physics Frame Nodes.
    • New: Finalized support, nodes and GUI for Dictionaries<string, T>.
    • New: All Latent Action nodes (like Wait), now have option to either Queue new calls (like it already was done), or Filter new calls out.
    • New: CustomObjectWrapper<T> node, that allows creating of custom wrapper nodes for any object you drag and drop in the canvas editor.
    • New: Support for default values for nodes and reflected methods.
    • Mod: Better and more consistent intellisense menu when dragging value ports.
    • Fix: Added reflected documentation for Fields that were missing.
    • Fix: Latent Action Nodes now retain the same Flow.
    • Fix: Non-Connected and Non-Default input values from being serialized.
    • Fix: Serializing default node colors.
    • Lot of other fixes, optimizations and conveniences.

    SOME SCREENS & GIFS

    New Debug Flow Animations


    New Graph Minimap


    New Asset Variables Preview


    New Unity & C# Events Support


    New Custom Delegate Callback Event (Advanced Usage)


    New Extractor Nodes


    New Expose Method Params to individual ports option


    New Wild Definition Nodes & Ports


    New Custom Console (Clicking the log, focus relevant node)



    The new version will soon be send to the Asset Store.
    Happy FlowScripting!
     
    Last edited: Nov 10, 2017
    GamerPET and SteveB like this.
  31. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Looks pretty nice. I hope you implemented my suggestions / wishes into this new version ;)
     
  32. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hey,

    Yes, I actually did :)
    Here is an example with Mouse events. The new value output port called "This", refers to the event receiver.
    MultiTargets.gif
     
    GamerPET and SteveB like this.
  33. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    The new version is now submitted and pending review!
    I also managed to squeeze in another new feature I had on the roadmap...

    Custom Functions
    CustomFunction.png

    Custom Functions are similar to how existing Macros work, but instead they are local to the flowScript (like member functions) instead of an external reference like Macros are. Thus they are great for internal flowScript "visual code" re-usability, without the need to create an external Macro every time.
    Custom Functions can have any number of parameters of any type and an optional return value (using the special "Return" node).
    After a Custom Function has been created, it will show up normally in the node browser and also respect intellisense filtering when dragging a port, as all nodes do now.

    Cheers!
     
    GamerPET and SteveB like this.
  34. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Superb ! Great work ! This saves me a lot of time :)
     
    nuverian likes this.
  35. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
  36. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    367
    HMm... I imported the new FlowCanvas into a project where I have a lot of other Unity Assets and my Variables look like this:


    No colors. Remember Nuv that at one point I told you about this, but since then I had no encounters with that project.
    I'm on Unity 2017.2.0f3. The main problem here is that I can't see if my variable is an INT or a FLOAT.

    I also imported this into a new project and I'm seeing the same problem. I also tired this with Unity 2017.1.

    Is this a bug or it's intended?

    P.S. Also... the latest update has been amazing! Thanks Nuv!
     
  37. magg

    magg

    Joined:
    Sep 29, 2013
    Posts:
    67
    Anyone able to ELI5 what's the difference between NodeCanvas and FlowCanvas?

    What each of them does exactly? Compared to each other and compared to PlayMaker?
     
  38. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hey,
    Thanks! I am glad you like the new version.
    This time around the different colors for int and float in the variables is by design. I generally removed most color information from the light Unity theme, since colors in the light theme don't really look nearly as nice as they do in the dark theme. I realize though, that at least for the int/float variables this could be something convenient to have, so I will make an exception for that part of the UI as far as coloring goes in the next version :)

    Hello,

    FlowCanvas is a low-level visual scripting system, which means that you have total control (and thus responsibility) over what you design your flowgraphs to do. With FlowCanvas you can utilize almost any existing functionality that Unity, or 3rd party assets comes with, by basically linking one functionality after the other, and thus creating visual flow scripts. Due to being very open-ended in what it can achieve, it thus requires a better knowledge and understanding of Unity, as well as some basic programming (theory) knowledge, more than NodeCanvas does. FlowCanvas is at heart an event-based system and as such, it is best suited for things that are event based in nature as well, such as level design events, user interfaces or player interactions/input in general to name a few.

    NodeCanvas on the other hand is a collection of three structured systems (FSMs, Behaviour Trees, Dialogue Trees) which allow creating logic and AI based on the principles of those systems respectively. It includes pre-made Tasks (Action/Conditions) and thus does not nearly require the same amount of programming understanding that FlowCanvas optimally does. NodeCanvas is generally speaking best suited for AI (or Dialogues with the Dialogue Tree system) although it can do a lot more things.

    NC and FC are not very different in what they can achieve but they do differ a lot in how those things are achieved. :)

    For your convenience, I'd also like to link you to this nice post in the FlowCanvas forums explaining more of the differences.

    If you still have any questions or need any further clarification, by all means do let me know!
    Thank you.
     
    GamerPET and BackwoodsGaming like this.
  39. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Just have to say, its a really nice workflow with the new features inside FC. Especially my favourite Multiple-Targets in most all event nodes.
     
    nuverian likes this.
  40. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Thanks!
    I am really glad you like the new version improvements and the multi-targeted events feature! (which was your own suggestion in the first place and a good one in that) :)
     
  41. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Check out the awesome game Deadhold, a spiritual successor to the Myth game series, currently in Early Access on Steam and proudly using FlowCanvas.​

     
    SteveB likes this.
  42. Free-Compass

    Free-Compass

    Joined:
    Jul 4, 2012
    Posts:
    12
    Hello, I have imported the new 2.70 version, but no new icons in nodes. I have test in Unity 5.3 and Unity 2017.2 :(
    When I click "Show Icons" in prefs, nothing changed.
     
  43. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hello,

    Are you using the Unity dark theme? Icons (at least right now) are only shown in the dark theme.
    Please let me know.
    Thanks.
     
  44. JimChan88

    JimChan88

    Joined:
    Apr 29, 2014
    Posts:
    2
    Hi,
    It seems "On Variable Change" event lost connections after enter play mode in Unity2017.2(OS X), can you please confirm it?
    upload_2017-12-15_1-3-1.png
    upload_2017-12-15_1-13-28.png
     
  45. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hello,

    I can confirm that there is a bug with the Variable Change Event node. I have attached the fix for you here. Please import the package and let me know if things are working as expected.
    Thank you.
     

    Attached Files:

    GamerPET and JimChan88 like this.
  46. JimChan88

    JimChan88

    Joined:
    Apr 29, 2014
    Posts:
    2
    Yes, it works good, much appreciated!;)
     
  47. sinzer0

    sinzer0

    Joined:
    Aug 29, 2013
    Posts:
    168
    Hello,

    An issue I have run into is even though I added GraphOwner to the types list I cannot make variables / macro inputs of the type GraphOwner

    The issue I am trying to work around is SendEvent errors out if a gameobject doesnt have a graphowner so I need to check if it does and I cannot do GetComponent<T> of type GraphOwner etc. I workaround this right now by promotting the SendEvent target input to a linked variable and then I can Set and check if variable IsValid.

    I feel I must be doing something wrong or missing something obvious since these nodes work with GraphOwners but I cannot check for the existence of a GraphOwner on a GameObject properly.
     
    Last edited: Jan 23, 2018
  48. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hello,
    Thanks for the report. This is an easy to fix small bug introduced in later versions. To fix this, please open up UserTypePrefs.cs file and change line #159 (in method SetPreferredTypesList), to be like this:
    Code (CSharp):
    1.             .Where(t => !functionalTypesBlacklist.Contains(t) /*&& !t.IsInterface && !t.IsAbstract*/ )
    (The change is commenting or deleting the IsInterface, as well as the IsAbstract checks out)

    Thanks!
     
    sinzer0 likes this.
  49. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    790
    Hello,
    I was using node canvas in a freelancing project I was hired for in the past and I found it really responsive.
    Compared to solutions like Bolt and PlayMaker, node canvas did not slow down entering play mode at all (at least not noticably). I found that pretty cool.

    Now I need a visual scripting tool in my own project to expose a lot of functionality other team members (artists, designers, people who can't write code). And also to have a visual editor for dialogs.
    If I remember correctly node canvas had some feature to create dialog trees pretty easily, so node canvas and flow canvas together would probably be a perfect fit.

    I do however have a few questions about both products though:

    - Is flow canvas just as "lightweight" / performant as node canvas? We need something that doesn't bog down the editor like other visual scripting tools. Will adding flow canvas make a big difference? (I assume that fc will be just as fast, just wanting to make sure!)

    - I am not all that familiar with the dialog editor feature. Can it be extended easily with custom "say" nodes (basically a custom c# action)? We only have need for displaying text + presenting choices and wiring them up in a nice visual way. No need for avatar images, voice clips, "letter printing effect", we want to handle those things on our own. Is it possible to remove that somehow (inheriting from some base class or something)?

    - Can I easily create nodes in flow canvas as well? IIRC it wasn't all that hard in node canvas. But do the same concepts apply for flow canvas? Is there a tutorial or guide or something that explains how to write a very simple node? Or better yet is the code for the built in flow-canvas-nodes included?

    - Is there a way to limit the displayed actions/categories when adding an action? Or maybe add my own category for my nodes.

    - Is "vec3 * 5" (scaling a vector) possible in flowcanvas? Or does the multiply node only support component-wise multiplication?

    - How much runtime allocations / boxing can we expect? Does everything make use of iterators (they allocate every frame afaik) and boxing?

    - When instantiating multiple objects that use the same nodecanvas/flowcanvas graph, will the graph itself be shared or will there be a huge allocation for every instantiation? Huge allocations when instantiating are not even a big problem for us, but continuous allocations per frame are!

    - Can variables easily be shared? For example a float or List<> declared in a node-canvas, can that be used in a flow-canvas easily?

    - Is there a easy way to access all variables (type, name, value) in a canvas in a performant way (that is every per-frame) to lets say serialize them and send them over the network myself? Or are they maybe serialized somehow, or hard to access (in some kind of tree, or maybe they only exist on the stack even, ...)

    Thanks!
     
  50. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hello,

    Thank you for your positive feedback on NodeCanvas. I am glad to hear that you've found it responsive and useful for the project you were working with :)

    Regarding creating Dialogue Trees visually, NodeCanvas indeed has a complete Dialogue Tree system/module included, so at least for dialogue trees, I think that NC would be a great fit for that.

    Please let me address your questions:

    ● Yes, FlowCanvas is built on the same framework that NodeCanvas is, and as such performance (both in editor and in runtime), is as "lightweight" or fast as is in NodeCanvas. ;)

    ● The Dialogue Tree system in NodeCanvas, is already possible to be used pretty much as you describe (display dialogue text and multiple choice options, plus a lot other things of course). You could definitely create custom "Say" actions, but I don't think that would be necessary, since the "printing" effect that comes by default for example, is not a product of the "say" action, but rather a product of the example GUI code that is included. As such, simply by altering the example GUI code as well as the example GUI itself, you will be able to remove both printing effect, as well as avatars or audio playing and generally customize the GUI to fit you project, without the need to alter the "say" action itself at all.

    ● Yes, you can definitely create custom nodes in FlowCanvas (and I encourage you to). The API for creating FC nodes, is not similar to NodeCanvas, but is certainly easy as well. The online documentation describes how such nodes can be made:
    1) Creating Simplex Nodes
    2) Creating Full Nodes

    Furthermore, all nodes included in FlowCanvas by default are provided in full source code (as all the rest of the code is of course) so you can check out how all nodes have been created code-wise.

    ● You can add custom nodes in your own categories using the [Category("MyCategory"] attribute above your custom node type. Unfortunately, "limiting" what nodes are displayed to be chosen in the node browser is not possible though, but rather all nodes found in the project will be displayed by default, since all nodes (included ones + your own custom ones) are treated the same way.

    ● Yes, override operators are supported, thus multiplying Vector3 * Float is possible. You just need to use the corresponding node that is able to do that multiplication :)
    Vector3FloatMlt.png

    ● There has been a huge amount of effort put into FlowCanvas to avoid boxing, which is the epitome of allocations. This is why nodes have been implemented to work in such a way as to work exactly with the type they are supposed to work, rather than just "object" type disguised as another type in the UI, and which is achieved by a heavy use of generic types in the system.
    As such, there are very few occasions where boxing will take place. Specifically boxing will only take place when:
    1) You are using macros and when feeding the macro a value type parameter or reading a value type output from a macro.
    2) When you are connecting different (assignable) value types together in which case the "Automatic Converter" will kick in.

    In all other cases there should be no execution boxing and no allocations (and if there is, then it's something I should fix).

    ● When using shared graphs between multiple different objects, a separate graph is instantiated to be used with each object. As such and as all instantiations, the graph will need to be deserialized, which yes, it will create allocations in that frame when the object is instantiated, but certainly not every frame afterwards, based on my previous answer :)

    ● Both NodeCanvas and FlowCanvas, use exactly the same way to store/read/write variables, which is through the "Blackboard" component. Variables in both NC and FC are object centric rather than graph centric.
    Any graph type (NC Behaviour Tree or FC FlowScript) for example attached on the same gameobject where a Blackboard is attached, will share the same Blackboard variables automatically.
    Setting or Getting Blackboard variables across different gameobjects is also possible with certain nodes in FC, or respectively certain Actions in NC. Specifically those being the "Get Other Blackboard Variable" and "Set Other Blackboard Variable", where "other" denotes, "Some other gameobject. Not the one I am currently attached to".

    ● Yes. Since variables are stored in the "Blackboard" component as explained above, variables are super easy to access through code as well, or even modify (add/remove/get/set) simply by having a reference to that Blackboard component.

    Now within that Blackboard component, the variables are serialized within a typical 'Dictionary<string, Variable>' and thus accessing them all per-frame is as fast as calling "blackboard.variables.Values".

    More specifically to your question about serializing and sending over the network, there are also a few small "features" that might help in that.
    1) There already exist a "Serialize" and "Deserialize" method in Blackboard type, which will serialize/deserialize the blackboard along with it's variables into/from json if it's something you want to use.
    2) Variables have an "onValueChanged" event which you can subscribe to, and as such you could utilize that event, to only send changes over the network when they happen instead of doing so every-frame.

    -

    That's it :)
    I hope I answered your question in a helpful way, but if you have any further questions or need any elaboration on the previous ones, just let me know.

    Thanks!
     
    Last edited: Feb 1, 2018
unityunity