Search Unity

Behavior Designer - Behavior Trees for Everyone

Discussion in 'Assets and Asset Store' started by opsive, Feb 10, 2014.

  1. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Thanks for the feedback. Happy to hear that overall it is going well.

    1. When I was deciding what to price this BT implementation at and whether or not to include the source I was comparing it to Behave 2 and React. Behave is $200 and React was $95 before they reduce it to $45. Behave comes with no source code and React comes with the complete source code. I decided to compromise and initially list it at $50 with some source code. Since all of the source code is provided for the tasks it should provide a really good example of how to use the Behavior Designer API. I also understood that some people would want the source so I listed the runtime source online at the price of Behave, $200. There has been a few source code sales but what I imagine people will do is first buy the non-source version, decide that they are going to stick with it and then later buy the source version to do their own modifications. The nice thing about this is that you are not penalized for buying the cheaper version first since I take that price off of the source version.

    2. Is it not showing up in the list? I just subclassed the Wait task and it seemed to work fine -

    Code (csharp):
    1.  
    2.     public class SuperLongWait : Wait
    3.     {
    4.         public override TaskStatus OnUpdate()
    5.         {
    6.             if (startTime + waitTime * 20 < Time.time) {
    7.                 return TaskStatus.Success;
    8.             }
    9.             return TaskStatus.Running;
    10.         }
    11.     }
    12.  
    The only change that I had to make was to make startTime protected instead of private (which going back to comment #1, this another reason why I provided the source for the tasks).

    3. Yeah, all of the tasks are derived from a ScriptableObject and you can only have one per file. Behavior Designer will no longer throw constant errors when you do happen to have multiple tasks per file though.

    4. Yes, take a look at the external behavior tree task. The RTS sample project also has an example of this. Just letting you know that in version 1.1 the "save" button will now save just the behavior tree objects to a .asset file instead of to a prefab.

    5. Does the external behavior tree task solve this for you?

    6. If that field has the linked field attribute then a link icon will appear next to all of the tasks that are referenced. In version 1.1 it will appear even if the field does not have that attribute. I am trying to stay away from highlighting them all orange because if you have multiple tasks referenced then you may not know which one to delete unless you can somehow highlight it.
     
  2. Pyromuffin

    Pyromuffin

    Joined:
    Aug 5, 2012
    Posts:
    78
    I'll check out the external tree task, it might do what I want. Do you get still get to visualize the flow chart in an external tree?

    regarding 2), using your example, if you make a task with a public reference to a Wait (but not a Super Long Wait), you can not select a Super Long Wait from a task that expects a Wait, when you click on Select in the BD editor, and then try to click on Super Long Wait, it doesn't do anything.
     
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Currently you cannot visualize external behavior trees as they are running. That is the first thing that I am going to work on for version 1.2. Now I see what you are saying for number 2, and I have it fixed. I'll send you the new package now.
     
  4. BenbowMAS

    BenbowMAS

    Joined:
    Jul 16, 2013
    Posts:
    13
    Hi,
    i'm actually using BT for a project, and i do have a problem using external behaviour tree..
    They actually don't register my game object target. I tried it by saving them through unity, then through behavior designer, then linking it in the scene or in the assets (using prefab). I'm really new in BT, and i saw that's working on your project (RTS Sample) but i don't find a way to fix that.

    Second Question, maybe i don't notice that correctly, but when the "variables panels" will be released ? I need this features :D !

    thank you

    Benoit
     
  5. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Are you saving the external behavior tree in a resources folder? If it isn't in resources then it won't be able to find it. In terms of the variables feature, I have the actual code done and am just finishing up with some of the screenshots. I'll be submitting it either tonight or tomorrow morning.
     
  6. BenbowMAS

    BenbowMAS

    Joined:
    Jul 16, 2013
    Posts:
    13
    In Fact yes, thank you, it's working like that ... It'll always be like that, using resources folder ?

    By the way, thank you for your answer :)
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Yes, behind the scenes anytime you save a BT to a prefab or (coming soon) .asset file it serializes the data. The other way for Unity to find the actual object is to use Resources.Load, and that requires the BT to be in a resources file. I would really like to find a way around that but for now that's the only way.

    Send me a PM or email with your invoice number and I can send you the newest version so you don't have to wait for Unity to approve the variables update.
     
  8. davylew

    davylew

    Joined:
    Mar 14, 2014
    Posts:
    10
    PLS Add Weighted Selector composite node . thank you .
    $960015ED-6F79-4013-B569-4956494D77C5.png
     
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
  10. davylew

    davylew

    Joined:
    Mar 14, 2014
    Posts:
    10
    i know i can setting priority and sharing one Random float(0-1) variable in my own Action node to implement random selector based on percent , but i think i need new Random selector node basedon percent to decide which task to run next.
    I can setting each child's weight in inspector and when i change the child in the node editor the inspector auto update the child list . the child node not only my Action node but also all kind of node .
    thx.
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    I am not completely following. On your child task you could add a public property called weight and within GetPriority of that node you would do:
    Code (csharp):
    1.  
    2. public override float GetPriority()
    3. {
    4.    return weight;
    5. }
    6.  
    Then the tasks will run according to the weight that you set within the inspector. You could then reference this task and dynamically change the weight during runtime if that's what you want to do.

    Does that help at all?
     
  12. davylew

    davylew

    Joined:
    Mar 14, 2014
    Posts:
    10
    Thank you for the quick answer. I try to create my composite node .
    Your product is very useful in my project . Looking forward to the new version。
     
  13. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Here's a rundown of what is in version 1.1. Most of these new features relate to the runtime and I am planning on focusing on the editor in version 1.2.

    Variables
    See this post for more information but you will never have to write another blackboard class again. Using variables you are able to communicate between tasks without having to write any lines of code.

    $Variables.PNG

    Save to asset file
    In previous Behavior Designer versions you would reference an external behavior tree by saving out the entire behavior tree component out to a prefab. This process has been changed so it will only export the core behavior tree data to an asset file.

    $asset.PNG

    Control how often the behavior tree updates
    You've probably noticed that when a behavior tree runs it creates a new GameObject called the "Behavior Manager". This GameManager is what is actually executing all of the behavior trees in your scene. The execution used to always take place within the Update loop so there was no way to control how often the behavior tree executed. In version 1.1 you can now specify how often to update, or if you want to manually tick the behavior tree yourself you can do that as well.

    $Update.PNG

    External behavior trees can inherit the values of their parent behavior tree
    Imagine a situation where you have a lot of external trees and the only thing that changes between them is one variable, such as the speed that the unit moves. In previous Behavior Designer versions you would have to create multiple behavior trees each with a different speed set or use a blackboard class. You can now add the InheritedField attribute to a variable and the value will be passed down from the external behavior tree task. In our move speed example, this will allow you to only have one external tree and change the move speed by changing the value on the external behavior tree task.

    Instant tasks
    When a task returns success or fail it immediately moves onto the next task within the same update loop. If you uncheck the instant task it will now wait a update tick before the next task gets executed. This is an easy way to throttle the behavior tree.

    $Instant.PNG

    Task categories
    Even though this is mostly a runtime update I did add probably the most requested editor feature: task categories. You can now specify group all of your different tasks into logical categories within the task list.

    $categories.PNG
     
  14. eagleeyez

    eagleeyez

    Joined:
    Mar 21, 2013
    Posts:
    362
    Thank God
     
  15. boonyifei

    boonyifei

    Joined:
    Sep 8, 2012
    Posts:
    6
    Hi, I'm constructing a behavior tree with your plugin and was trying to use the "Priority Selector" node.

    I have several tasks as a child of this priority selector node and I've overridden the child task's GetPriority function to return a weight value that I've set in the inspector.

    Not sure if I'm doing it right or there's a bug with this priority selector node? The priority selector node seems to always selects the right most child task instead of the task with the highest priority?

    $priority_selector.jpg

    Task 3 will always execute no matter what weight I set for the other 2. I've tried moving task 1 and 2 to the right most position and only then they will execute.
     
  16. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Before every release I run a set of unit tests to make sure the runtime still outputs consistent results. One of those tests looks similar to your situation:

    $Capture.PNG

    The task in the middle runs first, followed by the rightmost task, and then the leftmost task. Since the parent task is a selector task, each child task returns failure so all tasks will have a chance to run.

    I just tested it and if all of your weights are the same value then the rightmost task will always run first. The first thing to check is to make sure that the weights are indeed different. The next thing that I would try is to put a breakpoint/debug statement on line 28 of PrioritySelector.cs to see what values the priority selector task is getting from its children:

    Code (csharp):
    1.  
    2. ...
    3.                 int insertIndex = 0;
    4.                 Debug.Log("Child " + i + " priority: " + priority); // <---- here
    5.                 for (int j = 0; j < childrenExecutionOrder.Count; ++j) {
    6.                     if (children[childrenExecutionOrder[j]].GetPriority() < priority) {
    7. ...
    8.  
     
  17. boonyifei

    boonyifei

    Joined:
    Sep 8, 2012
    Posts:
    6
    Thanks for the reply. I'll check the PrioritySelector script as you have suggested.
     
  18. boonyifei

    boonyifei

    Joined:
    Sep 8, 2012
    Posts:
    6
    I've looked at the PrioritySelector.cs script and found a bug.

    Basically if the right most child has the lowest priority, the right most child will be inserted to index 0 of "childrenExecutionOrder" list.
    This is because the for loop compares the current child with those already in the childrenExecutionOrder list, since the right most child has the lowest priority, the "insertIndex" variable will have the default value of 0 and so it will be inserted to the front of the childrenExecutionOrder list.
     
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Good catch. Change

    Code (csharp):
    1.  
    2. int insertIndex = 0;
    3.  
    to
    Code (csharp):
    1.  
    2. int insertIndex = childrenExecutionOrder.Count;
    3.  
    And you should be good to go.
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Version 1.1 has been submitted to the asset store. If you've purchased Behavior Designer from opsive.com you should have already received an email with the changes. I have updated the sample projects and am in the process of updating the documentation/videos. If you haven't seen what is in version 1.1 yet take a look at this post.
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Behavior Designer 1.1 hasn't been approved yet but I have some pretty exciting news:

    The runtime source will be included in the $50 version of Behavior Designer!

    Give me a day or two and I will refund the difference to those who purchased the source version via PayPal. This change will occur in version 1.1.1, which I will submit shortly after version 1.1 is approved.

    Why the change? I could make up a good PR answer such as pointing out the recent license changes to Unreal and CryEngine and say that we wanted to follow in their footsteps, but instead I'll go with the fact that we want Behavior Designer to be available to everyone, including those who want the source code.
     
  22. Spyderworxs

    Spyderworxs

    Joined:
    Aug 21, 2012
    Posts:
    31
    Thanks Opsive, that is much appreciated. Quite the bonus to an already great product.
     
  23. PrisonerOfLies

    PrisonerOfLies

    Joined:
    Dec 6, 2013
    Posts:
    105
    How can i modify a variable in the state, eg. MoveTowards in runtime ?
     
  24. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Can you explain your question more? If you are referring to the Behavior Designer variables feature that version isn't approved yet on the Asset Store (it was submitted on Monday).

    Other than that, modifying variables are just like a regular MonoBehaviour. For example, in the Move Towards task I am modifying the object's position:

    Code (csharp):
    1.  
    2. public override TaskStatus OnUpdate()
    3.    {
    4.       if (Vector3.SqrMagnitude(transform.position - target.position) < 0.1f) {
    5.          return TaskStatus.Success;
    6.       }
    7.       transform.position = Vector3.MoveTowards(transform.position, target.position, speed * Time.deltaTime);
    8.       return TaskStatus.Running;
    9.    }
    10.  
     
  25. PrisonerOfLies

    PrisonerOfLies

    Joined:
    Dec 6, 2013
    Posts:
    105
    yes, the variables feature is what i am refering to.
    and, what if i have a script, not from within the behaviour tree trying to modify the speed which is a var of a state in the behaviour tree ?


    next update will be $70 or still $50 =p
     
  26. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Next update is still $50 - eventually I do plan on increasing the price, but while it is still new I am keeping it at $50.

    For your variable question, in the current version you are going to need to create a blackboard. See the CTF and RTS projects for an example of that. Since that blackboard is a regular MonoBehaviour component you'll be able to use the standard GetComponent and then modify the variables from there.

    When version 1.1 is approved you'll be able to do the same thing by:

    Code (csharp):
    1.  
    2. behaviorTree.GetVariable("MyVariable");
    3.  
     
  27. PrisonerOfLies

    PrisonerOfLies

    Joined:
    Dec 6, 2013
    Posts:
    105
  28. launchpad

    launchpad

    Joined:
    Aug 17, 2007
    Posts:
    95
    Hi, new to Behavior Designer, having problems with the CTF sample (and RTS sample).
    I have a new project using BD 1.0.3. Downloaded and installed CTFRTSSamples1.1.unitypackage
    Prior to removing the RTS example I get this error:
    Assets/Behavior Designer Samples/RTS/Scripts/Tasks/AttackBehaviorTreeReference.cs(9,48): error CS0246: The type or namespace name `BehaviorTreeReference' could not be found. Are you missing a using directive or an assembly reference?
    When I examine the Harvester1 object, the Harvester script is "warning of errors and that it can't be loaded" and the Behavior Tree script is empty with no behaviors listed in the BehaviorDesigner.

    After removing the RTS sample (as I will look at it later)

    I get the lots of errors along the lines:
    Assets/Behavior Designer Samples/CTF/Scripts/Tasks/Celebrate.cs(8,6): error CS0246: The type or namespace name `TaskCategory' could not be found. Are you missing a using directive or an assembly reference?
    There appears to be no behaviors in the BehaviorDesigner interface and the Defender objects have load error on the NPC script.

    Any help most welcomed.
    Thanks, Peter
     
  29. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
  30. launchpad

    launchpad

    Joined:
    Aug 17, 2007
    Posts:
    95
    Excellent.

    Off to have some fun with CTF.

    Thanks.
     
  31. BenbowMAS

    BenbowMAS

    Joined:
    Jul 16, 2013
    Posts:
    13
    Hi Opsive ...
    I have a very strange issue actually.. I create some prefabs with behavior tree, and i put just one of them in the scene ... The others are in the resources folders and are linked to the first one..
    My issue is : I create a prefab for test, and after that i delete it.. But he is still instantiate on my scene, without any link on any prefab. Brief, i have a game object with a behavior tree instantiate on my scene and coming from nowhere ? have you any explanation ? is there a "cache" system or something ?

    Edit : Second question, like i said i do have one BT game object on my scene, who call an external BT, placed on the ressource folder. But there is some BT in the resources folder who calls other BT also in the ressources folder. The link worked apparently, but not the call ? what do you think ?
     
    Last edited: Mar 24, 2014
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    I think both of those issues relate to the serialization of objects derived from UnityEngine.Object. Unity does its own serialization of those objects behind the scenes so it is tricky to reference them. In version 1.1.1 I finally think that I found a robust solution (and objects no longer need to be in a resources folder!). I'll send you a PM with a link to the latest version so you can try it out.
     
    Last edited: Mar 24, 2014
  33. BenbowMAS

    BenbowMAS

    Joined:
    Jul 16, 2013
    Posts:
    13
    Okay, i fixed the strange "nowhere instantiation " .. but apparently calling external BT from resources folder to resources folder still dosn't work ..
    I'll continue to try until your version!
     
  34. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    I sent you a PM with a link to the latest version - did you see it? Also, I have a unit test that tests the external to external behavior tree call and from what I've seen it is working. If version 1.1.1 doesn't fix it for you I'd like to get a little more details on your setup (but hopefully 1.1.1 will fix it!)
     
  35. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    57
    Hi Opsive ...
    I try to stop a uScript node, but it's not work,how can i stop a uscript node from outside?or how to trigger the End Signal? (i use v1.03) tks!
    The Perform Interruption Node is linked with Interrupt Node already.
    $111.png $222.png
     
    Last edited: Mar 25, 2014
  36. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    When I switched Behavior Designer over to using namespaces I forgot to change the part that sends the stop signal to PlayMaker/uScript. This change will not be in version 1.1.1 but I'll send you the fixed version over PM now. Thanks for letting me know about it.
     
  37. dkoontz

    dkoontz

    Joined:
    Aug 7, 2009
    Posts:
    198
    I've just purchased Behavior Designer and I'm trying to implement my own variation of the MoveTowards task that is shown in your video and in the documentation. If I copy paste the code from the docs it cannot compile because SharedTransform is not defined. Did you update your documentation without uploading a new version of the asset?
     
  38. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Yes.. the documentation has been updated but Unity still hasn't approved the latest version yet. Here's the old version of MoveTowards:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using BehaviorDesigner.Runtime;
    4. using BehaviorDesigner.Runtime.Tasks;
    5.  
    6. public class MoveTowards : Action
    7. {
    8.    // The speed of the object
    9.    public float speed = 0;
    10.    // The transform that the object is moving towards
    11.    public Transform target;
    12.  
    13.    public override TaskStatus OnUpdate()
    14.    {
    15.       // Return a task status of success once we've reached the target
    16.       if (Vector3.SqrMagnitude(transform.position - target.position) < 0.1f) {
    17.          return TaskStatus.Success;
    18.       }
    19.       // We haven't reached the target yet so keep moving towards it
    20.       transform.position = Vector3.MoveTowards(transform.position, target.position, speed * Time.deltaTime);
    21.       return TaskStatus.Running;
    22.    }
    23. }
    24.  
    Sorry about that.
     
  39. dkoontz

    dkoontz

    Joined:
    Aug 7, 2009
    Posts:
    198
    Ok, I can work with that for now. One other question, you use public for variables as is commonly done on MonoBehaviours but I Unity also supports the [SerializeField] attribute which is how I prefer to expose my variables. Would it be possible to support that method of exposing variables on Tasks as well?
     
  40. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    Definitely. I'll work on that tonight and send you a PM after I get it done.
     
    Last edited: Mar 25, 2014
  41. BenbowMAS

    BenbowMAS

    Joined:
    Jul 16, 2013
    Posts:
    13
    hi again ...
    i always get this kind of error that i can't track

    NullReferenceException: Object reference not set to an instance of an object
    BehaviorDesigner.Runtime.BehaviorManager.addToTaskList

    i don't get the way to fix it .. if you have something, i take! and your 1.1 version give me a lot of bugs, and my past behavior tree was unreacheable ... i switch again in the actual version .

    Thank you
     
  42. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    hmm.. can you PM or email me the behavior tree that you are using so I can take a closer look at it?
     
  43. dkoontz

    dkoontz

    Joined:
    Aug 7, 2009
    Posts:
    198
    I got the new version you sent over via email and the SharedFloat is working now, thanks! My next question would be regarding the types that can be stored in variables. I notice there is an Object but that is a Unity.Object and not a System.Object. Would it be possible to implement a SharedXXX that supports a basic System.Object so that I can pass in any custom type and cast it in the Task? Ideally this would be a SharedObject<T> so that the cast would not be necessary, but that might make your editor more complex.
     
  44. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    I have a version of Behavior Designer that will show private fields marked with SerialzeField. I'll send you a PM. Relating to supporting System.object, that one is tougher because of serialization. When you save a behavior tree out to a prefab/asset file Behavior Designer does its own serialization because the class that task is derived from (ScriptableObject) does not serialize well outside of the scene. With each release Behavior Designer's serialization is getting better and better though so I'll support it as soon as I can figure out a good way.

    ----

    I am starting to send out the latest version to more and more people so I want to explain the process of updating to the latest version. The data format that the behavior trees are stored in has changed since version 1.0.3 to accommodate being about to export to an asset file. This means that when you open up Behavior Designer with an old format behavior tree you'll get the following message:

    $update.PNG

    As soon as you hit OK the following window will appear:

    $updatewindow.PNG

    Once you hit update you should never have to see either of those two messages again. You can also access this window from the Window/Behavior Designer Update Tool menu item. If for some reason you don't update and choose to run the behavior tree as it is you'll see the following messages in your console:


    I did a lot of testing to make sure no data would be lost but as with all changes there is a chance something bad can happen so make sure you have a backup of your behavior tree first. If something bad does happen please get in contact with me.


    With this update you will also see two other warning messages. The first one tells you that the shared/synchronized field has been deprecated:
    And the second one tells you that the External Behavior Tree task has been deprecated:
    That should be all of the warnings that you'll see when you update to the latest version. If you have any problems at all please let me know.
     
    Last edited: Mar 26, 2014
  45. the_solitude_of_noble_soul

    the_solitude_of_noble_soul

    Joined:
    Mar 26, 2014
    Posts:
    1
    Hi opsive.
    I pretty new to Behavior Tree. I am interested your plugin. But I can not decide if it would fit my workflow or not if I can not evaluate it directly. And sorry, It may sound pathetic but I don't really want to risk my hard earned money because 50 buck is a pretty sum im my country. So it would be very nice of you if you can make some kind of free version to test out Behavior Tree like Playmaker or uScript. Well... sorry for my abrupt request but I am look forward to hear some good new from you if you can do it.
    Thanks and have a nice day for you, opsive.
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,735
    No I completely understand. I do have some pretty neat plans with a free version but I am not to that point yet. I'd be happy to answer any questions that you have about the workflow if that will help at all. Also, if you do end up purchasing it and find that it doesn't fit your style then I am happy to help get in touch with Unity to refund it.
     
  47. MitchStan

    MitchStan

    Joined:
    Feb 26, 2007
    Posts:
    518
    Following your example, I created several test tasks with various weights and no matter what I do the node to the far right is the only one that executes. It doesn't seem to matter what the weight is set to.

    I took your Log Task and added the GetPriority function and a public float weight.

    Code (csharp):
    1. using UnityEngine;
    2.  
    3. namespace BehaviorDesigner.Runtime.Tasks
    4. {
    5.     // Log is a simple task which will output the specified text and return success. It can be used for debugging.
    6.     [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=16")]
    7.     [TaskIcon("{SkinColor}LogIcon.png")]
    8.     public class Log : Action
    9.     {
    10.         // Text to output to the log.
    11.         public string text = "";
    12.         // Is this text an error?
    13.         public bool logError = false;
    14.  
    15.  
    16.         public float weight;
    17.  
    18.  
    19.         public override TaskStatus OnUpdate()
    20.         {
    21.             // Log the text and return success
    22.             if (logError) {
    23.                 Debug.LogError(text);
    24.             } else {
    25.                 Debug.Log(text);
    26.             }
    27.             return TaskStatus.Success;
    28.         }
    29.  
    30.  
    31.         public override void OnReset()
    32.         {
    33.             // Reset the properties back to their original values
    34.             text = "";
    35.             logError = false;
    36.         }
    37.  
    38.  
    39.         public override float GetPriority()
    40.         {
    41.            return weight;
    42.         }
    43.     }
    44. }
    Any thoughts as to what I could be doing wrong?

    Mitch
     
    Last edited: Mar 26, 2014
  48. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    57
    Hi opsive. thank you for fix bug i posted before.
    and earlier, I found this graph will send a error message:
    ArgumentOutOfRangeException: Argument is out of range.Parameter name: index
    If i change the Parallel node(below Interrupt Node) to sequence node,it will be ok.It seems the problem exist in Interrupt the parallel node.
    $bug0.jpg

    And a little visual problem.when i use scale the graph, the link line between nodes seems to be invisible,like this:

    $123.jpg
     
    Last edited: Mar 26, 2014
  49. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    57
    Hi opsive!
    I test the version you send me.the uscript node's End Signal is exist now,thank you!
    I continue to design uscript node,and found another problem, it's not a bug, but i don't know how to do with it:
    I design uscript node like this,and want to stop the node in two situation:
    1.stop it from behavior designer's interrupt
    2.stop it from input event in script node
    I found when i combine these two, problem appear. When node ends(whatever it stop by input inside or interrupt outside), "End Signal" send event to "Resume Behavior Tree" return false,it create a loop,and get error message :
    "KeyNotFoundException: The given key was not present in the dictionary."
    and the End Signal run twice,you can see two log of it.
    whatever stop from inside or outside, the End Signal fire event all.
    Maybe End Signal can only fire event when stop from outside?because when user take the initiative to stop it from inside, they don't need End Signal call back.
     

    Attached Files:

    Last edited: Mar 26, 2014
  50. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    57
    Thank You!
     

    Attached Files:

    • $ccc.jpg
      $ccc.jpg
      File size:
      28.3 KB
      Views:
      1,009
    • $aaa.jpg
      $aaa.jpg
      File size:
      77.4 KB
      Views:
      799
    • $bbb.jpg
      $bbb.jpg
      File size:
      12.4 KB
      Views:
      770
    Last edited: Mar 26, 2014
unityunity