Search Unity

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

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

  1. nuverian

    nuverian

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

    The Script Control task's execution is implemented to be very fast, since they are one of the core workflows of NC :). It might not be as fast as having the a custom task written, but really the difference is negligible.
    (its a direct non dynamic delegate call)

    So, I would say go with Script Control tasks :)

    Cheers!
     
  2. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    one thing that is pretty important, mac users cannot use the canvas graph with touch pad, the right click does not work. so we have to use an external mouse
     
    PeterB and OnePxl like this.
  3. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    Im trying to write an action but i cant figure what is the difference between:
    Code (CSharp):
    1. protected override void OnExecute(){
    2.             Debug.Log ("OnExecute");
    3.             EndAction(true);
    4.         }
    5.  
    6.         protected override void OnStop(){
    7.             Debug.Log ("OnStop");
    8.         }
    they trigger on the same frame when state is entered, so there is no event like OnExit() we could use to reset stuff?
     
  4. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    When trying to import Node Canvas 2 into an existing Unity 5 project, I get the following compilation error:

    Assets/NodeCanvas/Design/Editor/Windows/WelcomeWindow.cs(42,22): error CS0117: `Help' does not contain a definition for `BrowseURL'

    The same message is repeated two more times, for lines 61 and 80. Namespace issue?

    (Note for Mac trackpad users: it is possible to right-click without an external mouse. Simply set the track pad up in System Preferences to recognise two-finger clicks as secondary clicks.)
     
    Last edited: Mar 23, 2015
  5. nuverian

    nuverian

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

    Hmm. Can you please make a suggestions on how you would altenateively like to do right clicks?
    Thanks :)

    OnStop is called when the action is finished for either reason. Either cause you called EndAction or because it got interrupted. In case of FSMs, If the action was running when the state Exit, OnStop will be called, but in the above example since the action is already stoped/finished it is not called again.

    Let me know if that makes sense :)

    Hey,

    Thats weird, but yes. Maybe your project already contains a 'Help' class that is not within a namespace?
    Also. Thanks for the tip info provided about mac and trackpad, but if you have any alternatives I will be glad to hear about it

    Cheers!
     
  6. iviachupichu

    iviachupichu

    Joined:
    Feb 6, 2015
    Posts:
    28
    This.

    @Damien Delmarle: Is it that right clicks are not registering on the Mac version or have you never right clicked at all with the touchpad? If it's the latter then you can either two-finger press as PeterB suggested or put two fingers and press with your thumb. I'm fairly certain that both options are enabled by default.

    Middle clicks are actually more of an issue laptop-wise. Most trackpads will let you simulate the scroll but not a middle click press, so panning is a no-go in NodeCanvas.
     
  7. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hm. I have just added the ability to pan with holding ALT + any mouse click and drag.
    I hope that solves the panning in trackpads :)

    Cheers!
     
    iviachupichu likes this.
  8. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    i usually use command key + trackpad click to make a right click, but it does not work on your graph panel.

    thanks i got it for the endAction, its perfect now
    one last question, when we create action, we can use them both on fsm and behavior trees?
     
  9. nuverian

    nuverian

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

    You are welcome. Glad to be of help :)
    I will think what I can do for trackpad right clicks. Probably some keyboard shortcut will open up the menu at mouse position.

    Yes. the actions and conditions can be used in both FSMs and BTs, or any other NC graph :)

    Cheers!
     
  10. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    You mean Control+mouseclick, right?

    (Some assets check for Command and Control and consider them the same, that is wrong; the Mac has a separate Control key.)
     
  11. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    none of the key work, i just tested, it works on animator window but not on nodecanvas window
     
  12. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I love Node Canvas already and give it five stars, but:

    How do I return Status.Success from UnityScript? That enum is in a C# namespace.

    I've also run into the pan problem described above: my whole BT went out-of-sight and it was really very difficult getting it back into view again. Next, when I created a nested BT out of a sequencer, everything vanished out of sight - including the new sub-BT in its new view. I still haven't been able to retrieve them, as the scroll bars don't work in the canvas window.

    Another thing: the word "binded" is only used in English when referring to book binding, and even then it's archaic (and contested). Unless you have a particular reason for using a non-standard conjugation for the verb "to bind", you might consider switching to the correct form which is "bound", as in "bound variables".

    A variable might still be referred to as having a binding, and its value might have bounds – limits – and therefore be bounded, but that's a different matter. (Sorry for being a linguistic jerk to point this out.)
     
    Last edited: Mar 24, 2015
  13. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    Im making an action with a variable:

    [RequiredField]
    publicBBParameter<AudioSource> srcPrefab;
    [RequiredField]
    publicBBParameter<AudioClip> audioClip;

    i want to reference a prefab but in my "NC inspector" i cant reference my prefabs, its kind of greyed out, how can i reference prefabs ?

    also i Have FSM(script) and FSMowner(script) component on an object, i cannot delete FSM which is empty the only options are reset and edit script
     
  14. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello Peter and thanks for the rating :)

    Regarding using Status from UnityScript, you can do so by declaring on the top of the script:
    import NodeCanvas;
    or alternatively simply specify the namespace directly likeso:
    return NodeCanvas.Status

    Have you moved the folders around into a Plugins folder by the way? I might have to rethink the folder structure to be more easier to be used from UnityScript due to Unity's Editor folder requirement to be placed directly beneath the "Plugins" folder.
    You are after the Implemented Action I suppose?

    Regarding panning, you can press "F" to focus the canvas on the center of your nodes in any case that they are somehow out of view and lost. Which is a matter I am still trying to reproduce somehow. But "F" for focus, will certainly help :)

    Regarding Binded and Bound, you are totaly correct, and other people told me so as well. English is not my native language and thus the grammar error.
    It's already renamed now. Thanks :)

    Hello,

    Greying out (disabling) editor fields was a rather bad call on my side to avoid some accidents, but it will be removed.
    Please, open up EditorUtils_GUI.cs and comment or delete lines #159-164. Let me know if you encounter any problems with that. If yes I can PM you the full file for you to replace.

    Regarding the FSM script you have, I dont know how you managed to get that visible, but I will realy try to reproduce that. It's the actual Bound FSM which is used by the FSMOwner, which is ment to not be visible for convenience.
    Can you please confirm that opening one or the other reflect to the same FSM being edited?
    Please let me know.

    Thanks!
     
  15. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    opening the first FSM, i just have an empty graph,I dont remember what i did but probably something like this: create a fsm asset, add states, add asset on gameobject, edit the binded version, save over the asset file from gameobject binded version, add a second fsm on gameobject and edit it then save on an other asset.

    Also i tried to use FSMOwner.StopBehaviour() & StartBehaviour() but i has not effect so i ended doing like this:

    Code (CSharp):
    1.     public bool passive
    2.     {
    3.         set
    4.         {
    5.             if(value == true)
    6.             {
    7.                 agressiveFSM.enabled = false;
    8.                 passiveFSM.enabled = true;
    9.             }
    10.             else
    11.             {
    12.                 passiveFSM.enabled = false;
    13.                 agressiveFSM.enabled = true;
    14.             }
    15.         }
    16.     }
    is there any way to use a function to enable diable FSMs?
     
  16. nuverian

    nuverian

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

    Thanks for the info provided. I am still trying to reproduce this occurance somehow with no success. While I will keep searching at it, if you manage to reproduce this, please let me know.

    I just rechecked StartBehaviour and StopBehaviour and work as expected. enabling/disabling the GraphOwner, also basicaly does the same thing ( calling StartBehaviour, StopBehaviour ). Do you get a log or something or you mean simply nothing happens?

    Thanks
     
  17. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    when i run StopBehaviour, its still run, no change.
    would that help if i send you the prefab ?
     
  18. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Please do send me the prefab or some exported project package if you can so that I can see whats going on.
    ( info@nodecanvas.com )

    Thanks!
     
  19. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Assets/NodeCanvas/Tasks/Conditions/UGUI/ButtonClicked.cs(17,50): error CS1061: Type `Button' does not contain a definition for `onClick' and no extension method `onClick' of type `Button' could be found (are you missing a using directive or an assembly reference?)
     
  20. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    you might add using UnityEngine.UI; at the top of your script, looks like you have modified it, this error should not be here, else you used unity 4.5 ?
     
  21. nuverian

    nuverian

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

    I am submiting a new micro update now. Here are the changes:

    • Added control click to select/deselect multiple nodes.
    • Added dropdown in the editor toolbar to quickly select other GraphOwners in the scene.
    • Added ability to minimize/maximize the node inspector panel like the variable inspector panel is done now.
    • Added Repeat Actions option in the fsm Concurent node.
    • Added icons for BT WaitUntil and Timeout Decorators.
    • Added ability to set a blackboard variable as "Non Editable". Useful if you are working with other people.
    • Added ability to pan the canvas with ALT + mouse click and drag.
    • Added a small highlight to the out connections of the selected node.
    • Added 'Flee' and 'Wander' Action Tasks.
    • Improved the light theme to have more contrast.
    • Fixed WP8, Store Apps errors.
    • Fixed Node multi selection GUI errors thrown.
    • Fixed Override Agent from variable that was not changing when the variable changes.
    • Fixed OnInit not called for Tasks that have no agent type defined, is now called normaly.
    • Fixed Task search that was showing type name results.
    • Fixed editing nested graphs losing reference to agent and blackboard in edit mode after a recompile.
    • Removed disabled/greyed out object fields
    • Renamed "Binded" to "Bound" :)

    @Neo-Gamefactory What Unity version are you using?

    Cheers!
     
  22. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Using Unity 4.6.3f

    but maybe it is one of the Addons. A* or FinalIK (official Addon from Asset Store)
    .. delete This Folder and it works.
     
  23. Macro

    Macro

    Joined:
    Jul 24, 2012
    Posts:
    53
    @Neo-Gamefactory
    I rarely pop onto the unity forums, but as I was passing I just wanted to mention that as part of the latest 2.0 versions of FinalIK, A* actions etc (on the asset store) we moved to use uGUI in the demos rather than the old GUI which just plonked text wherever it wanted.

    So those assets you mention will actually now require uGUI but that should come with all version of unity above 4.6, if it is these addons causing the issue, just delete the demos and the actions will work fine (as they have no dependency on gui stuff).

    Although that being said we don't use any buttons and to my knowledge dont contain any GUI related extensions, if it does end up being those assets feel free to pm me or raise a bug on the helpdesk etc.
     
  24. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    The File is from NodeCanvas, not from an Addon..

    NodeCanvas\Tasks\Conditions\UGUI

    but.
    Only Import Nodecanvas and it works.
     
  25. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    I think i have an issue with EndAction(true), im trying to make my AI strafe and make the action stop when it collide with something ( !agent.NothingLeft/Right), right now using this action on my npc: debug run in that order Debug.Log(1) so my action is immediately ended, Debug.Log(2), Debug.Log(3), all the others debug log are not run, so there is nothing in my state that run EndAction(true) but the action is still immediately ended

    Code (CSharp):
    1. using ParadoxNotion.Design;
    2. using UnityEngine;
    3.  
    4. namespace polyAI{
    5.  
    6.     [Category("polyAI")]
    7.     public class TryStrafe : ActionTask<NpcLogic>{
    8.         private int direction;    //0left/1right
    9.         private float generatedTimer;
    10.         public float minTimer = 1;
    11.         public float maxTimer = 4;
    12.         public float speed = 2;
    13.         protected override string OnInit(){
    14.             return null;
    15.         }
    16.  
    17.         protected override void OnStop ()
    18.         {
    19.             agent.navmesh.speed = 0;
    20.             agent.navmesh.updateRotation = true;
    21.             Debug.Log (1);
    22.         }
    23.  
    24.         protected override void OnExecute()
    25.         {
    26.             generatedTimer = Random.Range (minTimer, maxTimer);
    27.             //take a random strafe direction
    28.             direction = Random.Range (0, 2);
    29.             Debug.Log (2);
    30.             //can we strafe ?
    31.             //if not use opposite strafe direction
    32.             if (direction == 0)
    33.             {
    34.                 if(!agent.NothingLeft)
    35.                     SwapDirection ();
    36.             }
    37.             if (direction == 1)
    38.             {
    39.                 if(!agent.NothingRight)
    40.                     SwapDirection ();
    41.             }
    42.  
    43.  
    44.             //if can strafe, return
    45.             if (direction == 0)
    46.             {
    47.                 if(!agent.NothingLeft)
    48.                     return;
    49.             }
    50.             if (direction == 1)
    51.             {
    52.                 if(!agent.NothingRight)
    53.                     return;
    54.             }
    55.             //else we cannot strafe, stop this action
    56.             Debug.Log ("cannot strafe");
    57.             EndAction(true);
    58.         }
    59.  
    60.         protected override void OnUpdate ()
    61.         {
    62.             if (!agent.target)
    63.                 return;
    64.  
    65.             Debug.Log ("direction = "+direction);
    66.             if (direction == 0)
    67.             {
    68.                 if(!agent.NothingLeft)
    69.                 {Debug.Log (" __ ");
    70.                     EndAction (true);
    71.                     return;
    72.                 }
    73.                 //strafe left
    74.                 Debug.Log ("left strafe");
    75.                 agent.navmesh.speed = speed;
    76.                 agent.SetPath (-agent.transform.right *2);
    77.                 agent.navmesh.updateRotation = false;
    78.             }
    79.             if (direction == 1)
    80.             {
    81.                 if(!agent.NothingRight)
    82.                 {Debug.Log (" __ ");
    83.                     EndAction (true);
    84.                     return;
    85.                 }
    86.                 //strafe right
    87.                 Debug.Log ("right strafe");
    88.                 agent.navmesh.speed = speed;
    89.                 agent.SetPath (agent.transform.right);
    90.                 agent.navmesh.updateRotation = false;
    91.             }
    92.  
    93.             if (generatedTimer < elapsedTime)
    94.             {Debug.Log (" __ ");
    95.                 agent.navmesh.speed = 0;
    96.                 Debug.Log ("timer end strafe");
    97.                 EndAction (true);
    98.             }
    99.  
    100.             //agent.SetPath (agent.target.transform.position);
    101.         }
    102.  
    103.         private void SwapDirection()
    104.         {
    105.             if (direction == 0)
    106.                 direction = 1;
    107.             else
    108.                 direction = 0;
    109.  
    110.             Debug.Log (3);
    111.         }
    112.     }
    113. }
    EDIT: i have rewritten this state and it works now !
    anyway i have an other problem, if i want to run some code im my function in LateUpdate into my state how would i do that?
     
    Last edited: Mar 29, 2015
  26. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    @Damien Delmarle Glad to know you got it working. Didn't see the post sooner. Sorry :)
    Regarding LateUpdate, right now there is no such "callback". I can tell you a workaround if you definetely want to use LateUpdate. Let me know if so.

    Cheers!
     
  27. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    it would be nice, i have made some dirty code to have my action working on LateUpdate
     
  28. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Ok :)
    So. Open up MonoManager.cs and add this code:
    Code (CSharp):
    1.         public Action onLateUpdate;
    2.         void LateUpdate(){
    3.             if (onLateUpdate != null)
    4.                 onLateUpdate();
    5.         }
    Then in your ActionTask in question do something similar to this:
    Code (CSharp):
    1. using NodeCanvas.Framework;
    2. using ParadoxNotion.Services;
    3.  
    4. namespace NodeCanvas.Tasks.Actions{
    5.  
    6.     public class LateUpdateAction : ActionTask {
    7.  
    8.         protected override void OnExecute(){
    9.             MonoManager.current.onLateUpdate += this.OnLateUpdate;
    10.         }
    11.  
    12.         protected override void OnStop(){
    13.             MonoManager.current.onLateUpdate -= this.OnLateUpdate;
    14.         }
    15.  
    16.         void OnLateUpdate(){
    17.             //do stuff...
    18.             //EndAction
    19.         }
    20.     }
    21. }

    I hope this helps :)
    Maybe I will add this in by default. Of course you could do something similar outside of MonoManager and within some of your own "managers" if you like.

    Cheers.
     
  29. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    HI,

    finally I had time to jump into NC2 and works great.

    But sometime, and I don't know when and why, my Node Graph is looped with this error:

    EDITOR_Node.cs line 654

    MissingReferenceException: The object of type 'BehaviourTree' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.


    Note: I tried (node by node) create my Node Graph by Soldier Chase examle under Unity 4.6.3, works same but ... I get this error ... and then, I have to turn off Unity editor.
    Now I don't know, if is it a problem in my graph or is it a little bug in NC.

    Best regards,
    AndyGFX.
     
  30. nuverian

    nuverian

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

    This is a small nasty editor bug which is now though fixed. Fix is in the upcomming immediate update. Nothing wrong with your graph :)
    A workaround instead for now when this happens instead of restarting, would be to set the unity editor layout (from top right), or better, clicking on a gameobject with a GraphOwner so that the editor refresh. Sorry about this :/

    By the way, are you the same AndyGFX relevant to GameStart3D? You once posted in one of my blog posts. Small world :)
     
  31. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Of course, I'm ;)

    Mr. Cleaner in two weeks with GS3D and then 6 months with François on game redesign? Yeah. Great times.

    Wow, this world is really small.

    Best regards,
    AndyGFX
     
  32. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Sorry in advance for what is probably a dumb question. My computer is pretty slow and it takes several seconds to compile the game after any code changes. Is it possible to have NodeCanvas as a DLL to reduce the compilation time?
     
    Pajaroide likes this.
  33. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    It's not a dump question :)
    I will take a look into this.

    Thanks
     
  34. AndyGFX

    AndyGFX

    Joined:
    Jan 13, 2012
    Posts:
    98
    Hi,

    I working on my AI and I found that condition 'Is In Front' has used angle field only inside of node, but I think that this field is very important for define view angle when enemy change focus for example when he has sniper rifle in hand.Because angle isn't now as BBParameter, this option is not possible. From my point of view, it would be good make it default as BBParameter.

    Best reagrds,
    AndyGFX.
     
  35. nuverian

    nuverian

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

    I agree with you. I've made this field a BBParameter now :)
    Thanks!
     
  36. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Oh, that would be great. BTW, even if it took NodeCanvas 10 times longer to compile, I would still use it because it's so wonderful!
     
  37. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    Any update on NodeCanvas 2 and iOS? Right now we are using it for a lot but then found out it don't run on iOS, which is a real shame.

    The issue for us is at +Binder.LateUpdate(), which casts a null reference. I know there are some limitations on iOS, but you asset states that it supports all platforms which is not the case right now.
     
    Last edited: Apr 13, 2015
  38. nuverian

    nuverian

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

    I have already commited version 2.2 at the asset store which should fix iOS errors for the most part. What do you mean by Binder.LateUpdate?

    Thanks
     
  39. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    When using the blackboard it returned a constant null reference when it ran the serialized Binder class LateUpdate() method. For now we disabled using the blackboard.
     
  40. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello everyone. Version 2.2 is now live. Here are the complete changes:


    • Added "Execute Static Function" Task to call any static function in any class. Remember that the classes shown to be selected are the ones added in the "Prefered Types Editor" window.
    • Added Flee and Wander action tasks.
    • Added control Click to select/deselect multiple nodes
    • Added dropdown selection menu in the editor toolbar to quickly jump between different GraphOwners in the scene.
    • Added ability to minimize/maximize node inspector similar to how variables inspector is done, by clicking the header.
    • Added 'Repeat Actions' in the Concurrent fsm node.
    • Added missing icons for Behaviour Tree WaitUntil and Timeout Decorator nodes.
    • Added option to set variables to 'non-editable'. Useful if you are working with other people.
    • Added ability to pan the canvas with ALT + click and drag for trackpads.
    • Added a small highlight to the out connections of the currently selected node.
    • Added support for 'Type' variables, editor inspection and selection.
    • Added a utility editor window "Scene Graph Owners", that shows all the current GraphOwners in the scene and the ability to select them.
    • Added event send and receive logging in the console for easier debugging.
    • Improved the Light/Indie theme.
    • Fixed WP8 and Store Apps errors.
    • Fixed most iOS errors.
    • Fixed node multi-selection editor GUI errors.
    • Fixed override agent from variable that was not changing when the variable was changed.
    • Fixed OnInit that was not called in tasks that did not define an AgentType.
    • Fixed Task Search, that was showing type names within the results.
    • Fixed editing nested graph losing reference to GraphOwner after a scripts recompile.
    • Fixed editor null reference exception that was thrown some times after exiting play mode with the NC editor open.
    • Removed greyed out/disabled object fields when editing a prefab owner or asset graph.
    • Renamed "Binded" to "Bound" :)

    @BFGames I am still not sure what Binder class OnLateUpdate you referer to :/ There is no OnLateUpdate call anywhere in NC.
    Can you please try the new version and let me know regarding the errors? Thanks

    Cheers!
     
    Last edited: Apr 14, 2015
  41. sohojoe

    sohojoe

    Joined:
    Feb 13, 2015
    Posts:
    21
    @nuverian - just updating to 2.2 - i have created my own canvas and see a bunch of compile issues with 2.2, is there an upgrade guide for when people have extended the node canvas core?
     
  42. nuverian

    nuverian

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

    Do you mean you encounter compile issue upgrading from 2.1 to 2.2 with some custom created graph system?
    There have been some slight changes but not realy much as far as extending Graph class itself.
    Let me know of the errors and I will help you through if you want :)
     
  43. sohojoe

    sohojoe

    Joined:
    Feb 13, 2015
    Posts:
    21
    Thanks for the quick reply - turns out i had broken another component during the update. There were only two build issues associated with NodeCanvas which i quickly figured out
     
  44. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    You are welcome and thanks for letting me know everything is fine now :)

    Cheers!
     
  45. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    @nuverian : I've publish the common solution for preventing icon overlapping for all third party extensions, maybe you can have a look and consider support it for the next update. Not only just icon overlapping but some other features as well, should not take you more than 5 minutes to integrate, so here is the link :

    http://forum.unity3d.com/threads/hierarchydraw-put-your-hierarchy-icons-under-control.319039/

    I already support HierarchyDraw in my beta versions for Hierarchy2. Hopefully you will do it next ! :)

    Thanks.
     
  46. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Is there a way to see what version of NodeCanvas is included in the current project?
     
  47. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    What is the proper way to upgrade from 1.x to 2.2? I tried deleting the old version and importing 2.2, but the FSM was lost. I do have a backup, so not a big deal.
     
  48. nuverian

    nuverian

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

    I should definetely take a look. Looks nice :)
    Thanks for letting me know.
    Cheers!

    Hey,

    The current version is always displayed at the bottom right corner of the NC editor window.
    Regarding upgrading from 1.x to 2.x, unfortunately this is not possible due to the heavy changes made to the core framework as far as serialization goes. I am sorry about this.
    So, it's best to complete a project you started using 1.x with 1.x and possibly use 2.x on some new project later on :).
    If you need any support at all for version 1.x, I would be very glad to help of course!

    Cheers and thanks!
     
  49. Dbone

    Dbone

    Joined:
    Mar 10, 2014
    Posts:
    56
    Hi Nuverian,

    I'm trying to change a variable on an imported List and can't figure out how to do it.

    Currently I'm using the Get Field task to grab a list off of a script and put it on the Blackboard. When I open the List it shows the variables I want and I can freely edit them there manually. I can't however figure out how to edit them with a task, or how to take a single variable in a Blackboard list and get it on to the Blackboard as a Float etc so it can be changed and pushed back into the list.

    Is something like this possible. If not can I request it as a feature?

    Thank you for Nodecanvas, every time I use it it is an absolute pleasure, one of my very favourite assets.
     
  50. nuverian

    nuverian

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

    Thanks for your comments on NC. I am glad you enjoy using it :)

    There are a number of tasks under "Blackboard/Lists" that are relevant to lists.

    List Tasks.png

    These tasks with the (T) suffix are generic tasks. So lets suppose you have a variable of type List<float> and you want to get a float from the list by it's index, then you would select and use the "PickListElement (T)/System/Float" task.


    PickListElement.png

    By no means these tasks cover everything you can do with lists of course. As a matter of fact, I just realized that a "Set List Element" is missing, to set an element by it's index :) Here is a Task to do that:

    Code (CSharp):
    1. using System.Collections.Generic;
    2. using NodeCanvas.Framework;
    3. using ParadoxNotion.Design;
    4.  
    5. namespace NodeCanvas.Tasks.Actions{
    6.  
    7.     [Category("✫ Blackboard/Lists")]
    8.     public class SetListElement<T> : ActionTask{
    9.  
    10.         [RequiredField] [BlackboardOnly]
    11.         public BBParameter<List<T>> targetList;
    12.         public BBParameter<int> index;
    13.         public BBParameter<T> newValue;
    14.  
    15.         protected override void OnExecute(){
    16.  
    17.             if (index.value < 0 || index.value >= targetList.value.Count) {
    18.                 EndAction(false);
    19.                 return;
    20.             }
    21.  
    22.             targetList.value[index.value] = newValue.value;
    23.             EndAction(true);      
    24.         }
    25.     }
    26. }

    If you are after some other list manipulation task that is missing, let me know and I will post it for you here (and add it in the next update as well).

    Cheers and thanks!