Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
quick:timelimit [2018/06/22 16:16] – [Explanation of the example] kevinamoresquick:timelimit [2020/09/03 09:29] pedro
Line 1: Line 1:
 +<markdown>
 +
 # Time Limit Decorator Guide # Time Limit Decorator Guide
 This tutorial continues the small example created in the BT tutorials, where the player moves his avatar in the "environment" (a mere plane) using mouse clicks, and the enemy wanders around and pursues the player when he is near enough. We encourage you to follow that tutorial in the first place but, if you are impatient, its final version (and the starting point for this guide) is available in the Behavior Bricks package, under `Samples\QuickStartGuide\Done` folder. Obviously, you are supposed to have been loaded Behavior Bricks into a new Unity project. Refer to the download instructions in other case. This tutorial continues the small example created in the BT tutorials, where the player moves his avatar in the "environment" (a mere plane) using mouse clicks, and the enemy wanders around and pursues the player when he is near enough. We encourage you to follow that tutorial in the first place but, if you are impatient, its final version (and the starting point for this guide) is available in the Behavior Bricks package, under `Samples\QuickStartGuide\Done` folder. Obviously, you are supposed to have been loaded Behavior Bricks into a new Unity project. Refer to the download instructions in other case.
Line 12: Line 14:
  
  
-![The enemy behavior with the time limit decorator](quick/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.
Line 20: Line 22:
 To set the Time Limit, go to the node, and in the node tab there is a parameter called "TimeLimit" which we have set for default to 5. Change it for the number (in secods) that you desire. To set the Time Limit, go to the node, and in the node tab there is a parameter called "TimeLimit" which we have set for default to 5. Change it for the number (in secods) that you desire.
  
 +</markdown>