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/05/02 21:45] – 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 181: | Line 189: | ||
| ^Parameter^Value^Description^ | ^Parameter^Value^Description^ | ||
| |enabled|'' | |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 221: | Line 230: | ||
| ====== State Machine Events ====== | ====== State Machine Events ====== | ||
| - | This behavior sends these state machine events: | + | This behavior sends these state machine events. If behavior has non-empty identifier replace '' |
| - | ===== enabled ===== | + | ===== forceField.enabled ===== |
| Force field has been enabled. | Force field has been enabled. | ||
| - | ===== disabled ===== | + | ===== forceField.disabled ===== |
| Force field has been disabled. | Force field has been disabled. | ||
| Line 239: | Line 248: | ||
| * [[behavior_collider|ECBehaviorCollider]]: | * [[behavior_collider|ECBehaviorCollider]]: | ||
| * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
| + | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
| + | |||
| ====== Persistency ====== | ====== Persistency ====== | ||
| Line 281: | 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 303: | Line 303: | ||
| <string name=' | <string name=' | ||
| | | ||
| - | <!-- optional: | + | <!-- optional: |
| - | <string | + | <list name='behaviorTrees'> |
| + | | ||
| + | <string> | ||
| + | </list> | ||
| | | ||
| - | <!-- optional: | + | <!-- optional: |
| - | <string | + | <list name='stateMachines'> |
| + | | ||
| + | <string> | ||
| + | </list> | ||
| | | ||
| <!-- set element properties. omit property prefix if used inside behavior tag --> | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||