User Tools

Site Tools


dragengine:modules:dragonscript:behavior_stashable

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dragengine:modules:dragonscript:behavior_stashable [2025/05/02 21:40] – [Behavior Factory] dragonlorddragengine:modules:dragonscript:behavior_stashable [2025/05/13 14:10] (current) dragonlord
Line 65: Line 65:
 ====== Behavior Tree Actions ====== ====== Behavior Tree Actions ======
  
-This behavior adds these behavior tree actions if behavior tree is present. If behavior has non-empty identifier replace ''stashable'' with ''stashable(id)''.+This behavior adds these behavior tree actions if behavior tree is present.
  
-===== stashable.remove =====+===== stashable.update =====
  
-Remove stashable from inventory if located in one.+Update stashable.
  
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
-|dispose| |If present dispose of the stashable after removing it from the inventory, no matter if present in one or not|+|remove|empty string, ''dispose''|Remove stashable from inventory if located in one. If value is ''dispose'' disposes of element (even if not in an inventory) and returns BTResult.running to stop the behavior tree.| 
 +|interactElement.assign|string|Assign inventory element to [[behavior_interactelement|ECBehaviorInteractElement]] with identifier matching value string. Action fails if not stashed or interact element behavior is absent| 
 +|interact|string|Interact with inventory. If element is absent action fails. Runs interaction with name value. If interaction with name value is absent fails action. If interaction returns false fails action. Otherwise action succeeds.| 
 +|interact.parameters|string|Optional parameters to use with ''interaction''.|
  
 This is an example of using this action: This is an example of using this action:
 <code xml> <code xml>
-<action name='stashable.remove'> +<action name='stashable.update'> 
-  <parameter name='dispose'>true</parameter>+  <parameter name='remove'>dispose</parameter>
 </action> </action>
 </code> </code>
Line 87: Line 90:
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
 |stashed|''true'', ''false''|Stashable is located in an inventory| |stashed|''true'', ''false''|Stashable is located in an inventory|
 +|interact.name|string|Name of interaction|
 +|interact.has|''true'', ''false''|Has inventory and interaction with name ''interaction.name'' is present|
 +|interact.query|''true'', ''false''|Interact with inventory and test result. Condition is true if inventory is present, interaction with name ''interaction.name'' is present and interaction returns true. It is recommended to use here only interactions without side effects (hence query interactions).|
 +|interact.parameters|string|Optional parameters to use with ''interaction.query''.|
 +|wait| |If present action returns BTResult.running instead of BTResult.failed to wait until the checks are all fulfilled|
  
 This is an example of using this action: This is an example of using this action:
Line 100: Line 108:
 ====== Behavior Tree Conditions ====== ====== Behavior Tree Conditions ======
  
-This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace ''stashable'' with ''stashable(id)''.+This behavior adds these behavior tree conditions if behavior tree is present.
  
 ===== stashable.check ===== ===== stashable.check =====
Line 108: Line 116:
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
 |stashable.stashed|''true'', ''false''|Stashable is located in an inventory| |stashable.stashed|''true'', ''false''|Stashable is located in an inventory|
 +|stashable.interact.name|string|Name of interaction|
 +|stashable.interact.has|''true'', ''false''|Has inventory and interaction with name ''interaction.name'' is present|
 +|stashable.interact.query|''true'', ''false''|Interact with inventory and test result. Condition is true if inventory is present, interaction with name ''interaction.name'' is present and interaction returns true. It is recommended to use here only interactions without side effects (hence query interactions).|
 +|stashable.interact.parameters|string|Optional parameters to use with ''interaction.query''.|
  
 This is an example of using this condition: This is an example of using this condition:
Line 116: Line 128:
 </action> </action>
 </code> </code>
 +
 +====== State Machine Actions ======
 +
 +Same as [[#behavior_tree_actions|Behavior Tree Actions]].
 +
 +====== State Machine Conditions ======
 +
 +Same as [[#behavior_tree_conditions|Behavior Tree Conditions]].
 +
 +====== State Machine Events ======
 +
 +This behavior sends these state machine events.
 +
 +===== stashable.added =====
 +
 +Stashable has been added to inventory.
 +
 +===== stashable.removed =====
 +
 +Stashable has been removed from slot.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 124: Line 156:
  
   * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use.   * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use.
 +  * [[behavior_statemachine|ECBehaviorStateMachine]]: Add actions and conditions for state machine to use and events to send to the state machine.
  
 ====== Persistency ====== ====== Persistency ======
dragengine/modules/dragonscript/behavior_stashable.1746222024.txt.gz · Last modified: 2025/05/02 21:40 by dragonlord