• Visit Rebornbuddy
  • Question about adding composites to behavior tree

    Discussion in 'Community Developer Forum' started by mistahmikey, Jan 23, 2016.

    1. mistahmikey

      mistahmikey New Member

      Joined:
      Jun 29, 2015
      Messages:
      161
      Likes Received:
      3
      Trophy Points:
      0
      I am trying to add some behavior on the fly to the GrindTag via my "WhileCondition" routine. In this routine, I execute the following:

      Code:
                      spiritBonder =
                          new ActionRunCoroutine(
                                  r =>
                                  SpiritBonder(
                                      getArmoryConvertiblesDelegate,
                                      canEquipmentBeReplacedDelegate));
      
                      TreeHooks.Instance.AddHook("SpiritBonder", spiritBonder);
      
      However, the action never runs (and I have verified that it is actually added to the tree). If I change the AddHooks call to:

      TreeHooks.Instance.InsertHook("TreeStart", 0 spiritBonder);

      Then the action runs, but the GrindTag behavior does not run.

      So can someone please enlighten me as to the proper way to tack a custom behavior onto the tree from within a Tag?

      Thanks :)
       
    2. mistahmikey

      mistahmikey New Member

      Joined:
      Jun 29, 2015
      Messages:
      161
      Likes Received:
      3
      Trophy Points:
      0
      Ok, I figured out what the problem was - I was returning "true" from SpiritBonder when I should have been returning "false". Now everything runs. However...

      I am unclear on how the various "locations" in the behavior tree work. In particular, why would I want to choose one over another as a place to inject my behavior? Or should I use my own unique location, and if so, how do I get it to actually execute? Do the different locations have different execution properties (e.g., does "PreCombatBuff" only pulse just prior to the character engaging in combat?) Any additional information you care to share about how the various locations work and what "best practices" are applicable to them would be appreciated.
       

    Share This Page