User Tools

Site Tools


dragengine:modules:dragonscript:behavior_forcefield

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_forcefield [2025/04/30 15:37] dragonlorddragengine:modules:dragonscript:behavior_forcefield [2025/05/12 21:26] (current) dragonlord
Line 140: Line 140:
   * Default Value: state of ''enabled''   * Default Value: state of ''enabled''
   * Example (*.deeclass) <code xml><string name='forceField.trigger'>@switchOnVent & @powerEnabled</string></code>   * Example (*.deeclass) <code xml><string name='forceField.trigger'>@switchOnVent & @powerEnabled</string></code>
- 
-===== btActionName ===== 
-Set action name to use for actions and conditions added to behavior tree. If empty string no actions and conditions are added to the behavior tree. 
-  * Full name: ''forceField.btActionName'' or ''forceField({id}).btActionName'' 
-  * Type: string 
-  * Default Value: empty string 
-  * Example (*.deeclass) <code xml><string name='forceField.btActionName'>ventilatorForceField</string></code> 
  
 ====== Events ====== ====== Events ======
Line 166: Line 159:
 ====== Behavior Tree Actions ====== ====== Behavior Tree Actions ======
  
-This behavior adds these behavior tree actions if ''btActionName'' property is not empty string.+This behavior adds these behavior tree actions if behavior tree is present. If behavior has non-empty identifier replace ''forceField'' with ''forceField(id)''.
  
-===== btActionName.set =====+===== forceField.set =====
  
 Set one or more force field parameters. Set one or more force field parameters.
  
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
-|enabled|true,false|Enable force field|+|enabled|''true''''false''|Enable force field|
  
 This is an example of using this action: This is an example of using this action:
 <code xml> <code xml>
-<action name='ventilatorForceField.set'>+<action name='forceField.set'>
   <parameter name='enabled'>true</parameter>   <parameter name='enabled'>true</parameter>
 </action> </action>
 </code> </code>
  
-===== btActionName.check =====+===== forceField.check =====
  
 Check one or more force field parameters. Action succeeds if all parameter value matches their respective force field parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a force field parameter matches (or not). Check one or more force field parameters. Action succeeds if all parameter value matches their respective force field parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a force field parameter matches (or not).
  
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
-|enabled|true,false|Force field is enabled or not| +|enabled|''true''''false''|Force field is enabled or not| 
 +|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:
 <code xml> <code xml>
 <sequence> <sequence>
-  <action name='ventilatorForceField.check'>+  <action name='forceField.check'>
     <parameter name='enabled'>true</parameter>     <parameter name='enabled'>true</parameter>
   </action>   </action>
Line 202: Line 195:
 ====== Behavior Tree Conditions ====== ====== Behavior Tree Conditions ======
  
-This behavior adds these behavior tree conditions if ''btActionName'' property is not empty string.+This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace ''forceField'' with ''forceField(id)''.
  
-===== btActionName.check =====+===== forceField.check =====
  
-Check one or more force field parameters. Conditions returns true if all parameter value match their respective force field parameter. This condition is typically used to run an action or sequence of actions as long as force field condition is true.+Check one or more force field parameters. Conditions returns true if all parameter value match their respective force field parameter. This condition is typically used to run an action or sequence of actions as long as force field conditions are true. 
 + 
 +^Parameter^Value^Description^ 
 +|forceField.enabled|''true'', ''false''|Force field is enabled or not|
  
 This is an example of using this condition: This is an example of using this condition:
 <code xml> <code xml>
 <action name='myAction' id='doing something'> <action name='myAction' id='doing something'>
-  <parameter name='btActionName.enabled'>true</parameter> +  <parameter name='forceField.enabled'>true</parameter> 
-  <condition>btActionName.check</condition>+  <condition>forceField.check</condition>
 </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. If behavior has non-empty identifier replace ''forceField'' with ''forceField(id)''.
 +
 +===== forceField.enabled =====
 +
 +Force field has been enabled.
 +
 +===== forceField.disabled =====
 +
 +Force field has been disabled.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 223: Line 239:
  
   * [[behavior_collider|ECBehaviorCollider]]: Attach force field to collider.   * [[behavior_collider|ECBehaviorCollider]]: Attach force field to collider.
 +  * [[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 ======
Line 287: Line 306:
     <string name='trigger.synchronize'>other</string>     <string name='trigger.synchronize'>other</string>
          
-    <!-- optional: use behavior tree with id instead of empty string --> +    <!-- optional: add behavior trees. default adds all behavior trees. --> 
-    <string name='behaviorTree'>second</string>+    <list name='behaviorTrees'> 
 +      <string/> <!-- add behavior with empty identifier --> 
 +      <string>default</string> <!-- add behavior with 'default' identifier --> 
 +    </list> 
 +     
 +    <!-- optional: add state machines. default adds all state machines. --> 
 +    <list name='stateMachines'> 
 +      <string/> <!-- add behavior with empty identifier --> 
 +      <string>default</string> <!-- add behavior with 'default' identifier --> 
 +    </list>
          
     <!-- set element properties. omit property prefix if used inside behavior tag -->     <!-- set element properties. omit property prefix if used inside behavior tag -->
dragengine/modules/dragonscript/behavior_forcefield.1746027442.txt.gz · Last modified: 2025/04/30 15:37 by dragonlord