This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| dragengine:modules:dragonscript:behavior_forcefield [2025/04/30 19:59] – [Behavior Tree Actions] dragonlord | dragengine:modules:dragonscript:behavior_forcefield [2026/10/09 17:05] (current) – dragonlord | ||
|---|---|---|---|
| Line 20: | Line 20: | ||
| ====== Element Class Properties ====== | ====== Element Class Properties ====== | ||
| Element class properties have the prefix '' | Element class properties have the prefix '' | ||
| - | |||
| - | ===== influenceArea ===== | ||
| - | Set influence area. Geometry touching this shape is affected by this force field. | ||
| - | * Full name: '' | ||
| - | * Type: string (shape format). See "Shape List Encoding" | ||
| - | * Default Value: empty string | ||
| - | * Example (*.deeclass) <code xml>< | ||
| - | |||
| - | ===== radius ===== | ||
| - | Set falloff radius. Geometry inside this distance from the border is faded out gradually. | ||
| - | * Full name: '' | ||
| - | * Type: float | ||
| - | * Default Value: '' | ||
| - | * Restriction: | ||
| - | * Example (*.deeclass) <code xml>< | ||
| - | |||
| - | ===== exponent ===== | ||
| - | Set falloff exponent. Shape of the fading out applied due to radius. Value of '' | ||
| - | * Full name: '' | ||
| - | * Type: float | ||
| - | * Default Value: 1 | ||
| - | * Restriction: | ||
| - | * Example (*.deeclass) <code xml>< | ||
| - | |||
| - | ===== fieldType ===== | ||
| - | Set field type. | ||
| - | * Full name: '' | ||
| - | * Type: enumeration | ||
| - | * < | ||
| - | ^Value^Description^ | ||
| - | |'' | ||
| - | |'' | ||
| - | |'' | ||
| - | </ | ||
| - | * Default Value: '' | ||
| - | * Example (*.deeclass) <code xml>< | ||
| ===== applicationType ===== | ===== applicationType ===== | ||
| Line 70: | Line 34: | ||
| * Default Value: '' | * Default Value: '' | ||
| * Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
| + | |||
| + | ===== bone ===== | ||
| + | Set bone to attach resource to. If empty string attach to collider. | ||
| + | * Full name: '' | ||
| + | * Type: string | ||
| + | * Default Value: empty string | ||
| + | * Example (*.deeclass) <code xml>< | ||
| ===== direction ===== | ===== direction ===== | ||
| Line 78: | Line 49: | ||
| * Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
| - | ===== force ===== | + | ===== collisionFilter |
| - | Set force in newton. Negative force reverse direction. | + | |
| - | * Full name: '' | + | Set [[gamedev: |
| + | * Full name: '' | ||
| + | * Type: string. Format can be '' | ||
| + | * Default Value: '' | ||
| + | * Example (*.deeclass) <code xml>< | ||
| + | |||
| + | ===== enabled ===== | ||
| + | Set force field enabled. | ||
| + | * Full name: '' | ||
| + | * Type: boolean | ||
| + | * Default Value: true | ||
| + | * Example (*.deeclass) <code xml>< | ||
| + | |||
| + | ===== exponent ===== | ||
| + | Set falloff exponent. Shape of the fading out applied due to radius. Value of '' | ||
| + | * Full name: '' | ||
| * Type: float | * Type: float | ||
| * Default Value: 1 | * Default Value: 1 | ||
| - | * Example (*.deeclass) <code xml>< | + | |
| + | | ||
| + | |||
| + | ===== fieldType ===== | ||
| + | Set field type. | ||
| + | * Full name: '' | ||
| + | * Type: enumeration | ||
| + | * < | ||
| + | ^Value^Description^ | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | </ | ||
| + | * Default Value: '' | ||
| + | * Example (*.deeclass) <code xml>< | ||
| ===== fluctuationDirection ===== | ===== fluctuationDirection ===== | ||
| Line 99: | Line 99: | ||
| * Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
| - | ===== enabled | + | ===== force ===== |
| - | Set force field enabled. | + | Set force in newton. Negative force reverse direction. |
| - | * Full name: '' | + | * Full name: '' |
| - | * Type: boolean | + | * Type: float |
| - | * Default Value: | + | * Default Value: |
| - | * Example (*.deeclass) <code xml><boolean | + | * Example (*.deeclass) <code xml><float name=' |
| - | ===== shape ===== | + | ===== influenceArea |
| - | Set shape from which the force originates. If not set force originates from origin position. | + | Set influence area. Geometry touching this shape is affected by this force field. |
| - | * Full name: '' | + | * Full name: '' |
| * Type: string (shape format). See "Shape List Encoding" | * Type: string (shape format). See "Shape List Encoding" | ||
| * Default Value: empty string | * Default Value: empty string | ||
| - | * Example (*.deeclass) <code xml>< | + | * Example (*.deeclass) <code xml>< |
| + | |||
| + | ===== orientation ===== | ||
| + | Set orientation to attach resource to collider in degrees. | ||
| + | * Full name: '' | ||
| + | * Type: 3-component float vector | ||
| + | * Default Value: (0,0,0) | ||
| + | * Example (*.deeclass) <code xml>< | ||
| ===== position ===== | ===== position ===== | ||
| Line 120: | Line 127: | ||
| * Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
| - | ===== orientation | + | ===== radius |
| - | Set orientation to attach resource to collider in degrees. | + | Set falloff radius. Geometry inside this distance from the border is faded out gradually. |
| - | * Full name: '' | + | * Full name: '' |
| - | * Type: 3-component | + | * Type: float |
| - | * Default Value: | + | * Default Value: |
| - | * Example (*.deeclass) <code xml><vector | + | * Restriction: |
| + | * Example (*.deeclass) <code xml><float name=' | ||
| - | ===== bone ===== | + | ===== shape ===== |
| - | Set bone to attach resource to. If empty string attach to collider. | + | Set shape from which the force originates. If not set force originates from origin position. |
| - | * Full name: '' | + | * Full name: '' |
| - | * Type: string | + | * Type: string |
| * Default Value: empty string | * Default Value: empty string | ||
| - | * Example (*.deeclass) <code xml>< | + | * Example (*.deeclass) <code xml>< |
| ===== trigger ===== | ===== trigger ===== | ||
| Line 166: | Line 174: | ||
| ^Parameter^Value^Description^ | ^Parameter^Value^Description^ | ||
| - | |enabled|true, | + | |enabled|'' |
| This is an example of using this action: | This is an example of using this action: | ||
| Line 180: | Line 188: | ||
| ^Parameter^Value^Description^ | ^Parameter^Value^Description^ | ||
| - | |enabled|true, | + | |enabled|'' |
| + | |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 194: | Line 203: | ||
| ====== 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 '' | + | This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace '' |
| ===== forceField.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 a 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^ | ^Parameter^Value^Description^ | ||
| - | |forceField.enabled|true, | + | |forceField.enabled|'' |
| This is an example of using this condition: | This is an example of using this condition: | ||
| Line 210: | Line 219: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | ====== State Machine Actions ====== | ||
| + | |||
| + | Same as [[# | ||
| + | |||
| + | ====== State Machine Conditions ====== | ||
| + | |||
| + | Same as [[# | ||
| + | |||
| + | ====== State Machine Events ====== | ||
| + | |||
| + | This behavior sends these state machine events. If behavior has non-empty identifier replace '' | ||
| + | |||
| + | ===== forceField.enabled ===== | ||
| + | |||
| + | Force field has been enabled. | ||
| + | |||
| + | ===== forceField.disabled ===== | ||
| + | |||
| + | Force field has been disabled. | ||
| ====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
| Line 218: | Line 247: | ||
| * [[behavior_collider|ECBehaviorCollider]]: | * [[behavior_collider|ECBehaviorCollider]]: | ||
| + | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
| + | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
| + | |||
| ====== Persistency ====== | ====== Persistency ====== | ||
| Line 260: | Line 292: | ||
| | | ||
| < | < | ||
| - | <!-- optional: set collision filter. default value '6:0 1 2 3 5' which means | ||
| - | | ||
| - | | ||
| - | BaseGameApp.CollisionFilterBit.dynamic, | ||
| - | BaseGameApp.CollisionFilterBit.actor, | ||
| - | BaseGameApp.CollisionFilterBit.actorAI, | ||
| - | BaseGameApp.CollisionFilterBit.particle. | ||
| - | | ||
| - | are a list of bits to set. --> | ||
| - | <string name=' | ||
| - | | ||
| <!-- optional: use BaseGameApp trigger table. game can add more | <!-- optional: use BaseGameApp trigger table. game can add more | ||
| | | ||
| Line 282: | Line 303: | ||
| <string name=' | <string name=' | ||
| | | ||
| - | <!-- optional: | + | <!-- optional: |
| - | <string | + | <list name=' |
| + | < | ||
| + | <string> | ||
| + | </list> | ||
| + | |||
| + | <!-- optional: add state machines. default adds all state machines. --> | ||
| + | < | ||
| + | | ||
| + | <string> | ||
| + | </list> | ||
| | | ||
| <!-- set element properties. omit property prefix if used inside behavior tag --> | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||