This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_projecttoground [2025/03/13 17:10] – dragonlord | dragengine:modules:dragonscript:behavior_projecttoground [2025/05/13 13:59] (current) – old revision restored (2025/05/11 13:20) dragonlord | ||
---|---|---|---|
Line 27: | Line 27: | ||
* Default Value: true | * Default Value: true | ||
* Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
+ | |||
+ | ===== landingAngle ===== | ||
+ | |||
+ | Set landing angle in degrees. Used to check during collision response if an actor is landing on ground. This is done by comparing the impact normal of the ground against the project-to-ground direction. If this angle is small enough the actor is considered to land on ground instead of flying against a wall or scratching the ground in an upwards motion. | ||
+ | |||
+ | * Full name: '' | ||
+ | * Type: float | ||
+ | * Restriction: | ||
+ | * Default Value: 120 | ||
+ | * Example (*.deeclass) <code xml>< | ||
====== Events ====== | ====== Events ====== | ||
Line 39: | Line 49: | ||
Actor switched between touching ground and not touching ground. | Actor switched between touching ground and not touching ground. | ||
+ | |||
+ | ====== Behavior Tree Actions ====== | ||
+ | |||
+ | This behavior adds these behavior tree actions if behavior tree is present. | ||
+ | |||
+ | ===== projectToGround.set ===== | ||
+ | |||
+ | Set one or more project to ground parameters. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |enabled|'' | ||
+ | |ground|'' | ||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | < | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== projectToGround.update ===== | ||
+ | |||
+ | Update project to ground. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |interactElement.assign|string|Assign ground element to [[behavior_interactelement|ECBehaviorInteractElement]] with identifier matching value string. Action fails if not touching element or interact element behavior is absent| | ||
+ | |interact|string|Interact with ground element. 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 '' | ||
+ | |||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | < | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== projectToGround.check ===== | ||
+ | |||
+ | Check one or more project to ground parameters. Action succeeds if all parameter value matches their respective project to ground parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a project to ground parameter matches (or not). | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |enabled|'' | ||
+ | |ground|'' | ||
+ | |ground.element|'' | ||
+ | |hitAngle.less|float|Angle between collision normal and project to ground direction is less than value in degrees| | ||
+ | |hitAngle.greater|float|Angle between collision normal and project to ground direction is greater than value in degrees| | ||
+ | |landing|'' | ||
+ | |interact.name|string|Name of interaction| | ||
+ | |interact.has|'' | ||
+ | |interact.query|'' | ||
+ | |interact.parameters|string|Optional parameters to use with '' | ||
+ | |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: | ||
+ | <code xml> | ||
+ | < | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | <!-- actions here run only if touching ground --> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Behavior Tree Conditions ====== | ||
+ | |||
+ | This behavior adds these behavior tree conditions if behavior tree is present. | ||
+ | |||
+ | ===== projectToGround.check ===== | ||
+ | |||
+ | Check one or more project to ground parameters. Conditions returns true if all parameter value match their respective project to ground parameter. This condition is typically used to run an action or sequence of actions as long as project to ground conditions are true. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |projectToGround.enabled|'' | ||
+ | |projectToGround.ground|'' | ||
+ | |projectToGround.ground.element|'' | ||
+ | |projectToGround.hitAngle.less|float|Angle between collision normal and project to ground direction is less than value in degrees| | ||
+ | |projectToGround.hitAngle.greater|float|Angle between collision normal and project to ground direction is greater than value in degrees| | ||
+ | |projectToGround.landing|'' | ||
+ | |projectToGround.interact.name|string|Name of interaction| | ||
+ | |projectToGround.interact.has|'' | ||
+ | |projectToGround.interact.query|'' | ||
+ | |projectToGround.interact.parameters|string|Optional parameters to use with '' | ||
+ | |||
+ | This is an example of using this condition: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== State Machine Actions ====== | ||
+ | |||
+ | Same as [[# | ||
+ | |||
+ | ====== State Machine Conditions ====== | ||
+ | |||
+ | Same as [[# | ||
+ | |||
+ | ====== State Machine Events ====== | ||
+ | |||
+ | This behavior sends these state machine events. | ||
+ | |||
+ | ===== projectToGround.enabled ===== | ||
+ | |||
+ | Project to ground has been enabled. | ||
+ | |||
+ | ===== projectToGround.disabled ===== | ||
+ | |||
+ | Project to ground has been disabled. | ||
+ | |||
+ | ===== projectToGround.touch ===== | ||
+ | |||
+ | Element is touching ground while previously has not been touching ground. | ||
+ | |||
+ | ===== projectToGround.noTouch ===== | ||
+ | |||
+ | Element is not touching ground while previously has been touching ground. | ||
====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
Line 46: | Line 179: | ||
====== Optional Behaviors ====== | ====== Optional Behaviors ====== | ||
- | This behavior | + | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: |
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
====== Persistency ====== | ====== Persistency ====== | ||
Line 92: | Line 226: | ||
| | ||
< | < | ||
+ | <!-- optional: use behavior tree with id instead of empty string --> | ||
+ | <string name=' | ||
+ | | ||
+ | <!-- optional: use state machine with id instead of empty string --> | ||
+ | <string name=' | ||
+ | | ||
<!-- set element properties. omit property prefix if used inside behavior tag --> | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||
<boolean name=' | <boolean name=' |