DIFF

class EffectSoundSource

EffectSound Effect Managed

All members, including inherited

Wrapper class for managing sound through SEffectManager

Constructors 2

void ~EffectSound()

dtor

Members 26

ref ScriptInvoker Event_OnSoundWaveStarted = new ScriptInvoker()

\name Event invokers ScriptInvonkers for certain events

ref ScriptInvoker Event_OnSoundWaveEnded = new ScriptInvoker()
ref ScriptInvoker Event_OnSoundFadeInStopped = new ScriptInvoker()
ref ScriptInvoker Event_OnSoundFadeOutStarted = new ScriptInvoker()
protected ref SoundParams m_SoundParams

\name Sound objects and structures Objects and structures for the sound

protected ref SoundObjectBuilder m_SoundObjectBuilder
Referenced by SoundLoadEx(), and SoundPlayEx()
protected WaveKind m_SoundWaveKind

\name Generic data Generic data for the sound

Referenced by EffectSound(), SetSoundWaveKind(), SoundLoadEx()
Show 1 more, SoundPlayEx()
protected string m_SoundSetName
protected bool m_SoundLoop
protected bool m_SetEnvVariables
protected bool m_SoundAutodestroy
protected bool m_SoundWaveIsPlaying
protected float m_SoundWaveLenght
protected float m_SoundWaveVolume
protected float m_SoundWaveVolumeMax
protected float m_SoundWaveTime
Referenced by Event_OnFrameUpdate(), GetSoundWaveTime(), SoundReset()
Show 1 more, SoundStop()
protected int m_SoundDoppler
protected bool m_SoundWaveStarting

\name Fading data Data for fadein/fadeout for the sound

protected bool m_SoundWaveStopping
Referenced by EffectSound(), Event_OnFrameUpdate(), SoundReset()
Show 1 more, SoundStop()
protected bool m_SoundFadedOut
Referenced by EffectSound(), Event_OnFrameUpdate(), SoundReset()
Show 1 more, SoundStop()
protected float m_SoundFadeInDuration
protected float m_SoundFadeOutStartTime
protected float m_SoundFadeOutDuration
protected float m_SoundFadeOutInitVolume

Methods 53

override string GetDebugName()

Override when getting debug information

override EffectType GetEffectType()

Get what type of effect the Effect is

Returns: EffectType What type of effect the Effect is

override bool IsSound()

Check whether the Effect is EffectSound without casting

Returns: bool Whether the Effect is EffectSound

override void Start()

Plays sound

References SoundPlay()
bool SoundLoad()

Loads in the sound when it is requested for playing

NoteLegacy, backwards compatibility
References SoundLoadEx()
bool IsSoundValid()

Helper for checking if params are valid

protected bool SoundWaveValidation()

Validation of fade settings

NoteCalled from 'ValidateSoundWave'
Referenced by ValidateSoundWave()
protected void UpdateEvents()

Enables the frame event on the EffectSound

NoteCalled from 'ValidateSoundWave' when all is successful
NoteSo this is effectively enabling frame event on all valid EffectSound
Referenced by ValidateSoundWave()
override void Event_OnFrameUpdate(float time_delta)

Event called on frame when enabled by SetEnableEventFrame(true)

time_delta
float Time passed since the previous frame
NoteIs always enabled on sound
NoteCalled from SEffectManager.Event_OnFrameUpdate in MissionGameplay.OnUpdate
override void Event_OnRegistered(int id)

Event called from SEffectManager when the Effect is registered

id
int ID registered in SEffectManager
NoteShould only ever be called by SEffectManager!
override void Event_OnUnregistered()

Event called from SEffectManager when the Effect is unregistered

NoteShould only ever be called by SEffectManager!
void Event_OnSoundWaveStarted()

Event called when sound starts playing

NoteInserted into events of m_SoundWaveObject
void Event_OnSoundWaveEnded()

Event called when sound stops playing

NoteInserted into events of m_SoundWaveObject
void Event_OnSoundFadeInStopped()

Event called when sound fade in stops

NoteCalled from Event_OnFrameUpdate
Referenced by Event_OnFrameUpdate()
void Event_OnSoundFadeOutStarted()

Event called when sound fade out starts

NoteCalled from Event_OnFrameUpdate
Referenced by Event_OnFrameUpdate()
override void SetAutodestroy(bool auto_destroy)

Sets whether Effect automatically cleans up when it stops

auto_destroy
bool Whether Effect automatically cleans up when it stops
NoteThis means that it will be unregistered from SEffectManager as well
Referenced by ActionBuildShelter.PlayActionFinishSound(), ActionBuildShelter.PlayActionStartSound(), BearTrap.PlaySoundBiteEmpty()
Show 41 more, BearTrap.PlaySoundBiteLeg(), BearTrap.PlaySoundOpen(), BoatScript.HandleBoatSplashSound(), BoatScript.PlaySound(), Bottle_Base.StopEmptyingLoopSound(), CarScript.CreateSoundForAnimationSource(), CarScript.HandleEngineSound(), CarScript.PlaySoundEx(), CarWheel.OnWasAttached(), CarWheel.OnWasDetached(), CrashBase.EEInit(), DayZGame.DelayedMidAirDetonation(), DayZGame.OnRPC(), SetSoundAutodestroy(), EntityAI.SoundHardBushFallingPlay(), EntityAI.SoundHardTreeFallingPlay(), EntityAI.SoundSoftBushFallingPlay(), EntityAI.SoundSoftTreeFallingPlay(), FlashbangEffect.PlaySound(), HungerSoundHandlerClient.PlaySound(), ItemBase.PlayAttachSound(), ItemSoundHandler.PlayItemSoundClient(), Land_WarheadStorage_Main.OnDoorCloseFinish(), Land_WarheadStorage_Main.OnDoorCloseStart(), Land_WarheadStorage_Main.OnDoorOpenStart(), Land_WarheadStorage_Main.OnPowerOffClient(), Land_WarheadStorage_Main.OnPowerOnClient(), Land_WarheadStorage_PowerStation.OnVariablesSynchronized(), Land_WarheadStorage_PowerStation.PlayLeverSound(), LandMineTrap.OnActivate(), LandMineTrap.PlaySoundActivate(), LandMineTrap.StartActivate(), Object.PlaySoundSet(), PlayerBase.EEHitByRemote(), PlayerBase.OnPlayerRecievedHit(), ScriptConsoleSoundsTab.HandleKeys(), SpookyEventBase.Perform(), SpookyEventRustle.Do(), TreeEffecter.OnVariablesSynchronized(), TripwireTrap.OnSteppedOn(), and Weapon_Base.OnFireModeChange()
override bool IsAutodestroy()

Get whether Effect automatically cleans up when it stops

Returns: bool Whether Effect automatically cleans up when it stops

void SetSoundAutodestroy(bool auto_destroy)

Sets whether EffectSound automatically cleans up when sound stops

auto_destroy
bool Whether EffectSound automatically cleans up when sound stops
References SetAutodestroy()
bool IsSoundAutodestroy()

Get whether EffectSound automatically cleans up when sound stops

Returns: bool Whether EffectSound automatically cleans up when sound stops

Referenced by IsAutodestroy()
override bool CanDestroy()
override void SetParent(Object parent_obj, int pivot)

Set parent for the sound to follow

parent_obj
Object The parent for the sound to follow
override Object GetParent()

Get parent for the EffectSound

Returns: Object The parent for the EffectSound

override int GetPivotIndex()

Get parent pivot of the Effect, only valid when there is some GetParent

Returns: int The parent pivot of the Effect

WarningOnly gets the cached variable
override Object GetCurrentParent()

Get parent for the EffectSound

Returns: Object The parent for the EffectSound

NoteThere is no real parenting with sound, so the setters and getters for parents do the exact same
override void SetCurrentPosition(vector pos, bool updateCached = true)

Set the world position of the managed sound

pos
vector The world position of the managed sound
updateCached
bool Whether to update the cached variable
override vector GetCurrentPosition()

Get the current world position of the managed sound

Returns: vector The current world position of the managed sound

override void SetCurrentLocalPosition(vector pos, bool updateCached = true)

Set the current local position of the managed sound

pos
vector The current local position for the managed sound
updateCached
bool Whether to update the cached variable
Referenced by SoundPlayEx()
override vector GetCurrentLocalPosition()

Get the current local position of the managed sound

Returns: vector The current local position of the managed sound

Referenced by SoundPlayEx()
void SetSoundWaveKind(WaveKind wave_kind)

Set WaveKind for the sound

wave_kind
WaveKind The WaveKind for the sound
NoteNeeds to be set before playing
References m_SoundWaveKind
void SetSoundSet(string snd)

Set soundset for the sound

snd
string Name of the soundset to play
NoteNeeds to be set before playing
References m_SoundSetName
string GetSoundSet()

Get soundset for the sound

Returns: string Name of the soundset

References m_SoundSetName
void SetSoundLoop(bool loop)

Set if the sound loops

loop
bool Whether the sound should loop
void SetEnviromentVariables(bool setEnvVariables)

Sets whether AddEnvSoundVariables needs to be called during Loading

setEnvVariables
bool Whether AddEnvSoundVariables is called
float GetSoundWaveLenght()

Get the sound wave length

Returns: float The sound wave length

NoteLegacy, exists for backwards compatibility
float GetSoundWaveLength()

Get the sound wave length

Returns: float The sound wave length

void SetSoundVolume(float volume)

Set the RELATIVE volume for the sound

volume
float The relative volume for the sound
float GetSoundVolume()

Get the RELATIVE volume set by 'SetSoundVolume'

Returns: float The relative volume for the sound set by 'SetSoundVolume'

Referenced by Event_OnFrameUpdate()
void SetSoundMaxVolume(float volume)

Set the sound max volume

volume
float The maximum volume for the sound
WarningSeems to purely be used for fade in effect, rather than really setting the max volume...
WarningAdjusts the current volume to this value as well
float GetSoundWaveTime()

Get the time since EffectSound started playing

Returns: float The time since EffectSound started playing

WarningMay not reflect the actual time of the sound, as it can start at negative time to simulate speed of sound
References m_SoundWaveTime
void SetSoundFadeIn(float fade_in)

Set the sound fade in duration

fade_in
float The fade in duration
void SetDoppler(bool setDoppler)

Set if the sound has the doppler effect enabled

setDoppler
float If the doppler effect is enabled
References m_SoundDoppler
protected void SoundError(string err_msg)

Helper for throwing sound errors