Search Unity

NodeCanvas - (Behaviour Trees | State Machines | Dialogue Trees)

Discussion in 'Assets and Asset Store' started by nuverian, Feb 8, 2014.

  1. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hi @nuverian I'm testing the new 5.4 beta 10 and I get error messages like this one:



    Is that something that would be fixed if I upgraded to the latest NodeCanvas version? Or do you still have to address it?

    Update 1:
    Well I just updated to the latest NC version and the errors are still there. The game refuses to build as a result...

    Update 2:
    For now I have commented the 2 lines in Graph.cs and Blackboard.cs that say:
    Code (csharp):
    1. if (Application.isPlaying) return;
    Update 3:
    Mmh it looks like that's not the solution. I don't know if it's specifically related to those errors but I can confirm NC doesn't work anymore in 5.4b10. I really hope you're going to be able to address the issue! :eek:
     
    Last edited: Mar 16, 2016
  2. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    The way that behaviour trees and NodeCanvas can help you is by organizing your character behaviours and your existing functions into small visual modular blocks (nodes) and as a result making it easier for you to create different behaviours, modify existing ones, or experiment with new ones. So, it's like having a pallete of functions where you can design how these functions work together, without hardcoding or dependencies, but rather on a higher level. It's really not a question about if the same thing can be achieved in code only. Of course it can if you are up for the task, but the purpose of NodeCanvas is about achieving that in a flexible and visual workflow :)

    The Lite version may suffice for your needs depending on the complexity of the behaviours you are after if you are ok with creating custom nodes, while the full version gives more advanced features like the ability to use your existing functions through reflection, without the need to create custom nodes. You can of course start with the lite version and if required upgrade to the full version any time.

    You can code your own behaviour trees of course, but the point of any asset on the store is that it saves you from doing so yourself :)

    Let me know if you need any clarification or have any other questions.
    Thanks.

    Thanks as well. I've added the suggested feature in the TODO list :)
    Cheers!

    Hey,
    Are you certain that you are using the latest version of NC? Because these lines of code no longer exist in NC after version 2.4.4. I have just tested NC 2.4.5 on Unity 5.4.0b10 and works fine apart from 1 warning that will be fixed. Can you provide more info on what does not work in your case?
    Thanks
     
  3. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Well THAT is stupefying! I just, for the third time, wiped and re-installed NodeCanvas and I still got the same errors...

    BUT when I looked at the lines in question the isPlaying call was NOT there! But Unity was still complaining about them! So I saved the project + scene, quit Unity, relaunched it again and this time it "stuck"; the errors are gone!

    I'm sorry for the false alarm; if you can't trust Unity errors anymore, what has the world come to! :)

    I'll let you know if I see anything else but I'm definitely having a very hard time with 5.4b10. There's still a long way before it reaches a stable status.
     
  4. Smolli

    Smolli

    Joined:
    Mar 12, 2014
    Posts:
    84
    Hi, ok, I'm a bit frustrated as my first try with DT and FSM were unsuccessful. I tried in vain to call the DT from the example scene from a new created FSM. I think I tried every possible way, but nope. I would very much appreciate it if anybody would show me how to do it. ;( And yes, of course I read the manual and no, I didn't drag&drop the GameObject. I d&d the component (at least that is the only other thing I cold drag onto the node).

    Another question, if I had a massive bunches of short dialogues, that I would need to call based on some conditions, what would be the best way to organize this?

    Thanks!
     
  5. Smolli

    Smolli

    Joined:
    Mar 12, 2014
    Posts:
    84
    Arrggghhh, I didn't know I had to add the instigator, too.

    So, leaving the second question left :)
     
  6. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Thanks for letting me know and no worries :)

    Hey,

    So, is your first question solved? :)
    Regarding organizing dialogue trees, if you have a lot of dialogues that are simply some character saying something, then I would personaly just use the "Say" action task instead of creating a whole new dialogue tree just for the shake of some character saying something and I would only use a dialogue tree if there was an actual converstation between multiple characters. Other than that I am not sure exactly what the question is :) Can you please provide a bit more information of the organization you would like to do, so that I may possible provide a better answer?
    Furthermore, I'm working to include a Sub-Dialogue Tree node, which can help in organizing multiple dialogue trees into one, but again, I'm not sure if that is what you mean.

    Please let me know.
    Thanks!
     
  7. Smolli

    Smolli

    Joined:
    Mar 12, 2014
    Posts:
    84
    Yes, took me a while, but it was my first getting wet with NC :)

    Thinking of something like a Chatbot. So, it's more of a dialogue between the Player and the Bot. So, sometimes it's shorter and sometimes longer conversations.
    Sub-Dialogue Tree Nodes could help organize this even better, so yes, this could come in handy.
    But for now I think that your solution with using lots of 'say' commands is pretty good. Now of course I will need a way to organize those BTs or FSMs. Not sure right now, can I create foldable/unfoldable Groups? Don't think so. Use many GameObjects with each a bunch of BTs or FSMs? Macros?
    Not sure if you will be able to respond today, but unfortunately, ok fortunately ;) I will be on a sort skiing-trip, but I may have internet connection. So hopefully I will be able to read your response i n time, since I will be taking my Surface 4 with me :)

    Cheers
     
  8. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello again,
    BTs and FSMs can be organized using subBTs and/or subFSMs. BT composites actualy can be folded/collapsed, yes. It's in the right click context menu of the composite node. You can also have as many Behaviour/FSM Owners on a single game object as well. I would suggest using subBT/FSMs and multiple owners on a single gameobject only if you really need to and helps, so that things don't become unorganized while trying to organize them :)
    Last but not least, if you use BTs, you can use the ActionList task first and then add multiple "Say" actions in that list which can play in sequence, essentialy minimizing the actual required action nodes needed to 1.

    I hope this helps, but if I can help further, by all means do let me know.
    Cheers.
     
  9. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    I went ahead and got it, I feel like you are a developer who deserves the benefit of the doubt just based on your responsiveness alone. Seriously, great job on customer support. 20/10 when I compare it to other asset store developers. (no offense, I really some developers spend alot of time developing VS commenting but sometimes dumb people like me get super confused and wish for help or response, I can only hope in the future I am as respectful as you are when it comes to treating and dealing with my customers. Thank you again, Sir.)
     
  10. Smolli

    Smolli

    Joined:
    Mar 12, 2014
    Posts:
    84
    @nuv, yes that helps a lot, thx.
    I was wondering why you didn't make the groups collapsable, too? Would maybe be great.
    What would be great, too, would offline documentation ;) It seems as if I won't have internet where I'll be going. Any ideas how to have the NC and FC docs offline?
     
  11. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    I can't believe this thing actually generates scripts for me and its human readable O_O
    best 75$
    i mean wow
     
  12. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Thanks a lot for your kind words! I really appreciate that! :)
    As always, if you have any questions, problems or suggestions, just let me know.

    Thanks again!

    Hey,

    Canvas groups are not made collapsible because there are many connections that can potentialy enter or exit a group, so I haven't yet figured out a good way to show this in the UI. I can certainly take another look at it again though and see if I come up with something better than the last time.

    As far as offline documentation, this is now possible. You can download a PDF generated version of the documentation for both NC and FC from the documentation page of the websites :).
    PDFVersion.png

    Cheers!
     
  13. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Um, I have question, when using the Love/Hate NodeCanvas plugin, does the NodeCanvas actions simply work with the "faction manager"
    it says(Love/hate Manual) that "If your scene has any faction members, it should also have a faction manager".
     
  14. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Can you update the DOTween including with NC to the latest version that compatible with Unity 5.4 (https://github.com/Demigiant/dotween) to eliminate the "OnLevelWasLoaded was found on DOTweenComponent" warnings.
     
  15. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    There are tasks that work with FactionManager and other that work with specific FactionMember. The tasks that work with FactionManager, can be left with the FactionManager parameter null. In this case the parameter will be auto assigned the first FactionManager found in the scene (with FindObjectOfType). Can you please clarify what you mean?
    Thanks a lot.

    Hey,
    Yes. I will do that now and send a new update to the asset store today along with any other changes :)
    Thanks.
     
  16. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    LOL, turns out I wasnt using "using PixelCrushers.LoveHate" in my custom classes and was having a hard time understanding why I couldnt call my own custom methods with PixelCrushers methods. I'm trying to make my own NodeCanvas scripts using your examples, now I think I will actually have a decent chance lol......
     
  17. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    If you need any help with creating custom tasks, by all means let me know :)
     
  18. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    I am very glad to see another great looking game Kim, where NodeCanvas has been utilized, is about to be released on Steam! :)

     
  19. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Turns out I didn't need to make my own nodes since this NodeCanvas extension can actually interface directly with my scripts.

    Also, that game looked pretty good. Maybe ill buy it.

    Edit:

    Hmm, how do I use this with Input textfields?

    I cant seem to figure it out. Do you know of a set up guide for them? and how to interact with them using NodeCanvas?
    Im trying to manipulate one textfield. I guess as a singleton to make it easier to manage and find, (or really just a single entity in the scene..) and return a public variable that I can use in other object's blackboards.

    Edit 2: I'm coming to the realization that perhaps I dont even need FlowScripts at all? Even NodeCanvas has the ability to get fields from objects stored inside scripts. And even setting them before hand.

    Also, I keep getting errors that break all my flowscripts, something about "not set to an instance of a object" yet it still works? Well anyway, I rate NodeCanvas 20/10. Flowscripts 6.2/10. I like NodeCanvas a ton, best 75$ i ever spent. Good work. (esepcailly since it can interact directly with my classes and can get and set fields)
     
    Last edited: Mar 24, 2016
  20. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    @nuverian
    here a new happy customer.
    Thanks for your amazing asset!!!
     
  21. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Thanks a lot @mkgm for getting both NC and FC :)
    Let me know if you I can help you in any way. I am glad you like the tools!
    Cheers and thanks again!
     
  22. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    hmmm, I cant seem to figure out how to set up else conditions so my behavior trees stop getting stuck on and if conditional LIST statement...
     
  23. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey!
    Here is and example of how an if pattern works in behaviour trees:
    If.png
    In the above example, if we have the Fire 1 button pressed, the action on the right will execute. As soon as we release Fire 1, the action will cease to execute. This is done because the Sequencer above, is set to be dynamic.

    If you want to use a list of conditions instead of a single one, you can first add the ConditionList condition and then in there, add as many conditions as you like, whithin which you also have the option to set whether all conditions must be true or any of them true for the whole condition list to return true. Here is an example:
    ConditionList.png

    Please let me know if this is what you asked, need any clarification on the bove, or anything else :)
    Thank you.
     
    username132323232 likes this.
  24. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Oh I know that, but. I am trying to design the behavior trees with 3 seperate branches.. I had deleted my work or id be able to show you. Dang.

    Is there no way to make that happen? Do all branches run with the sequencer regardless? (1, 2, 3, 4,)

    Like, can I have it where, I have a conditional node, which tests for stuff BELOW it, and if it hits a false, it can move onto another conditional which tests regardless the things below it, and if false, etc, etc, etc, thats how im designing it right now.

    ill try to post a screenshot... not sure how to post screenshots on this forums.
     
  25. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    I think what you are after is the "Conditional" Decorator node, which checks a condition (or a list of conditions) and if true executes it's child node, otherwise it returns Failure. Thus if put under a Selector node as in the image bellow, the conditional decorator nodes will be checked one after the other, until one of them has a true condition assigned.
    ConditionalDecorator.png

    I hope this helps. Let me know :)
    Cheers!
     
  26. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    yes, I think thats it, thanks alot. Its how I got the UI to work. Although I now need to figure out how to manage instantiated UI prefabs (like when a menu is called) but I can figure it out at a later time. lol. Thanks :D
     
  27. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    nuverian and all the community

    please, let me make a few suggestions.

    nuverian: what do you think turn your assets (Flow & Node Canvas) more "community driven" in this way:

    1) Manage new features/requests with TRELLO, bitrix24, etc. (project management approach)
    2) Have a web repository (GitHub, Bitbucket, etc) for NEW ACTIONS made by the community and by yourself.
    3) Have a WIKIPEDIA like, to manage all the documentation generated by you and by the community.

    I'm thinking in the "GNU/Linux Kernel" development process.

    I think that with this approach all of us can benefits.
    Your software get more "customers" and your customers get more quality.
     
    frekiidoochmanz likes this.
  28. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Talking about documentation, nuverian I had difficulty figuring out that you could simply download a PDF of all the documents, since bright yellow on a whitish moca background is difficult to discern the link from, I think maybe you should link in this thread first page (OP) the PDF documentatiion under the webpage in fine print (with the same dark blue color) since this would have stopped me from asking alot of questions. (PDF file viewers are all free, even web browsers can view them) also, just a suggestion I would change the color of the Download PDF version to dark blue or something on that page, and center it so it is easier to see. But thats just a suggestion feel free to ignore me.

    I also suggest the same for FlowCanvas since it is invaluable to get PDF docs for something so extensive.

    well good job regardless like I said NodeCanvas is really good. And VERY well optimized. So is FlowCanvas altho the scripts keep giving me trouble so I mostly stopped using it alongside nodecanvas and only use it for decorative entities or things like weather/time keepers.
     
  29. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    As replied to the other thread, I totaly agree and like your suggestions and will set them in motion very soon :)
    Thanks a lot again.

    Hey,
    I have made the link more visible now. The PDF is generated from the html documentation of the software I use for docs, thus unfortunately there are't really many customizations I can do. The download PDF version is for the ocasions where internet is not available. The online one is far more convenient since it's better layouted and it also contains animated gifs :)

    Thank you. I'm glad you like the tools. Regarding the FC errors. I've found them and they are now fixed for the next version comming around by the way!

    Thanks again.
     
  30. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Quick question regarding DialogueTrees ...

    I create a GameObject with BT and DialogueActor. From the BT i create a StartDialogue Action.
    On the other hand I did Window > NodeCanvas > Create > Graph > DialogueTree (which creates a GO in the Hierarchy).
    I set up my dialogue in the DialogueTree
    Then from the BT i try to reference the Dialogue tree, by selecting the GO in the DialogueTree field.

    But ... I always end with a NULL value.

    Why ? What did i miss here ?
     
  31. nuverian

    nuverian

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

    To assign the Dialogue Tree reference, please drag&drop the Dialogue Tree "component" itself in the object field. There is currently a small issue with the current action due to how Dialogue Tree work, which leaves this the only option to assign a dialogue tree in the Start Dialogue action task.

    Please let me know if this works for you.
    Thanks.
     
  32. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    duh o_O that was easy ! Thanks ! Should have figured out by myself ... need more caffeine !
     
  33. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    You are welcome. It's not your mistake. I have to fix this to accept assignements with the other methods as well.
    Thanks!
     
  34. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Another issue ... FSM, simple Action1 Triggering Action2 on 'UI>ButtonClicked':
    It works in Runtime but back in the editor ... it's all dark. What am i missing here ?



     
  35. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey, the new version should be live any moment and has this fixed. Here is a quick way to fix this now though. Please open up StringUtils.cs and in method ToStringAdvanced add this line of code at the very beggining:
    Code (CSharp):
    1.             if (o == null || o.Equals(null)){
    2.                 return "NULL";
    3.             }
    Let me know if you have any other issues.
    Thanks.
     
  36. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Thanks, that solved the thing.

    One request: would it be possible to have the DialogueTree play in a TextMesh instead of a UI ? Like a simple "Say" thing without all the dialogue stuff ... just a single actor speaking himself (yet alone).

    How can I get started ? Should I code my own tasks for this or you have a better solution (and example) ?

    Thanks !
     
    Last edited: Mar 31, 2016
  37. nuverian

    nuverian

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

    Yes. You can create a custom script to handle the dialogue events that get raised however you like. The included DialogueUGUI prefab is not mandatory to use and is just one way of handling those events.
    Also, If you just want an actor to say something, you can simply use the Say action within a BT or FSM without using a whole Dialogue Tree by the way.

    So, let's suppose that you have this Behaviour Tree:
    BTSay.png

    Create a Text Mesh object and attach this script on it:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using NodeCanvas.DialogueTrees;
    4.  
    5. public class MyDialogueUI: MonoBehaviour {
    6.  
    7.     private TextMesh _textMesh;
    8.     private TextMesh textMesh{
    9.         get {return _textMesh? _textMesh : _textMesh = GetComponent<TextMesh>();}
    10.     }
    11.  
    12.     void OnEnable(){
    13.         DialogueTree.OnSubtitlesRequest += OnSubtitlesRequest;
    14.         textMesh.text = string.Empty;
    15.     }
    16.  
    17.     void OnSubtitlesRequest(SubtitlesRequestInfo info){
    18.         StartCoroutine(ShowSubtitles(info));
    19.     }
    20.  
    21.     IEnumerator ShowSubtitles(SubtitlesRequestInfo info){
    22.         textMesh.text = info.statement.text;
    23.         yield return new WaitForSeconds(info.statement.text.Length * 0.1f);
    24.         textMesh.text = string.Empty;
    25.         info.Continue();
    26.     }
    27. }
    Press play and the text mesh will show the dialogue text.
    You don't need to have the DialogueUGUI prefab in the scene for this to work.

    The above script handles the event OnSubtitlesRequest, but can be expanded to handle all dialogue relevant events raised if you need and each event has it's own argument containing information about the event( DialogueEventArguments.cs ). If you take a look at the DialogueUGUI.cs script this is exactly what is happening as well.

    Let me know if you need more help on the matter.

    Thanks
     
  38. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Wow ! That's pretty neat (and elegant) ! The only issue is now it listens to all events (including the UI), how can I make so it only listens 'somehow' to 'text' that is targeted to him ? I want to have UI and many 'text meshes.

    So to have something like :

    UI > "You hear some strange noise ..."
    (TextMesh)Hero > "Uh oh, something is going on ..."
    (TextMesh)Cat > "Yep, i can feel it too ..."
    etc...

    You think it's possible ? (Sorry i'm not that skilled in C#) Thank you in advance.
     
  39. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey, Thanks. Im glad you like it :)
    So, I assume you want to have a text mesh for each of the actors to achieve the dialogue be shown above them in 3d space? The SubtitlesRequestInfo, contains information about the actor currently speaking.
    I have modified the above script so that it finds the TextMesh to be used from the active actor's hierarchy. Of course it's not the best way to do, but you get the idea of how it can be done.
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using NodeCanvas.DialogueTrees;
    4.  
    5. public class MyDialogueUI : MonoBehaviour {
    6.  
    7.     void OnEnable(){
    8.         DialogueTree.OnSubtitlesRequest += OnSubtitlesRequest;
    9.     }
    10.  
    11.     void OnSubtitlesRequest(SubtitlesRequestInfo info){
    12.         StartCoroutine(ShowSubtitles(info));
    13.     }
    14.  
    15.     IEnumerator ShowSubtitles(SubtitlesRequestInfo info){
    16.         var textMesh = info.actor.transform.GetComponentInChildren<TextMesh>();
    17.         textMesh.text = string.Format("{0}: {1}", info.actor.name, info.statement.text);
    18.         yield return new WaitForSeconds(info.statement.text.Length * 0.1f);
    19.         textMesh.text = string.Empty;
    20.         info.Continue();
    21.     }
    22. }
    In this case, just add this script on an empty gameobject in the scene.

    Objects.png

    Let me know if this works for you.
    Cheers!
     
  40. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Mmmh but then I need to reference from the BT the DialogueActor ? (directly or from GBB) ?
    In anyway the DialogueUI is also 'getting' this ..

    So if i say Actor1: Hi
    the gUI also says : "hi"

    Which I don't want ... is it maybe more clear ?


     
  41. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Yes, of course we need to reference the dialogue actor that you want to say the dialogue text since we want to get the text mesh from him. :) By the way, the above solution posted works with Dialogue Trees as well if you only have Say nodes within like you originaly intended, within which you also get to reference a dialogue actor if you want to use it's position in 3D space.
    I really don't know what exactly you are after here, so if you let me know I could provide better help.
    Thanks
     
  42. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    The new version is now live on the asset store. I made a mistake and did not update the meta-information version of the asset, thus you probably will not get a notification of this update, but the current version is 2.5.0. I have already resubmited the package to correctly reflect it's version change. Here are the important changes though:
    • The deserialization speed/GC is further improved. A lot.
    • FSM-Nested BT node can now be set to pause/resume instead of stop/start when the state exists and re-enters.
    • Fixed "Execute Static Function" tasks to better handle changes in the target method parameters.
    • Updated the included DOTween to the latest version.
    • The Blackboard variables panel in the editor is now scrollable.
    • Added Gizmos in tasks that were missing them.
    • Fixed serialization bug relevant to multi-scene editing.
    • Support for Unity 5.4.
    • Various other fixes and improvements.
    Cheers!
     
    HeadClot88 and DiscoFever like this.
  43. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Quick warning to all: save your project before upgrading.

    Yes I know that should be common practice, but I don't always... and this time I got stung.

    Totally corrupted my project, had to revert back to an earlier one which in my case is minimal work thanks to the fact that this version has been mostly C# coding.

    When I reverted backwards, upgraded again... boom... corrupted my older version... which I had a backup of.

    Nuv, one corruption is bad luck. Two say's maybe you should look into it.

    I had to delete & import all NodeCanvas and FlowCanvas assets again.

    Just a heads up in case you need to fix something before you get potential complaints...

    Rix
     
  44. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Can you please let me know what erros you encountered? What kind of corruption or any messages in the console?
    I did a thorough test updating projects from previous version and I had no issues.
    Please let me know what occured.

    Thanks a lot
     
  45. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Sure thing Gav,

    I deleted my latest version, so this one goes back a month... which means this is the 3rd version I have upgraded & it corrupted.

    I'll keep this version handy, dig into the errors more if you need more information.

    I'm heading out within the next hour, so I'll have time for one more post just before I leave.

    Rix
     

    Attached Files:

  46. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Thanks for the image. So, it's just that due to some name changes the project can't compile, but it did NOT get corrupted by any means. All you have to do is delete the NodeCanvas folder (and FlowCanvas if you also have that) and re-import it anew so that the project compiles. After that is done, there will be no data loss by doing that or anything similar and you will be good to go :)
    Please try doing this (delete NC and FC folder -> re-import) and confirm that all is working as it should, considering it does.

    Thanks.
     
  47. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    Ok so that did work with my older version :)

    However, the original one did have some side effects that this one didn't. I have the Tagify asset, and every gameobject had the error "missing script", and it also went missing from the Window toolbar. I tried reassociating the scripts but it refused. Removed/readded Tagify and it didn't fix it. Generally it looked like it knocked out script association.

    The below screen is of a manually added C# script, and as you can see it still had the correct script attached but refused to clean the error.

    upload_2016-4-2_13-43-32.png

    Another quirk was that it killed my custom Layout, forced me into resetting to defaults.

    I'm back on my feet though, so all is good.

    Rix
     
  48. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    One thing I would like to be able to do is to use the blackboard separately from NodeCanvas, but I can't figure out how to correctly use BBParameters in my own scripts to get the interface like in the graph window
     
  49. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    BBParameters wil not show correctly in a custom script and can't be serialized by default Unity serializer. There are ways to work around this of course, but I think it's more trouble than it's worth it to do it in every script you need to use them :)
    You can definetely use Blackboards separately from NC though as a standalone component and use it's API to get/set it's variables without BBParameters. For example:

    Code (CSharp):
    1. using UnityEngine;
    2. using NodeCanvas.Framework;
    3.  
    4. public class ExampleScript : MonoBehaviour {
    5.  
    6.     private Blackboard _blackboard;
    7.     private Blackboard blackboard{
    8.         get {return _blackboard != null? _blackboard : _blackboard = GetComponent<Blackboard>();}
    9.     }
    10.  
    11.     public float speed{
    12.         get {return blackboard.GetValue<float>("Speed");}
    13.         set {blackboard.SetValue("Speed", value);}
    14.     }
    15.  
    16.     public float health{
    17.         get {return blackboard.GetValue<float>("Health");}
    18.         set {blackboard.SetValue("Health", value);}
    19.     }
    20. }
    Let me know if this works for you.
    Thanks!
     
  50. Rixtter

    Rixtter

    Joined:
    Mar 31, 2014
    Posts:
    244
    If you also own FlowCanvas you can add in the Blackboard from NodeCanvas via reflection. I learnt this yesterday from a post over on the FC forums.

    http://flowcanvas.paradoxnotion.com...er-load-back-the-blackboard-from-playerprefs/

    You need to add in Blackboard from the Preferred Types editor first, then it becomes available as per 4th post from the above link.

    And if you are wondering why you would want to given that FC has direct access to the Blackboard, it's because NodeCanvas also has the Load and Save nodes. Pretty handy :)

    Rix
     
    nuverian likes this.