Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    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. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    Hello and thanks a lot for getting both products !
    I am really glad you like them both :)

    There is the ability to have a nested FlowScript within an NC FSM yes. There is a small .unitypackage within "FlowCanvas/Integrations" folder, which includes the Nested FlowScript State script. Once you unpack it, you will be able to add a FlowScript State in an FSM through the usual right click context menu. Is that what you mean?

    Let me know.
    Thanks again!
     
  2. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Yep, thats what i meant. Now i get it work ! Thx very much. It doesn´t work in the "Behaviour Trees" mode. Because its not implemented yet, or does it not make sense....?
     
  3. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    Hey,
    Sorry for the late reply.

    Using nested FlowScripts within NC Behaviour Trees is not implemented yet. To be honest it makes more sense in the context of an FSM, but I will add the ability to be used in NC BTs as well :)

    Cheers!
     
  4. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Ah ok. Glad to hear that :) . A really wonderfull progess & i am so happy that i purchased it !
     
    Last edited: Jul 14, 2015
  5. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104
    That's great, I like the integration between all of your products, it makes using them really smooth.
     
  6. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    Thanks! :)
     
  7. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi,

    this is next great asset to "Canvas" collection.

    I working with FlowCanvas only few hours and because my primary input asset is EasyTouch I want write my own new event node. Partly works, but for correct flow I need remove delegates when app is closed. For assign delegates on graph start i have used OnGraphStarted() and for remove I use OnGraphStoped(), but looks like this last one method is not called.

    or in another words, which one method is equivalent to:

    OnEnable
    OnDisable
    OnDestroy

    in graph node?

    P.S: Finaly I have very complex assets for visual development only. Great job.
     
  8. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Helou,

    after few days with FlowCanvas I prepare simple game example v1.2 , for all. Maybe isn't perfect but works.

    Note: Because I can't find node for instantiate prefab, I have used small monobehaviour script for this action "ClonePrefab" attached to player gameObject. Fixed

    Example v 1.2:
    • enemy prefab now use GameObject.FindWithTag() to find player for send event to update score (it's more secure when gameObject is prefab ;) )
    • clone prefab workaround was changed to Object.Instantiate node.




     
    Last edited: Jul 24, 2015
    nuverian likes this.
  9. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Range check macro example.

    Macro:

    Example where is graph flow controled by result:

     
    SteveB and nuverian like this.
  10. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    @AndyGFX
    Hey. Thats super great of you to share with everyone! Thanks a lot! This can be very usefull for others.
    May I add it in the first post of this thread? :)

    Instantiate can be done with the static "Functions/Reflected/Object/Instantiate", which also returns the instance.
    Regarding your first question there a small issue with OnGraphStopped right now. Please hang on for the next version which will fix this and make it easy to use node OnEnable/OnDisable/OnDestroy.

    Thanks again! Good Job.

    I will take a look at the different parts of your setup and see where FC could be improved in this regard (amongst everything else I already have in mind). If you encountered any shortcommings please let me know.
     
    Last edited: Jul 24, 2015
  11. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi,
    Isn't problem ;)
     
  12. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Macro issue - strange behaviour.

    Here is simle macro for check tag of gameObject:



    Implementation looks like:


    but when is executed, then I get this error:

    NullReferenceException: Tag: tag name is null.
    UnityEngine.GameObject.FindWithTag (System.String tag) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineGameObjectBindings.gen.cs:320)
    FlowCanvas.Nodes.ReflectedFunctionNode`2[System.String,UnityEngine.GameObject].Call (System.String a) (at Assets/Unity-Asset-Plugins/FlowCanvas/Module/Nodes/Reflection/ReflectedMethodNode.cs:241)
    FlowCanvas.Nodes.ReflectedFunctionNode`2+<RegisterPorts>c__AnonStorey86[System.String,UnityEngine.GameObject].<>m__11C (Flow f) (at Assets/Unity-Asset-Plugins/FlowCanvas/Module/Nodes/Reflection/ReflectedMethodNode.cs:247)
    FlowCanvas.FlowOutput.Call (Flow f) (at Assets/Unity-Asset-Plugins/FlowCanvas/Module/Ports.cs:103)
    FlowCanvas.Nodes.ConstructionEvent.EnableCall () (at Assets/Unity-Asset-Plugins/FlowCanvas/Module/Nodes/Events/GraphEvents/ConstructionEvent.cs:18)
    FlowCanvas.FlowGraph.OnGraphStarted () (at Assets/Unity-Asset-Plugins/FlowCanvas/Module/FlowGraph.cs:32)
    NodeCanvas.Framework.Graph.StartGraph (UnityEngine.Component agent, IBlackboard blackboard, System.Action callback) (at Assets/Unity-Asset-Plugins/FlowCanvas/Framework/Runtime/Graphs/Graph.cs:461)
    NodeCanvas.Framework.GraphOwner`1[T].StartBehaviour () (at Assets/Unity-Asset-Plugins/FlowCanvas/Framework/Runtime/Graphs/GraphOwner.cs:299)
    NodeCanvas.Framework.GraphOwner.Start () (at Assets/Unity-Asset-Plugins/FlowCanvas/Framework/Runtime/Graphs/GraphOwner.cs:151)


    and FlowCanvas window with flow has removed port/value connections, when is executed:

    Note: Used flowGraph is asset reference assigned on prefab.



    Example project

    Issue #2
    - when I return previous solution (without macro), same error message is showed, but tag value is correct and isn't null (in run-time mode too).

    #2 FIXED:
    - problem was on other flowNode. From this point of view, I think that change node color to red with error, will be very good option to the future. ;)
     
    Last edited: Jul 25, 2015
  13. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    @AndyGFX
    Sorry for late reply :)

    You have a node "GameObject.FindWithTag" at the bottom of the main flowScript and it's input Tag port is not defined which results in being null.. The Unity's FindWithTag method throws an error if the tag string is null or empty.

    Now of course, this should NOT remove the connections from the Macro. This problem has been reported once before (Macro connections lost) and I am really searching through to fix this. It's a difficult bug cause I can't find a case where it always happens. Regardles, I have to find and fix this soon :)

    Yes. Changing the color of the node to red to show the source of the error is a nice suggestions. I will take a look implementing this for the next version amongst with the rest.

    Thanks!
     
  14. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi, thanks for reply.

    I found a few bugs:
    • Rename group window - missing typo cursor
    • Macro - created macros are not showed in list of popup window properly ( sometime a few missing, sometime all)
    • Created macro from project window hasn't correct name when is asset renamed manuualy later in project window ( still with default name >FlowMacro<) but popup window under MACRO has correct macro name and in NC editor not.
    • When is edited ports in macro on IN node and then is edited name of any port in OUT node, then is inspector window closed self after first char typo
    • multiple selection with CTRL doesn't work
    • drag game object to FlowScript with selected Action on component from Insperctor is without error msg, but when is drag same gameObject from Hierarchy window, shows:
      • InvalidOperationException: Operation is not valid due to the current state of the object
        System.Linq.Enumerable.First[Port] (IEnumerable`1 source)
        FlowCanvas.FlowNode.GetFirstInputOfType (System.Type type) (at Assets/Unity-Asset-Plugins/FlowCanvas/Module/FlowNode.cs:118)
        FlowCanvas.Nodes.ReflectedMethodNodeWrapper.SetMethod (System.Reflection.MethodInfo method, System.Object instance) (at Assets/Unity-Asset-Plugins/FlowCanvas/Module/Nodes/Reflection/ReflectedMethodNodeWrapper.cs:58)
        FlowCanvas.FlowGraph+<OnDropAccepted>c__AnonStorey75.<>m__C6 (System.Object m) (at Assets/Unity-Asset-Plugins/FlowCanvas/Module/FlowGraph.cs:168)
        UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/artifacts/generated/common/editor/GenericMenuBindings.gen.cs:120)
      • looks like creating nodes from 'Inspector via component on selected gameObject in scene' works more secure. Drag gameObject from 'Hierarchy' to FlowScript window is little bit stange.
      • I see one diff., when is created action node from object from hierarchy window, he is marked as 'Self' (from my point of view, is null, not self), but when is created from Inspector, is marked with gameObject name where is component assigned, which is correct too.

    and few questions:
    • how can I share variables from 'Blackboard' between flowGraphs
    • is possible add root name gameObject in node, which was created via drag&drop from hierarchy/inspector window to FlowScript, instead self or combined to value port or to node name?
      • Is not clean now, when in flowGraph exist a lot of same actions from different gameObjects which one node in graf coresponding with scene object, this is clean only in run-time where is 'self' changed to inherited class name.
     
    Last edited: Jul 26, 2015
  15. nuverian

    nuverian

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

    Thanks for the reports :)

    To answer these in order:

    • I'll take a look at displaying the text cursor when renaming groups.
    • The Macro's not showing is now fixes. All project Macros will now be listed in the menu.
    • The name of the Macro is not read from the asset file name. You can set the name from the inspector of the Macro instead, where you can also add a description if you like.
    • Renaming the Macro ports is now completely fixed! Connections will not be lost due to renaming at all.
    • CTRL + Click for multiselection works for me here. Hmm. Are you on a mac maybe?
    • Dragging a gameobject and selecting an Action or Function is now also fixed. There are no more errors and the port is correctly assigned the dragged component object instead of "self" (which was done due to the error), thus it now works correctly, similar to how dragging a component does :)

    • For now sharing variables can be done through "Global Scene Blackboards", but right now, those variables do not show in the context right click menu. Instead you have to add a "Graph Variable" first and then link it to the Global Blackboard Variable. To add a Global Scene Blackboard, you can do so in "Window/NodeCanvas/Create/Global Blackboard".
      I will have to improve the workflow regarding sharing variables as well as add Global Blackboard variable names to the context menu, similar to how the local ones are now. :)
    • Can you please rephrase your last question? Is it relevant to the issue when drag and drop from hierarchy, or are you suggesting that instead of reading "self", to actually read the name of the self object?

    Cheers!
     
  16. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi,

    thanks for response.

    Last Q was about situation when in scene exists gameObjects with same Component XYZ.Action_N, when this components are added to FlowGraph (on other gameObject) with Action XYZ, then all flow nodes are showed with Action_N name only and from flowGraph isn't clean, which one action node is inherited from scene/hierarchy object, because he has same visual representation. User can have illusion, that added Action is from gameObject. Technicaly is created only action and user have to set object again manualy in FlowScript inspector.



    all this nodes are added to FlowScript on another one gameObject.
     
  17. nuverian

    nuverian

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

    I see. If I'm not mistaken, this is related to the issue we've discussed earlier, that has now been fixed.
    Dragging an object from hierarchy and selecting an action from the context menu, will now correctly assign and read the game object name instead of Self (null).
    So your left nodes would correctly read Cube, Sphere and Cylinder even if dragged from the hierarchy. It was a bug and is now fixed. I suppose you are refering to this thing?

    Furthermore, I went ahead and improved the visual readability a bit.

    ColorCoding.png
    Unity Object type port references are now far more visible so that they can be easily seen apart from the rest of port value types.
    Furthermore non set port default values (0, false, null etc) will now also display very transparent instead of not visible at all.

    If you want I can send you the new version now. Just send me a PM with your email :)

    Cheers!
     
  18. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi,

    thanks, very good news, when do you have a plan to release next version?

    Andy.
     
  19. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    I'm glad you like.
    I will release the next version within next 2 days :)
     
  20. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Hi, I use Nested FlowScript Node in my FSM. When I set some reference in FlowScript Node, for example UI Button, to certain game object in the hierarchy (like a Button). It run okay at first, but if I quit Unity, and reopen, all references are lost.

    I think it is because Nested FlowScript is saved as .asset. But having everything in Blackboard is troublesome?
     
    Last edited: Jul 26, 2015
  21. nuverian

    nuverian

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

    A nested FlowScript in an FSM (or even a nested FSM) is an Asset Reference (not "Bound") and is not saved in the scene. As such, an asset file can't have scene object references. Thats a common Unity thing.
    The way to work around this is to use Blackboard variables, since the Blackboard is a component on the FSMOwner which IS in the scene and thus can have scene object references (unless of course it's a prefab).
    Once again, this is a common Unity thing.

    On a sidenote, I am taking a look for the ability to also be able to Bind nested graphs to the GraphOwner instead of only the "master" one, so that the workflow becomes easier. It's not that easy to implement, but it's getting there :)

    Thanks!
     
  22. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    UI Button Node doesn't work with Blackboard though, as there is no value port. So it can't be used with Nested FlowScript in FSM.

    Edit: Very well, I use Check Event condition in FSM instead of FlowScript's UI Button for the mean while. It increase a few more states, but still work fine. Hope you implement the same Nested FlowScript on GraphOwner as an option though. :)
     
    Last edited: Jul 26, 2015
  23. nuverian

    nuverian

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

    Indeed, right now the Event nodes can not be parametrized with Blackboard variables. I can certainly add this feature in the next immediate version though. Will indeed be useful and avoid nasty workarounds :)
    If you are refering to implementing the ability to Bind nested graphs, yeah I am looking towards it. If you ment something else, let me know :)

    Cheers!
     
  24. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Hi, is there a way for a nested FlowScript in FSM graph to receive an event? As it's a nested node, there is no FlowScript Controller to send an event to. I can only send an event to the FSM graph.
     
  25. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi,

    here is illustrative presentation of door entity, created with FC/BT/FSM nodes.

    Rulles:
    1) only empty door are closed
    2) only first enter event open door
    3) last outgoing object close door

    FlowScript (FC):
    Note: FC currently havent iTween inplementation, Translate method was used instead


    BehaviourTree (NC2):



    FiniteStateMachine (NC2):

     
    nuverian likes this.
  26. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    Hey,
    Events are actualy send to the GraphOwner rather than a specific graph it runs. So, sending an event to the FSMOwner, will correctly work and be "catched" by any nested FSM or FlowScript that the FSMOwner runs.
    So, in other words, all you need to do is send an event to the FSMOwner as normal :)

    Let me know if this works for you.

    Hey,

    Thats a nice kind of comparison. Thanks for sharing this! :)

    As far as the FlowScript goes, I think the implementation could be easier though, using Flip Flop node.

    Furthermore in the new version (the one I've send you too), the SetVariable node now has an extra functionality for Adding, Subtracting, etc the target variable with the value, instead of only Setting it, which removes the need to first Get the variable, do the math operation and then Set it.

    SetVariable.png

    Thanks and Cheers!
     
  27. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    How to implement this code using FlowScript?
    Code (CSharp):
    1. foreach(Race race in RaceDatabase)
    2. {
    3.      Dropdown.OptionData newOption = new Dropdown.OptionData();
    4.      newOption.text = race.name;
    5.      dropDown.options.Add(newOption);
    6. }
    The problem is "new Dropdown.OptionData()", if using a Variable node, will have the same instance in every iteration in FlowScript. Custom node is the only option?

    Edit: Nevermind, I've created a custom constructor node, and it is working well.

    Code (CSharp):
    1. [Category("Utilities/Constructors")]
    2.     public class NewOptionData : PureFunctionNode<Dropdown.OptionData, string, Sprite>
    3.     {
    4.         public override Dropdown.OptionData Invoke(string text, Sprite image)
    5.         {
    6.             return new Dropdown.OptionData(text, image);
    7.         }
    8.     }
     
    Last edited: Jul 28, 2015
  28. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Any plan to make a local variable node that is referencable and assignable? You can link value to a local variable node, and can use a "get" node to get the value within that variable anywhere in the same graph in the same way as blackboard variables, but just in the graph like a graph variable. It will reduce clustering in the blackboard and reduce spaghetti-ness of the graph. And it will be useful in Macro and Nested FlowScript as well.

    And about the previous suggestion to make Nested FlowScript bound to the FSM graph, may be the easier way is to make Input/Output nodes for the nested FlowScript like we able to do in Macro. We can assign the value/reference in the FSM node inspector panel like in the real coding. This way the value/reference can be saved on the Bound FSM graph, and the Nested FlowScript can stay .asset.

    Another suggestion is to make Preferred Type List exportable, or can be saved as presets.
     
  29. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    509
    I just crawled threw the whole thread and i have to admit that i really like what i see here :)

    I kinda dont really like the node based approach. Iam currently using blox and prefer the "blockly" way of visual scripting since its feels to me like reading and writing code. But maybe you could tell me what advantage node based visualscripting has? Or why you choosed this approach?

    i somehow want to switch to another visual scripting solution since blox/plygame is somehow a dead end to me. since everytime you suggest some improvements you end up with "no, its feature complete". But the usability of blox1 is awful. Do you have any advise for " switchers"?

    Also one last comment, i really like. No.. I love.. Is the clean style of your tool. I cant say where the differences between playmaker, uscipt etc is but at least i see it at first sight :)
     
  30. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Playmaker is a state machine editor.
     
    nuverian likes this.
  31. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    Indeed, sometimes you will have to find the balance between custom coded nodes and visual script.
    I really think that making new nodes for most things, is super easy too :)

    Hm. That's really what the blackboard is there for, although I can possibly understand that the reason you don't want to use it for such type of variables, would be that it's also exposed to the gameobject inspector?
    I'd realy like to avoid introducing a 3rd type of variable visualy speaking. Maybe what you are after, could be done by having private local graph blackboard (on top of the agent blackboard) and tabs to switch between them on the top right where variables show. It will need some more thought though :)

    I like your suggestion about input/output in flowgraphs somehow. This might work well for this.

    Last but not least, I went ahead and implemented export/import for the preferred types list just now, like you suggested :)

    Cheers!

    Thanks. I'm glad you like what you see :)

    It really is a matter of preferrence (nodes vs blocks). Personaly, I was heavily inspired after looking at unreal blueprints and wanted to have something like it in Unity since I use Unity. On top of that I am a Softimage XSI user and been using it's ICE node based system for some time now, and finaly, I already had a core node framework created for my other asset(NodeCanvas). So there are my 3 big pluses for creating FlowCanvas :), with the most weight given to the first reason, Unreal blueprints.

    The thing with node based approached (vs other ways like blocks) is that in my opinion is far more flexible to extend and implement new ideas and create nodes that go beyond the usual programming ifs, elses, whiles, switches etc, even though they can be a bit "messy" connection wise, if they are not organized or used correctly.

    The only "real" advice I can give when using ANY visual scripting tool, is that even a very basic actual scripting knowledge will tremendoulsy help and improve your workflow with that tool ;)

    I'm not sure if I really answered you questions, but let me know if I didn't.
    Thanks again.
     
  32. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    It would reduce the clustering and spaghetti-ness within sub-graph without interfering with the main graph's Blackboard, and I think it would be a good encapsulation practice IMHO. I think private local blackboard will be a good way to do this. It will mirror the actual coding standard of global and local variable well. Actually you don't need 3 types of variables, the old Graph Variable will be obsolete, and this is just and expanded upon the Graph Variable features.

    This is Just a suggestion though.

    FlowCanvas is already great as it is. I think you accomplish much considering you developing this alone for a year. It is already rivaled Blueprint IMO.
     
    Last edited: Jul 28, 2015
  33. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    Thanks a lot for your last comment! I really appreciate it.
    There still lots to do I think. hehe :)

    Regarding the feature, yeah. I will take a look at private local blackboard and how would they work especialy on the visual representation side of things, so to be convenient. Will do so after I commit the current version I've been working.
    I think it will well worth the effort to implement this nicely :)

    Thanks!
     
  34. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi,

    here is example how we can share variables between scenes.

    StaticContainer class example:

    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3.  
    4. namespace CubesTeam
    5. {
    6.     public class StaticContainer : MonoBehaviour
    7.     {
    8.         private static int _int = 0;
    9.         private static float _float = 0f;
    10.         private static string _string = "";
    11.  
    12.         public int IntVar
    13.         {
    14.             get { return _int; }
    15.             set { _int = value; }
    16.         }
    17.  
    18.         public float FloatVar
    19.         {
    20.             get { return _float; }
    21.             set { _float = value; }
    22.         }
    23.  
    24.         public string StringVar
    25.         {
    26.             get { return _string; }
    27.             set { _string = value; }
    28.         }
    29.     }
    30. }
    Scene #1 (write values):

    on any gameObject attach StaticContainer script and in FlowGraph bind properties


    Scene #2 (read values)

     
    nuverian likes this.
  35. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    I just suggest an idea, you probably find a better way to do this lol.

    Another way is a work around by just allow create Tabs for better organizing of the Blackboard. It will not be real encapsulation, but can simulate one. And create Tabs can be done using a FlowCanvas node or a NodeCanvas node. For me, I prefer encapsulation though. Whether you do the private local tabs, or just allow certain of tabs without being private local ones, it will just an added feature of the Blackboard, no interfering with .asset, correct?
     
  36. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    I never know that static variables can survive the scene lol. I always serialize to a file or use PlayerPref.
     
  37. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    @AndyGFX Thats a nice use of Variable Binding. Once again thanks for sharing :)

    @sanpats Yeah, it will either be different blackboard/tabs, OR ability to bind nested graph to owner. I think one of them will suffice for the task :)
     
  38. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    @sanpats:

    Yes, this feature is common in all languages. I like it, because save me codding time and all what I need todo when player close app is, serialize&save, once on start, once at close or always when you need.

    Andy
     
  39. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Input/Output nodes Macro style for the nested graph is a must IMHO. Even more than the above.
     
  40. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Got this error whenever I put a Macro node with added port(s) (other than the default In/Out) on a Nested FlowScript (this error only shows when first open Unity, or changing to that Scene):

    If I put the same Macro node in more than 1 FSM Nested FlowScript States, the connections other than the default In/Out on some state will be lost when click "Play". This is 100% reproducible. I have tested on both my project, and a new clean project. The more nested states, the more chance the connections will be lost. And the state that lost connection will be the same one until the Scene is reinitialized/deserialized.

    Edit 1: After more tested, such error message also happen on the normal FlowGraph that is not nested FlowScript.

    Edit 2: I see that this bug was report before (Macro connection lost). Did you be able to fix it? Can you send me the new version if you already fix it? I will send email through PM.
     
    Last edited: Jul 29, 2015
  41. nuverian

    nuverian

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

    Yes. These errors have been fixed now :)
    I've just send you the new version.

    Cheers!
     
  42. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Thanks! Now I can continue develop GUI system for my RPG using your frameworks.
     
  43. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    Glad to hear that :)
    If you encounter any issue, please let me know
     
  44. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Hey @nuverian,

    Still got an error message when first start Unity or changing Scene, but the good thing is the connections no longer disappear.

     
  45. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    I look into your code. It seems in the Constructor of Macro class, you call GetOutputPort which call AddNode, and the AddNode call Create which have these lines

    Code (CSharp):
    1. #if UNITY_EDITOR
    2.             if (!Application.isPlaying){
    3.                 UnityEditor.Undo.RecordObject(targetGraph, "Create Node");
    4.             }
    5. #endif
    Application.isPlaying can't be called in a constructor, but it just Undo recording, so not serious.
     
  46. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    @sanpats Thanks. I will take a look at this. The weird fact is that I don't get the error when open/close unity :)
     
  47. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    The error only happen if the beginning scene have atleast one Macro node.
     
    Last edited: Jul 29, 2015
    nuverian likes this.
  48. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,061
    Fixed :)
     
  49. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Nice work! Looking forward to the next release. Can I test the fixed version for you?
     
  50. nuverian

    nuverian

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

    Sorry for late reply.
    I've just send you the package :)

    Cheers!
     
unityunity