User Tools

Site Tools


dragengine:modules:dragonscript:behavior_component

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dragengine:modules:dragonscript:behavior_component [2025/03/11 02:30] – created dragonlorddragengine:modules:dragonscript:behavior_component [2025/03/13 17:05] (current) dragonlord
Line 1: Line 1:
 {{tag>dragonscript behavior}} {{tag>dragonscript behavior}}
 <WRAP youarehere> <WRAP youarehere>
-[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[abstractions#behavior_elementsquick_and_easy_development|Behavior Elements: Quick and Easy Development]] >> **ECBehaviorComponent**+[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[dragengine:modules:dragonscript:abstractions|Abstraction Layers: How you want to build your Game]] >> [[dragengine:modules:dragonscript:behavior_elements|Behavior Elements]] >> **ECBehaviorComponent**
 </WRAP> </WRAP>
  
Line 18: Line 18:
  
 Hence these two use cases are possible depending on the order the behaviors are added: Shape Collision, Component Collision. See [[#element_class_example]]. Hence these two use cases are possible depending on the order the behaviors are added: Shape Collision, Component Collision. See [[#element_class_example]].
 +
 +See also:
 +  * [[gamedev:deigde:editors:skin|IGDE Skin Editor]]
 +  * [[tools:blenderexportscripts|Blender3D Export Scripts]]
  
 ====== Instance Counts ====== ====== Instance Counts ======
Line 27: Line 31:
 ===== model ===== ===== model =====
 Set path of model resource to use. Set path of model resource to use.
-  * Full name: ''customColor.model'' or ''customColor({id}).model''+  * Full name: ''component.model'' or ''component({id}).model''
   * Type: string   * Type: string
   * Default Value: empty string   * Default Value: empty string
   * Expected File Type: ''*.demodel''   * Expected File Type: ''*.demodel''
-  * Example (*.deeclass) <code xml><string name='customColor.model'>box.demodel</string></code>+  * Example (*.deeclass) <code xml><string name='component.model'>box.demodel</string></code>
  
 ===== skin ===== ===== skin =====
 Set path of skin resource to use. Set path of skin resource to use.
-  * Full name: ''customColor.skin'' or ''customColor({id}).skin''+  * Full name: ''component.skin'' or ''component({id}).skin''
   * Type: string   * Type: string
   * Default Value: empty string   * Default Value: empty string
   * Expected File Type: ''*.deskin''   * Expected File Type: ''*.deskin''
-  * Example (*.deeclass) <code xml><string name='customColor.skin'>box.deskin</string></code>+  * Example (*.deeclass) <code xml><string name='component.skin'>box.deskin</string></code>
  
 ===== rig ===== ===== rig =====
 Set path of rig resource to use. Set path of rig resource to use.
-  * Full name: ''customColor.rig'' or ''customColor({id}).rig''+  * Full name: ''component.rig'' or ''component({id}).rig''
   * Type: string   * Type: string
   * Default Value: empty string   * Default Value: empty string
   * Expected File Type: ''*.derig''   * Expected File Type: ''*.derig''
-  * Example (*.deeclass) <code xml><string name='customColor.rig'>box.derig</string></code>+  * Example (*.deeclass) <code xml><string name='component.rig'>box.derig</string></code>
  
 ===== occlusionMesh ===== ===== occlusionMesh =====
 Set path of occlusion mesh resource to use. Set path of occlusion mesh resource to use.
-  * Full name: ''customColor.occlusionMesh'' or ''customColor({id}).occlusionMesh''+  * Full name: ''component.occlusionMesh'' or ''component({id}).occlusionMesh''
   * Type: string   * Type: string
   * Default Value: empty string   * Default Value: empty string
   * Expected File Type: ''*.deoccmesh''   * Expected File Type: ''*.deoccmesh''
-  * Example (*.deeclass) <code xml><string name='customColor.occlusionMesh'>box.deoccmesh</string></code>+  * Example (*.deeclass) <code xml><string name='component.occlusionMesh'>box.deoccmesh</string></code>
  
 ===== audioModel ===== ===== audioModel =====
 Set path of audio model resource to use. Set path of audio model resource to use.
-  * Full name: ''customColor.audioModel'' or ''customColor({id}).audioModel''+  * Full name: ''component.audioModel'' or ''component({id}).audioModel''
   * Type: string   * Type: string
   * Default Value: empty string   * Default Value: empty string
   * Expected File Type: ''*.demodel''   * Expected File Type: ''*.demodel''
-  * Example (*.deeclass) <code xml><string name='customColor.audioModel'>box.demodel</string></code>+  * Example (*.deeclass) <code xml><string name='component.audioModel'>box.demodel</string></code>
  
 ===== renderEnvMap ===== ===== renderEnvMap =====
 Set if component is rendered in environment maps. Set if component is rendered in environment maps.
-  * Full name: ''customColor.renderEnvMap'' or ''customColor({id}).renderEnvMap''+  * Full name: ''component.renderEnvMap'' or ''component({id}).renderEnvMap''
   * Type: boolean   * Type: boolean
   * Default Value: true   * Default Value: true
-  * Example (*.deeclass) <code xml><boolean name='customColor.renderEnvMap'>false</boolean></code>+  * Example (*.deeclass) <code xml><boolean name='component.renderEnvMap'>false</boolean></code>
  
 ===== affectsAudio ===== ===== affectsAudio =====
 Set if component is affecting audio. Set if component is affecting audio.
-  * Full name: ''customColor.affectsAudio'' or ''customColor({id}).affectsAudio''+  * Full name: ''component.affectsAudio'' or ''component({id}).affectsAudio''
   * Type: boolean   * Type: boolean
   * Default Value: true   * Default Value: true
-  * Example (*.deeclass) <code xml><boolean name='customColor.affectsAudio'>false</boolean></code>+  * Example (*.deeclass) <code xml><boolean name='component.affectsAudio'>false</boolean></code>
  
 ===== hintMovement ===== ===== hintMovement =====
 Set movement hint. Set movement hint.
-  * Full name: ''customColor.hintMovement'' or ''customColor({id}).hintMovement''+  * Full name: ''component.hintMovement'' or ''component({id}).hintMovement''
   * Type: enumeration   * Type: enumeration
   * <WRAP>Allowed Values:   * <WRAP>Allowed Values:
Line 90: Line 94:
 </WRAP> </WRAP>
   * Default Value: ''stationary''   * Default Value: ''stationary''
-  * Example (*.deeclass) <code xml><string name='customColor.hintMovement'>dynamic</string></code>+  * Example (*.deeclass) <code xml><string name='component.hintMovement'>dynamic</string></code>
  
 ===== enableGI ===== ===== enableGI =====
 Set enable GI in graphic module if supported. Set enable GI in graphic module if supported.
-  * Full name: ''customColor.enableGI'' or ''customColor({id}).enableGI''+  * Full name: ''component.enableGI'' or ''component({id}).enableGI''
   * Type: boolean   * Type: boolean
   * Default Value: true   * Default Value: true
-  * Example (*.deeclass) <code xml><boolean name='customColor.enableGI'>false</boolean></code>+  * Example (*.deeclass) <code xml><boolean name='component.enableGI'>false</boolean></code>
  
 ===== hintGIImportance ===== ===== hintGIImportance =====
 Set GI important hint. Value is in the range from 0 (very unimportant) to 4 (very important). This hint can be used by the graphic module to improve performance by excluding components with a GI important below a user chosen threashold. Set GI important hint. Value is in the range from 0 (very unimportant) to 4 (very important). This hint can be used by the graphic module to improve performance by excluding components with a GI important below a user chosen threashold.
-  * Full name: ''customColor.hintGIImportance'' or ''customColor({id}).hintGIImportance''+  * Full name: ''component.hintGIImportance'' or ''component({id}).hintGIImportance''
   * Type: integer   * Type: integer
   * Default Value: 4   * Default Value: 4
   * Restriction: At least 0 and at most 4   * Restriction: At least 0 and at most 4
-  * Example (*.deeclass) <code xml><integer name='customColor.hintGIImportance'>3</integer></code>+  * Example (*.deeclass) <code xml><integer name='component.hintGIImportance'>3</integer></code>
  
 ===== textureReplacements ===== ===== textureReplacements =====
 Set texture replacements. Set texture replacements.
-  * Full name: ''customColor.textureReplacements'' or ''customColor({id}).textureReplacements''+  * Full name: ''component.textureReplacements'' or ''component({id}).textureReplacements''
   * Type: map   * Type: map
   * Default Value: 4   * Default Value: 4
Line 139: Line 143:
 </code></WRAP> </code></WRAP>
  
-===== Events =====+====== Events ======
  
 This behavior has no events. This behavior has no events.
Line 149: Line 153:
 ====== Optional Behaviors ====== ====== Optional Behaviors ======
  
-This behavior does support these optional behaviors: +  * [[behavior_collider|ECBehaviorCollider]]: Attaches component to collider if set.
-  * [[behavior_collider|ECBehaviorCollider]]+
  
 ====== Persistency ====== ====== Persistency ======
Line 212: Line 215:
      
   <!-- adding the component will detect the previously added collider and use it -->   <!-- adding the component will detect the previously added collider and use it -->
-  <behavior type='ECBehaviorComponent'/>+  <behavior type='ECBehaviorComponent'
 +    <!-- optional: set layer mask as list of bits to set. default is '0' which means 
 +                   BaseGameApp.WorldLayerBit.default --> 
 +    <string name='layerMask'>0 1</string> 
 +     
 +    <!-- optional: set render env map layer mask as list of bits to set. default is '1' 
 +                   which means BaseGameApp.WorldLayerBit.envmap . if 'renderEnvMap' is 
 +                   true this layer mask is OR combined with 'layerMask' --> 
 +    <string name='layerMaskRenderEnvMap'>0 1</string> 
 +     
 +    <!-- optional: set audio layer mask as list of bits to set. default is '2' which 
 +                   means BaseGameApp.WorldLayerBit.audio . if 'affectsAudio' is 
 +                   true this layer mask is OR combined with 'layerMask' --> 
 +    <string name='layerMaskAffectsAudio'>0 1</string> 
 +     
 +    <!-- set element properties. omit property prefix if used inside behavior tag --> 
 +    <string name='.model'>box.demodel</string> 
 +  </behavior>
 </elementClass> </elementClass>
 </code> </code>
Line 222: Line 242:
 <elementClass name='MyClass' class='GenericBehaviorElement'> <elementClass name='MyClass' class='GenericBehaviorElement'>
   <!-- no collider is present yet so component will not use any collider -->   <!-- no collider is present yet so component will not use any collider -->
-  <behavior type='ECBehaviorComponent'/>+  <behavior type='ECBehaviorComponent'
 +    ... 
 +  </behavior>
      
   <behavior type='ECBehaviorCollider'>   <behavior type='ECBehaviorCollider'>
dragengine/modules/dragonscript/behavior_component.1741660243.txt.gz · Last modified: 2025/03/11 02:30 by dragonlord