Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
quick:timelimit [2018/06/22 16:05] kevinamoresquick:timelimit [2018/06/22 16:16] – [Explanation of the example] kevinamores
Line 12: Line 12:
  
  
-![The enemy behavior with the time limit decorator](images/ProgrammersQuickStartGuide/TimeLimitTree.png "Behavior with the time limit decorator node.")+![The enemy behavior with the time limit decorator](quick/TimeLimitTree.png "Behavior with the time limit decorator node.")
  
 The BT built for the example does the following when given to an enemy. The BT starts with a repeat node which is followed by a selector, this selector has 2 branches, the first one sets the enemy to chase the player giving it a time to complete the action with the time limit decorator(we have set the time to 5 seconds in this example) if the enemy manages to catch the player withing that time frame, it stays near the player and if the players separates from him the repeat node at the start of the tree will make the enemy continue to chase the player. Otherwise if the enemy doesn't manage to catch the player, the time limit decorator aborts the execution of the child node and making the selector go to the other branch wich self destroys the enemy. The BT built for the example does the following when given to an enemy. The BT starts with a repeat node which is followed by a selector, this selector has 2 branches, the first one sets the enemy to chase the player giving it a time to complete the action with the time limit decorator(we have set the time to 5 seconds in this example) if the enemy manages to catch the player withing that time frame, it stays near the player and if the players separates from him the repeat node at the start of the tree will make the enemy continue to chase the player. Otherwise if the enemy doesn't manage to catch the player, the time limit decorator aborts the execution of the child node and making the selector go to the other branch wich self destroys the enemy.