{{tag>dragonscript behavior}} [[: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]] >> **ECBehaviorFootStepConfig** * [[behaviors_use_cases|Behaviors Explained: By Use-Case]] * [[behaviors_a_to_z|Behaviors Explained: From A to Z]] ====== ECBehaviorFootStepConfig ====== Behavior adding a single foot step configuration with a list of events. Optionally a list of sounds can be defined which is assigned to the events. All events share the same sounds and play sound parameters. ====== Instance Counts ====== Multiple ECBehaviorFootStepConfig to add multiple foot step configurations. ====== Element Class Properties ====== Element class properties have the prefix ''footStepConfig.'' or ''footStepConfig({id}).'' if id is not empty. ===== configId ===== Set identifier of configuration. * Full name: ''footStepConfig.configId'' or ''footStepConfig({id}).configId'' * Type: string * Default Value: empty string * Example (*.deeclass) walk ===== interval ===== Set interval in seconds between repeating foot steps. * Full name: ''camera.interval'' or ''camera({id}).interval'' * Type: float * Default Value: ''1'' * Restriction: At least ''0'' * Example (*.deeclass) 0.6 ===== controllerName ===== Set actor animated controller name to use as elapsed time. Typically a controller updated by the moved distance is used. This allows to synchronize foot steps to animations easily. Keep in mind that event times are measured in the range from 0 to 1 instead of seconds if a controller is used. This allows animations of different length to be used with the same configuration. * Full name: ''footStepConfig.controllerName'' or ''footStepConfig({id}).controllerName'' * Type: string * Default Value: empty string * Example (*.deeclass) walking ===== sounds ===== List of path of sound resource to randomly choose from. * Full name: ''footStepConfig.sounds'' or ''footStepConfig({id}).sounds'' * Type: string * Default Value: empty string * Expected File Type: ''*.ogg'' (all sound modules) * Example (*.deeclass) step1.ogg step2.ogg ===== volume ===== Set volume of foot step sound played. * Full name: ''footStepConfig.volume'' or ''footStepConfig({id}).volume'' * Type: float * Default Value: ''1'' * Restriction: At least ''0'' * Example (*.deeclass) 0.2 ===== range ===== Set range of foot step sound played. * Full name: ''footStepConfig.range'' or ''footStepConfig({id}).range'' * Type: float * Default Value: ''10'' * Restriction: At least ''0'' * Example (*.deeclass) 10 ===== rollOff ===== Set rollOff of foot step sound played. Determines of quickly the sound volume diminishes towards the range. Value is in the range from 0 to 1 with 0.1 being a natural roll-off * Full name: ''footStepConfig.rollOff'' or ''footStepConfig({id}).rollOff'' * Type: float * Default Value: ''0.5'' * Restriction: At least ''0'' and at most ''1'' * Example (*.deeclass) 0.5 ===== offset ===== Offset relative to element position to play sound at. * Full name: ''footStepConfig.offset'' or ''footStepConfig({id}).offset'' * Type: 3-component float vector * Default Value: ''(0, 0.05, 0)'' * Example (*.deeclass) ===== type ===== Set custom type identifier. Optional value which can be used by behaviors to play custom tailored sounds. * Full name: ''footStepConfig.type'' or ''footStepConfig({id}).type'' * Type: string * Default Value: empty string * Example (*.deeclass) stone ===== eventTimes ===== List of event times. For each list entry an event is added to the configuration using the properties outline above. If ''controllerName'' is empty the times are in seconds. If ''controllerName'' is not empty the times are in the range from 0 to 1 representing relative time values across the controller value range. Event time values must be in increasing order. * Full name: ''footStepConfig.eventTimes'' or ''footStepConfig({id}).eventTimes'' * Type: string * Default Value: empty string * Expected File Type: ''*.ogg'' (all sound modules) * Example (*.deeclass) 0.2 0.6 ====== Events ====== This behavior provides no events. ====== Required Behaviors ====== This behavior requires no other behaviors. ====== Optional Behaviors ====== * [[behavior_footsteps|ECBehaviorFootSteps]]: Behavior to add configuration to. ====== Persistency ====== This behavior does not require element class persistency (setPersistable). ====== API Documentation ====== #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorFootStepConfig.html,ECBehaviorFootStepConfig~@#. Since DragonScript Module Version ''1.26'' ====== Use Cases ====== * Add foot step configuration to play with foot step behavior ====== Element Class Example ====== This example defines an element which two foot step configurations. class MyElement extends BehaviorElementClass public var ECBehaviorFootSteps footSteps public var ECBehaviorFootStepConfig footStepsWalk, footStepsRun func new() footSteps = ECBehaviorFootSteps.new(this) footStepsWalk = ECBehaviorFootStepConfig.new(this, footSteps, "walk") footStepsWalk.getInterval().setValue(0.6) footStepsRun = ECBehaviorFootStepConfig.new(this, footSteps, "run") footStepsRun.getInterval().setValue(0.4) end end ====== Behavior Factory ====== Using element class supporting adding behaviors the behavior can be added like this: walk 0.6 0.2 20 /content/sound/footstep1.ogg /content/sound/footstep2.ogg 0.5 ... ====== Live Examples ====== * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]