Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions script_templates/BTComposite/new_composite.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends BTComposite


# Gets called every tick of the behavior tree
# `leaves` is an array of the children of this node set @onready
func tick(actor: Node, blackboard: Blackboard) -> Status:
# Logic for ticking one or more leaves
# Return Status depending on the result of the leaves
# Return Status.RUNNING, if there are still leaves to tick
return Status.SUCCESS
11 changes: 11 additions & 0 deletions script_templates/BTDecorator/new_decorator.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends BTDecorator


# Gets called every tick of the behavior tree
# `leaf` is the child of this decorator and is automatically set @onready
func tick(actor: Node, blackboard: Blackboard) -> Status:
var response = leaf.tick(actor, blackboard)

# Augment the response of the leaf

return response
3 changes: 3 additions & 0 deletions script_templates/BTLeaf/new_leaf.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
extends BTLeaf


# Gets called every tick of the behavior tree
func tick(_actor: Node, _blackboard: Blackboard) -> Status:
# Handle leaf logic
# Return SUCCESS, FAILURE, or RUNNING
return Status.SUCCESS
6 changes: 3 additions & 3 deletions script_templates/FSMState/new_state.gd
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
extends FSMState


## Executes after the state is entered.
# Executes after the state is entered.
func _on_enter(_actor: Node, _blackboard: Blackboard) -> void:
pass


## Executes every _process call, if the state is active.
# Executes every _process call, if the state is active.
func _on_update(_actor: Node, _blackboard: Blackboard) -> void:
pass


## Executes before the state is exited.
# Executes before the state is exited.
func _on_exit(_actor: Node, _blackboard: Blackboard) -> void:
pass
4 changes: 2 additions & 2 deletions script_templates/FSMTransition/new_transition.gd
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extends FSMTransition

## Executed when the transition is taken.
# Executed when the transition is taken.
func _on_transition(_actor: Node, _blackboard: Blackboard) -> void:
pass


## Evaluates true, if the transition conditions are met.
# Evaluates true, if the transition conditions are met.
func is_valid(_actor: Node, _blackboard: Blackboard) -> bool:
return false