User Tools

Site Tools


dragengine:modules:dragonscript:behavior_projecttoground

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_projecttoground [2025/05/04 13:44] – [projectToGround.check] dragonlorddragengine: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><boolean name='projectToGround.applyToActor'>false</boolean></code>   * Example (*.deeclass) <code xml><boolean name='projectToGround.applyToActor'>false</boolean></code>
 +
 +===== 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: ''projectToGround.landingAngle''
 +  * Type: float
 +  * Restriction: At least 0 and at most 180
 +  * Default Value: 120
 +  * Example (*.deeclass) <code xml><float name='projectToGround.landingAngle'>120</float></code>
  
 ====== Events ====== ====== Events ======
Line 43: Line 53:
  
 This behavior adds these behavior tree actions if behavior tree is present. 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|''true'', ''false''|Project to ground is enabled|
 +|ground|''true'', ''false''|Touching ground|
 +
 +This is an example of using this action:
 +<code xml>
 +<sequence>
 +  <action name='projectToGround.set'>
 +    <parameter name='enabled'>true</parameter>
 +  </action>
 +</sequence>
 +</code>
 +
 +===== 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 ''interaction''.|
 +
 +
 +This is an example of using this action:
 +<code xml>
 +<sequence>
 +  <action name='projectToGround.set'>
 +    <parameter name='interactElement.assign'/>
 +  </action>
 +</sequence>
 +</code>
  
 ===== projectToGround.check ===== ===== projectToGround.check =====
Line 51: Line 97:
 |enabled|''true'', ''false''|Project to ground is enabled| |enabled|''true'', ''false''|Project to ground is enabled|
 |ground|''true'', ''false''|Touching ground| |ground|''true'', ''false''|Touching ground|
 +|ground.element|''true'', ''false''|Last ground collider is not null and collider owner is castable to BehaviorElement|
 +|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|''true'', ''false''|Angle between collision normal and project to ground direction is less than ''landingAngle'' property|
 +|interact.name|string|Name of interaction|
 +|interact.has|''true'', ''false''|Has ground element and interaction with name ''interaction.name'' is present|
 +|interact.query|''true'', ''false''|Interact with ground element and test result. Condition is true if ground element 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| |wait| |If present action returns BTResult.running instead of BTResult.failed to wait until the checks are all fulfilled|
  
Line 74: Line 128:
 |projectToGround.enabled|''true'', ''false''|Project to ground is enabled| |projectToGround.enabled|''true'', ''false''|Project to ground is enabled|
 |projectToGround.ground|''true'', ''false''|Touching ground| |projectToGround.ground|''true'', ''false''|Touching ground|
 +|projectToGround.ground.element|''true'', ''false''|Found ground element during last test|
 +|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|''true'', ''false''|Angle between collision normal and project to ground direction is less than ''landingAngle'' property|
 +|projectToGround.interact.name|string|Name of interaction|
 +|projectToGround.interact.has|''true'', ''false''|Has ground element and interaction with name ''interaction.name'' is present|
 +|projectToGround.interact.query|''true'', ''false''|Interact with ground element and test result. Condition is true if ground element 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).|
 +|projectToGround.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:
dragengine/modules/dragonscript/behavior_projecttoground.1746366296.txt.gz · Last modified: 2025/05/04 13:44 by dragonlord