class SEffectManagerSource
Manager class for managing Effect (EffectParticle, EffectSound)
Constants 1
static const int INVALID_ID = 0As the counter starts at 1, Effect ID can never be 0
Members 10
Show 4 more
, GetEffectByID(), Init(), IsEffectExist(), and Stop()Static array of IDs that were previously used, but freed up by unregistering
protected static int m_HighestFreeEffectID = 1Counter for quickly getting the next ID if FreeEffectIDs array is empty
protected static bool m_IsCleanupBool to check whether Cleanup is happening, which means that the maps should no longer be accessed
Show 2 more
, GetEffectByID(), and IsEffectExist()protected static bool m_IsInitializedBool to check whether Init was called
protected static ref map<string, ref SoundParams> m_ParamsMapStatic map of cached sound params, to prevent having to recreate them
static ref ScriptInvoker Event_OnFrameUpdateStatic invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay.OnUpdate
protected static ref map<int, EffecterBase> m_EffectersMapStatic array of IDs that were previously used, but freed up by unregistering Effecters
protected static int m_HighestFreeEffecterID = 1Methods 31
Play an Effect
Returns: int The registered ID of the Effect
static int PlayOnObject(notnull Effect eff, Object obj, vector local_pos = "0 0 0", vector local_ori = "0 0 0", bool force_rotation_relative_to_world = false)Play an Effect
effEffectThe Effect to playobjObjectThe parent of the Effectlocal_posvectorThe local position to play the Effect in relation to the parent (Optional)local_orivectorThe local orientation to play the Effect in relation to the parent (Optional)force_rotation_relative_to_worldboolWhether to force the orientation to stay in WS (Optional)
Returns: int The registered ID of the Effect
Show 1 more
, PowerGeneratorBase.StartLoopSound()static void Stop(int effect_id)static EffectSound CreateSound(string sound_set, vector position, float play_fade_in = 0, float stop_fade_out = 0, bool loop = false, bool enviroment = false)Create an EffectSound
sound_setstringThe sound set name of the soundpositionvectorThe position to play the soundplay_fade_infloatThe fade in duration of the sound (Optional)stop_fade_outfloatThe fade out duration of the sound (Optional)loopboolWhether the sound should loop (Optional)enviromentboolWhether to set environment variables (Optional)
Returns: EffectSound The created EffectSound
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in = 0, float stop_fade_out = 0, bool loop = false)Create and play an EffectSound
sound_setstringThe sound set name of the soundpositionvectorThe position to play the soundplay_fade_infloatThe fade in duration of the sound (Optional)stop_fade_outfloatThe fade out duration of the sound (Optional)loopboolWhether the sound should loop (Optional)
Returns: EffectSound The created EffectSound
Show 26 more
, BearTrap.PlaySoundBiteEmpty(), BearTrap.PlaySoundBiteLeg(), BearTrap.PlaySoundOpen(), CarWheel.OnWasAttached(), CarWheel.OnWasDetached(), CrashBase.EEInit(), DayZGame.DelayedMidAirDetonation(), DayZGame.OnRPC(), Edible_Base.SoundCookingStart(), EntityAI.SoundHardBushFallingPlay(), EntityAI.SoundHardTreeFallingPlay(), EntityAI.SoundSoftBushFallingPlay(), EntityAI.SoundSoftTreeFallingPlay(), GeyserTrigger.UpdateGeyserState(), ItemBase.OnRPC(), ItemBase.PlayAttachSound(), ItemSoundHandler.PlayItemSoundClient(), LandMineTrap.PlayDisarmingLoopSound(), LandMineTrap.PlaySoundActivate(), LandMineTrap.StartActivate(), LargeTent.PlayRepackingLoopSound(), LargeTentBackPack.PlayRepackingLoopSound(), SpookyEventBase.Perform(), SpookyEventRustle.Do(), TripwireTrap.OnSteppedOn(), and Weapon_Base.OnFireModeChange()static EffectSound PlaySoundParams(notnull SoundParams params, vector position, float play_fade_in = 0, float stop_fade_out = 0, bool loop = false)Create and play an EffectSound
paramsSoundParamsParams to create the sound withpositionvectorThe position to play the soundplay_fade_infloatThe fade in duration of the sound (Optional)stop_fade_outfloatThe fade out duration of the sound (Optional)loopboolWhether the sound should loop (Optional)
Returns: EffectSound The created EffectSound
static EffectSound PlaySoundCachedParams(string sound_set, vector position, float play_fade_in = 0, float stop_fade_out = 0, bool loop = false)Create and play an EffectSound, using or creating cached SoundParams
sound_setstringThe sound set name of the soundpositionvectorThe position to play the soundplay_fade_infloatThe fade in duration of the sound (Optional)stop_fade_outfloatThe fade out duration of the sound (Optional)loopboolWhether the sound should loop (Optional)
Returns: EffectSound The created EffectSound
Show 1 more
, EffectSound.SoundPlayEx()static EffectSound PlaySoundEnviroment(string sound_set, vector position, float play_fade_in = 0, float stop_fade_out = 0, bool loop = false)Create and play an EffectSound, updating environment variables
sound_setstringThe sound set name of the soundpositionvectorThe position to play the soundplay_fade_infloatThe fade in duration of the sound (Optional)stop_fade_outfloatThe fade out duration of the sound (Optional)loopboolWhether the sound should loop (Optional)
Returns: EffectSound The created EffectSound
static EffectSound PlaySoundOnObject(string sound_set, Object parent_object, float play_fade_in = 0, float stop_fade_out = 0, bool loop = false)Create and play an EffectSound
sound_setstringThe sound set name of the soundparent_objectObjectThe parent Object for the sound to followplay_fade_infloatThe fade in duration of the sound (Optional)stop_fade_outfloatThe fade out duration of the sound (Optional)loopboolWhether the sound should loop (Optional)
Returns: EffectSound The created EffectSound
Show 3 more
, EffectSound.SetParent(), EffectSound.SoundPlay(), and vector.Zerostatic void DestroyEffect(Effect effect)Unregisters, stops and frees the Effect
effect_soundEffectSoundThe EffectSound to free
Show 36 more
, BoatScript.CleanupEffects(), Bottle_Base.~Bottle_Base(), CarScript.CleanupEffects(), CarScript.CleanupSound(), CarScript.FixEntity(), ChristmasTree.EEDelete(), ClockBase.~ClockBase(), ClockBase.OnRingingStartClient(), ClockBase.OnRingingStopClient(), ClockBase.OnVariablesSynchronized(), DayZIntroSceneXbox.~DayZIntroSceneXbox(), Defibrillator.~Defibrillator(), DestructionEffectBase.~DestructionEffectBase(), FireworksLauncher.~FireworksLauncher(), FireworksLauncherClientEvent.~FireworksLauncherClientEvent(), FlashbangEffect.~FlashbangEffect(), FlashbangEffect.StopSound(), GeyserTrigger.StopEffects(), GeyserTrigger.StopEruption(), GeyserTrigger.UpdateGeyserState(), ItemBase.~ItemBase(), ItemBase.OnRPC(), KitchenTimer.TurnOff(), LandMineTrap.~LandMineTrap(), LargeTent.~LargeTent(), LargeTentBackPack.~LargeTentBackPack(), ParticleEffecter.~ParticleEffecter(), PlayerBase.~PlayerBase(), PlayerBase.EEDelete(), PlayerBase.SetDecayEffects(), PowerGeneratorBase.~PowerGeneratorBase(), PowerGeneratorBase.OnWorkStop(), Roadflare.EEDelete(), DestroySound(), TreeEffecter.~TreeEffecter(), and TreeEffecter.OnVariablesSynchronized()Checks whether an Effect ID is registered in SEffectManager
effect_idintThe Effect ID to check
Returns: bool Whether there is an Effect registered for this ID
Registers Effect in SEffectManager
Returns: int The Effect ID
Show 7 more
, Class.GetDebugName(), GetFreeEffectID(), Effect.GetID(), map.Insert(), Effect.IsRegistered(), m_EffectsMap, and m_IsCleanupprotected static int GetFreeEffecterID()Show 2 more
, m_FreeEffecterIDs, and m_HighestFreeEffecterIDstatic void EffectUnregister(int id)Unregisters Effect in SEffectManager
idintThe ID of the Effect to unregister
Show 5 more
, array.Insert(), map.Remove(), m_EffectsMap, m_FreeEffectIDs, and m_IsCleanupstatic void EffectUnregisterEx(Effect effect)Unregisters Effect in SEffectManager
protected static int GetFreeEffectID()Show 2 more
, m_FreeEffectIDs, and m_HighestFreeEffectIDstatic bool DestroySound(EffectSound sound_effect)Legacy, backwards compatibility
sound_effectEffectSoundThe EffectSound to free
Returns: bool A bool which is always true
static SoundParams GetCachedSoundParam(string soundset)Get or create a cached SoundParams object
soundsetstringThe sound set name of the sound
Returns: SoundParams The cached SoundParams for the given soundset
static void Event_OnSoundWaveEnded(EffectSound effect_sound)Event called from EffectSound.Event_OnSoundWaveEnded
effect_soundEffectSoundThe EffectSound calling the event
static void Event_OnFrameUpdate(float time_delta)Event called on frame
time_deltafloatTime passed since the previous frame
static void Init()Initialize the containers
Show 3 more
, m_FreeEffectIDs, m_IsInitialized, and m_ParamsMapstatic void InitServer()static void Cleanup()Cleanup method to properly clean up the static data
Show 19 more
, map.Clear(), map.Count(), map.Count(), EntityAI.Delete(), typename.EnumToString(), ErrorEx(), Effect.Event_OnUnregistered(), string.Format(), Class.GetDebugName(), Effect.GetEffectType(), CGame.IsDedicatedServer(), Print(), Event_OnFrameUpdate, m_EffectersMap, m_EffectsMap, m_HighestFreeEffectID, m_IsCleanup, m_IsInitialized, and m_ParamsMapstatic int CreateParticleServer(vector pos, EffecterParameters parameters)returns unique effecter ID
Show 4 more
, EffecterBase.Init(), map.Insert(), m_EffectersMap, and EffecterParameters.m_EffecterTypestatic void ReinitParticleServer(int effecterID, EffecterParameters parameters)allows re-initializing existing effecter with new parameters (extept m_EffecterType, obviously)
static void ReactivateParticleServer(int effecterID)static void StartParticleServer(int effecterID)static void StopParticleServer(int effecterID)static void DestroyEffecterParticleServer(int effecterID)static void OnUpdate(float timeslice)