Announcement

Collapse
No announcement yet.

Behaviour Tree, how to execute a task only once

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Behaviour Tree, how to execute a task only once

    Hi guys,

    I am working on my Boss BT and I want to execute a task when he is gets lower than 50% hp but only once.

    Is there any decorator or something else to do this?
    Thanks!

    #2
    The most obvious method is to use a trigger.

    If you want to implement via trigger

    Click image for larger version

Name:	Screenshot_20200305_125255.png
Views:	607
Size:	97.3 KB
ID:	1729233

    If you are using timers

    Click image for larger version

Name:	Screenshot_20200305_125430.png
Views:	520
Size:	72.7 KB
ID:	1729232

    Comment


      #3
      Originally posted by MrChebik View Post
      The most obvious method is to use a trigger.
      This can work in normal gameplay BP. But it doesn't work for a behaviour tree task BP.

      So far I think to make a specific task run once is to use a selector compositor and then add decorators to that one-time task. One decorator example would be to check if health is above 50% (which blocks the task if it's true). Then add a Blackboard boolean key (Done 50% HP task?) that is set once task is performed once and another decorator to check that blackboard key. If it's true (task has been done before) then it will block the flow to that from playing it after it played once already.
      Last edited by Shenawy; 06-10-2020, 04:21 AM.

      Comment

      Working...
      X