User Tools

Site Tools


dragengine:modules:dragonscript:behavior_hitscan

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_hitscan [2025/05/02 21:33] – [Behavior Factory] dragonlorddragengine:modules:dragonscript:behavior_hitscan [2025/05/11 13:39] (current) dragonlord
Line 66: Line 66:
  
 This behavior has no events This behavior has no events
 +
 ====== Behavior Tree Actions ====== ====== Behavior Tree Actions ======
  
 This behavior adds these behavior tree actions if behavior tree is present. If behavior has non-empty identifier replace ''hitScan'' with ''hitScan(id)''. This behavior adds these behavior tree actions if behavior tree is present. If behavior has non-empty identifier replace ''hitScan'' with ''hitScan(id)''.
  
-===== hitScan.start =====+===== hitScan.update =====
  
-Start hit scans.+Update hit scan.
  
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
-|type|''circular'', ''cone'', ''rectangular'', ''rectangular.uniform''|<WRAP>Distribution shape of tests.+|start|''circular'', ''cone'', ''rectangular'', ''rectangular.uniform''|<WRAP>Start hit scan with value type.
   * ''circular'': Tests are arranged in a circular pattern. Set angle using ''angle''   * ''circular'': Tests are arranged in a circular pattern. Set angle using ''angle''
   * ''cone'': Tests are arranged randomly in a small cone cap. Set count using ''count''. Set angle using ''angle''. Useful for example for weapons with multiple projectiles like buck shots   * ''cone'': Tests are arranged randomly in a small cone cap. Set count using ''count''. Set angle using ''angle''. Useful for example for weapons with multiple projectiles like buck shots
Line 87: Line 88:
 |angle.horizontal|float|Horizontal opening angle in degrees (angle across width)| |angle.horizontal|float|Horizontal opening angle in degrees (angle across width)|
 |angle.vertical|float|Vertical opening angle in degrees (angle across height)| |angle.vertical|float|Vertical opening angle in degrees (angle across height)|
 +|stop|empty string, ''clear''|Stop hit scan. If value is ''clear'' clear hit results as if no hit has been done|
  
 This is an example of using this action: This is an example of using this action:
 <code xml> <code xml>
-<action name='hitScan.start'> +<action name='hitScan.update'> 
-  <parameter name='type'>cone</parameter>+  <parameter name='start'>cone</parameter>
   <parameter name='count'>10</parameter>   <parameter name='count'>10</parameter>
   <parameter name='angle'>5</parameter>   <parameter name='angle'>5</parameter>
-</action> 
-</code> 
- 
-===== hitScan.stop ===== 
- 
-Stop hit scans. 
- 
-^Parameter^Value^Description^ 
-|clear| |Clear hit results as if no hit has been done| 
- 
-This is an example of using this action: 
-<code xml> 
-<action name='hitScan.stop'> 
-  <parameter name='clear'/> 
 </action> </action>
 </code> </code>
Line 123: Line 111:
 |hits.percentage.less|integer|Percentage of hits is less than value in the range from 0 to 1| |hits.percentage.less|integer|Percentage of hits is less than value in the range from 0 to 1|
 |hits.percentage.greater|integer|Percentage of hits is greater than value in the range from 0 to 1| |hits.percentage.greater|integer|Percentage of hits is greater than value in the range from 0 to 1|
 +|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 160: Line 149:
 </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 ''hitScan'' with ''hitScan(id)''.
 +
 +===== hitScan.done =====
 +
 +Hit scan finished and the results can be examine now.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 169: Line 174:
   * [[behavior_component|ECBehaviorComponent]]: Required if collision test has to originate from bone.   * [[behavior_component|ECBehaviorComponent]]: Required if collision test has to originate from bone.
   * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use.   * [[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 ======
dragengine/modules/dragonscript/behavior_hitscan.1746221588.txt.gz · Last modified: 2025/05/02 21:33 by dragonlord