![]() |
Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
|
Manager class for managing Effect (EffectParticle, EffectSound). More...
Static Protected Member Functions | |
Generic playback | |
Methods for playing Effect
| |
| static int | PlayInWorld (notnull Effect eff, vector pos) |
| Play an 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. | |
| static void | Stop (int effect_id) |
| Stops the Effect. | |
Create/Play sound | |
Methods for playing/creating sound | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
Generic API | |
General methods used for SEffectManager | |
| static void | DestroyEffect (Effect effect) |
| Unregisters, stops and frees the Effect. | |
| static bool | IsEffectExist (int effect_id) |
| Checks whether an Effect ID is registered in SEffectManager. | |
| static Effect | GetEffectByID (int effect_id) |
| Gets the Effect with the given registered Effect ID. | |
| static int | EffectRegister (Effect effect) |
| Registers Effect in SEffectManager. | |
| static int | GetFreeEffecterID () |
| static void | EffectUnregister (int id) |
| Unregisters Effect in SEffectManager. | |
| static void | EffectUnregisterEx (Effect effect) |
| Unregisters Effect in SEffectManager. | |
| static int | GetFreeEffectID () |
| Helper function for EffectRegister to decide an Effect ID. | |
Sound helpers | |
Sound specific helper methods | |
| static bool | DestroySound (EffectSound sound_effect) |
| Legacy, backwards compatibility. | |
| static SoundParams | GetCachedSoundParam (string soundset) |
| Get or create a cached SoundParams object. | |
Events | |
Various events that can be overriden for custom behaviour | |
| static void | Event_OnSoundWaveEnded (EffectSound effect_sound) |
| Event called from EffectSound.Event_OnSoundWaveEnded. | |
| static void | Event_OnFrameUpdate (float time_delta) |
| Event called on frame. | |
Lifetime | |
Creation and cleanup | |
| static void | Init () |
| Initialize the containers. | |
| static void | InitServer () |
| static void | Cleanup () |
| Cleanup method to properly clean up the static data. | |
| static int | CreateParticleServer (vector pos, EffecterParameters parameters) |
| returns unique effecter ID | |
| static 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) |
Static Protected Attributes | |
| static ref ScriptInvoker | Event_OnFrameUpdate |
| Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay.OnUpdate. | |
| static const int | INVALID_ID = 0 |
| As the counter starts at 1, Effect ID can never be 0. | |
| static ref map< int, EffecterBase > | m_EffectersMap |
| static ref map< int, ref Effect > | m_EffectsMap |
| Static map of all registered effects <id, Effect>. | |
| static ref array< int > | m_FreeEffecterIDs |
| Static array of IDs that were previously used, but freed up by unregistering Effecters. | |
| static ref array< int > | m_FreeEffectIDs |
| Static array of IDs that were previously used, but freed up by unregistering. | |
| static int | m_HighestFreeEffecterID = 1 |
| static int | m_HighestFreeEffectID = 1 |
| Counter for quickly getting the next ID if FreeEffectIDs array is empty. | |
| static bool | m_IsCleanup |
| Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed. | |
| static bool | m_IsInitialized |
| Bool to check whether Init was called. | |
| static ref map< string, ref SoundParams > | m_ParamsMap |
| Static map of cached sound params, to prevent having to recreate them. | |
Manager class for managing Effect (EffectParticle, EffectSound).
Definition at line 5 of file effectmanager.c.
|
inlinestaticprotected |
Cleanup method to properly clean up the static data.
Definition at line 518 of file effectmanager.c.
References Effect(), EffecterBase(), ErrorEx, Event_OnFrameUpdate, g_Game, m_EffectersMap, m_EffectsMap, m_HighestFreeEffectID, m_IsCleanup, m_IsInitialized, m_ParamsMap, and Print().
Referenced by CGame::~CGame(), and MissionBaseWorld::MissionBase().
|
inlinestaticprotected |
returns unique effecter ID
Definition at line 577 of file effectmanager.c.
References ECE_PLACE_ON_SURFACE, EffecterBase(), EffecterParameters(), g_Game, GetFreeEffecterID(), and m_EffectersMap.
Referenced by Car::CheckContactCache(), ActionMineBush::OnExecuteServer(), OnExecuteServer(), ItemBase::PlayCatchParticleSynced(), and ActionFishingNew::PlaySplashEffectSynced().
|
inlinestaticprotected |
Create an EffectSound.
| sound_set | string The sound set name of the sound |
| position | vector The position to play the sound |
| play_fade_in | float The fade in duration of the sound (Optional) |
| stop_fade_out | float The fade out duration of the sound (Optional) |
| loop | bool Whether the sound should loop (Optional) |
| enviroment | bool Whether to set environment variables (Optional) |
EffectSound The created EffectSound Definition at line 144 of file effectmanager.c.
References EffectRegister(), EffectSound::SetEnviromentVariables(), EffectSound::SetSoundFadeIn(), EffectSound::SetSoundFadeOut(), EffectSound::SetSoundLoop(), and EffectSound::SetSoundSet().
Referenced by BoatScript::HandleBoatSplashSound(), FlashbangEffect::PlaySound(), PlaySound(), PlaySoundCachedParams(), PlaySoundEnviroment(), PlaySoundOnObject(), PlaySoundParams(), and UpdateMusic().
|
inlinestaticprotected |
Unregisters, stops and frees the Effect.
| effect_sound | EffectSound The EffectSound to free |
Definition at line 271 of file effectmanager.c.
References Effect().
Referenced by ~Bottle_Base(), ~ClockBase(), DayZIntroSceneXbox::~DayZIntroSceneXbox(), ItemBase::~Defibrillator(), DestructionEffectBase::~DestructionEffectBase(), FireworksLauncher::~FireworksLauncher(), FireworksLauncherClientEvent::~FireworksLauncherClientEvent(), FlashbangEffect::~FlashbangEffect(), InventoryItem::~ItemBase(), ~LandMineTrap(), ~LargeTent(), Backpack_Base::~LargeTentBackPack(), ParticleEffecter::~ParticleEffecter(), ManBase::~PlayerBase(), ItemBase::~PowerGeneratorBase(), ~TreeEffecter(), BoatScript::CleanupEffects(), Car::CleanupEffects(), Car::CleanupSound(), Destroy(), ActionBuildShelter::DestroyActionLoopSound(), DestroySound(), EEDelete(), House::EEDelete(), ManBase::EEDelete(), Roadflare::EEDelete(), OnRingingStartClient(), OnRingingStopClient(), InventoryItem::OnRPC(), OnVariablesSynchronized(), ItemBase::OnWorkStop(), RemoveParticle(), ManBase::SetDecayEffects(), GeyserTrigger::StopEffects(), FlashbangEffect::StopSound(), KitchenTimer::TurnOff(), and GeyserTrigger::UpdateGeyserState().
|
inlinestaticprotected |
Definition at line 630 of file effectmanager.c.
References EffecterBase(), and m_EffectersMap.
Referenced by DecreaseLifespan(), ActionFishingNewCB::DestroySplashEffectSynced(), OnEndServer(), and ItemBase::SetActive().
|
inlinestaticprotected |
Legacy, backwards compatibility.
| sound_effect | EffectSound The EffectSound to free |
bool A bool which is always true Definition at line 432 of file effectmanager.c.
References DestroyEffect().
Referenced by CleanSoundEffects(), CleanUpOnClosedClient(), and Land_Underground_Stairs_Exit::CleanUpOnClosedClient().
Registers Effect in SEffectManager.
| effect | Effect The Effect to register |
int The Effect ID Definition at line 322 of file effectmanager.c.
References Effect(), ErrorEx, GetFreeEffectID(), m_EffectsMap, and m_IsCleanup.
Referenced by CreateSound(), Car::HandleDoorsSound(), Car::HandleEngineSound(), Car::HandleSeatAdjustmentSound(), CarScript::OnAnimationPhaseStarted(), PlayInWorld(), and PlayOnObject().
|
inlinestaticprotected |
Unregisters Effect in SEffectManager.
| id | int The ID of the Effect to unregister |
Definition at line 369 of file effectmanager.c.
References Effect(), m_EffectsMap, m_FreeEffectIDs, and m_IsCleanup.
Referenced by ~Effect(), and EffectUnregisterEx().
|
inlinestaticprotected |
Unregisters Effect in SEffectManager.
| effect | Effect The Effect to unregister |
Definition at line 391 of file effectmanager.c.
References Effect(), and EffectUnregister().
Referenced by BoatScript::CleanupEffects().
|
inlinestaticprotected |
Event called on frame.
| time_delta | float Time passed since the previous frame |
Definition at line 480 of file effectmanager.c.
References Event_OnFrameUpdate.
|
inlinestaticprotected |
Event called from EffectSound.Event_OnSoundWaveEnded.
| effect_sound | EffectSound The EffectSound calling the event |
Definition at line 468 of file effectmanager.c.
Referenced by EffectSound::Event_OnRegistered(), and EffectSound::Event_OnUnregistered().
|
inlinestaticprotected |
Get or create a cached SoundParams object.
| soundset | string The sound set name of the sound |
SoundParams The cached SoundParams for the given soundset Definition at line 443 of file effectmanager.c.
References m_ParamsMap, and SoundParams().
Referenced by PlaySoundCachedParams().
Gets the Effect with the given registered Effect ID.
| effect_id | int The Effect ID |
Effect The Effect registered to the ID or null Definition at line 307 of file effectmanager.c.
References Effect(), m_EffectsMap, and m_IsCleanup.
|
inlinestaticprotected |
Definition at line 344 of file effectmanager.c.
References m_FreeEffecterIDs, and m_HighestFreeEffecterID.
Referenced by CreateParticleServer().
|
inlinestaticprotected |
Helper function for EffectRegister to decide an Effect ID.
int A currently unused Effect ID Definition at line 400 of file effectmanager.c.
References m_FreeEffectIDs, and m_HighestFreeEffectID.
Referenced by EffectRegister().
|
inlinestaticprotected |
Initialize the containers.
Definition at line 498 of file effectmanager.c.
References Event_OnFrameUpdate, m_EffectsMap, m_FreeEffectIDs, m_IsInitialized, and m_ParamsMap.
Referenced by CGame::CGame().
|
inlinestaticprotected |
Definition at line 508 of file effectmanager.c.
References m_EffectersMap, and m_FreeEffecterIDs.
Referenced by CGame::CGame().
Checks whether an Effect ID is registered in SEffectManager.
| effect_id | int The Effect ID to check |
bool Whether there is an Effect registered for this ID Definition at line 294 of file effectmanager.c.
References m_EffectsMap, and m_IsCleanup.
Referenced by Car::CreateCarDestroyedEffect(), Car::EOnPostSimulate(), and ManBase::SetDecayEffects().
|
inlinestaticprotected |
Definition at line 640 of file effectmanager.c.
References EffecterBase(), and m_EffectersMap.
Referenced by CGame::OnUpdate().
Play an Effect.
| eff | Effect The Effect to play |
| pos | vector The position to play the Effect |
int The registered ID of the Effect Definition at line 47 of file effectmanager.c.
References Effect(), and EffectRegister().
Referenced by Hit_MeatBones::BloodSplatGround(), CreateParticle(), ImpactMaterials::EvaluateImpactEffect(), ManBase::OnParticleEvent(), OnVariablesSynchronized(), ParticleEffecter::OnVariablesSynchronized(), AmmoEffects::PlayAmmoEffect(), DayZIntroSceneXbox::SetupParticles(), and Explosion::SpawnEffect().
|
inlinestaticprotected |
Play an Effect.
| eff | Effect The Effect to play |
| obj | Object The parent of the Effect |
| local_pos | vector The local position to play the Effect in relation to the parent (Optional) |
| local_ori | vector The local orientation to play the Effect in relation to the parent (Optional) |
| force_rotation_relative_to_world | bool Whether to force the orientation to stay in WS (Optional) |
int The registered ID of the Effect Definition at line 70 of file effectmanager.c.
References Effect(), EffectRegister(), ErrorEx, and EffectParticle::ForceParticleRotationRelativeToWorld().
Referenced by Car::CreateCarDestroyedEffect(), Car::EOnPostSimulate(), ManBase::SetDecayEffects(), and ItemBase::StartLoopSound().
|
inlinestaticprotected |
Create and play an EffectSound.
| sound_set | string The sound set name of the sound |
| position | vector The position to play the sound |
| play_fade_in | float The fade in duration of the sound (Optional) |
| stop_fade_out | float The fade out duration of the sound (Optional) |
| loop | bool Whether the sound should loop (Optional) |
EffectSound The created EffectSound Definition at line 169 of file effectmanager.c.
References CreateSound(), and EffectSound::SoundPlay().
Referenced by CGame::DelayedMidAirDetonation(), House::EEInit(), Weapon::OnFireModeChange(), CGame::OnRPC(), InventoryItem::OnRPC(), OnSteppedOn(), InventoryItemSuper::OnWasAttached(), InventoryItemSuper::OnWasDetached(), SpookyEventBase::Perform(), ActionBuildShelter::PlayActionFinishSound(), ActionBuildShelter::PlayActionLoopSound(), ActionBuildShelter::PlayActionStartSound(), InventoryItem::PlayAttachSound(), PlayDisarmingLoopSound(), PlayItemSoundClient(), Backpack_Base::PlayRepackingLoopSound(), PlayRepackingLoopSound(), PlaySoundActivate(), TrapBase::PlaySoundBiteEmpty(), TrapBase::PlaySoundBiteLeg(), TrapBase::PlaySoundOpen(), Edible_Base::SoundCookingStart(), Entity::SoundHardBushFallingPlay(), Entity::SoundHardTreeFallingPlay(), Entity::SoundSoftBushFallingPlay(), Entity::SoundSoftTreeFallingPlay(), StartActivate(), and GeyserTrigger::UpdateGeyserState().
|
inlinestaticprotected |
Create and play an EffectSound, using or creating cached SoundParams.
| sound_set | string The sound set name of the sound |
| position | vector The position to play the sound |
| play_fade_in | float The fade in duration of the sound (Optional) |
| stop_fade_out | float The fade out duration of the sound (Optional) |
| loop | bool Whether the sound should loop (Optional) |
EffectSound The created EffectSound Definition at line 207 of file effectmanager.c.
References CreateSound(), GetCachedSoundParam(), SoundParams(), and EffectSound::SoundPlayEx().
Referenced by Land_WarheadStorage_PowerStation::OnVariablesSynchronized(), PlayItemSoundClient(), BoatScript::PlaySound(), and Car::PlaySoundEx().
|
inlinestaticprotected |
Create and play an EffectSound, updating environment variables.
| sound_set | string The sound set name of the sound |
| position | vector The position to play the sound |
| play_fade_in | float The fade in duration of the sound (Optional) |
| stop_fade_out | float The fade out duration of the sound (Optional) |
| loop | bool Whether the sound should loop (Optional) |
EffectSound The created EffectSound Definition at line 228 of file effectmanager.c.
References CreateSound(), and EffectSound::SoundPlay().
Referenced by ScriptConsoleSoundsTab::HandleKeys(), ScriptConsoleSoundsTab::OnClick(), ContainerLockedBase::OnDoorUnlocked(), OnVariablesSynchronized(), ItemBase::PlayCatchSound(), and IEntity::PlaySoundSetAtMemoryPoint().
|
inlinestaticprotected |
Create and play an EffectSound.
| sound_set | string The sound set name of the sound |
| parent_object | Object The parent Object for the sound to follow |
| play_fade_in | float The fade in duration of the sound (Optional) |
| stop_fade_out | float The fade out duration of the sound (Optional) |
| loop | bool Whether the sound should loop (Optional) |
EffectSound The created EffectSound Definition at line 247 of file effectmanager.c.
References CreateSound(), EffectSound::SetParent(), EffectSound::SoundPlay(), and vector::Zero.
Referenced by ItemBase::DischargeClient(), ManBase::EEHitByRemote(), ManBase::OnBleedingSourceAdded(), ItemBase::OnIsCharged(), ManBase::OnPlayerRecievedHit(), ItemBase::OnWorkStart(), PlayEmptyingLoopSound(), PlayPouringLoopSound(), PlaySound(), IEntity::PlaySoundSet(), and StopEmptyingLoopSound().
|
inlinestaticprotected |
Create and play an EffectSound.
| params | SoundParams Params to create the sound with |
| position | vector The position to play the sound |
| play_fade_in | float The fade in duration of the sound (Optional) |
| stop_fade_out | float The fade out duration of the sound (Optional) |
| loop | bool Whether the sound should loop (Optional) |
EffectSound The created EffectSound Definition at line 188 of file effectmanager.c.
References CreateSound(), SoundParams(), and EffectSound::SoundPlayEx().
|
inlinestaticprotected |
Definition at line 602 of file effectmanager.c.
References EffecterBase(), and m_EffectersMap.
Referenced by ActionMineBush::OnExecuteServer(), OnExecuteServer(), ItemBase::PlayCatchParticleSynced(), and ActionFishingNew::PlaySplashEffectSynced().
|
inlinestaticprotected |
allows re-initializing existing effecter with new parameters (extept m_EffecterType, obviously)
Definition at line 593 of file effectmanager.c.
References EffecterBase(), EffecterParameters(), and m_EffectersMap.
Referenced by ItemBase::PlayCatchParticleSynced(), and ActionFishingNew::PlaySplashEffectSynced().
|
inlinestaticprotected |
Definition at line 611 of file effectmanager.c.
References EffecterBase(), and m_EffectersMap.
|
inlinestaticprotected |
Stops the Effect.
| effect_id | int The ID of the Effect to Stop |
Definition at line 110 of file effectmanager.c.
References Effect(), ErrorEx, and m_EffectsMap.
Referenced by Car::EOnPostSimulate().
|
inlinestaticprotected |
Definition at line 621 of file effectmanager.c.
References EffecterBase(), and m_EffectersMap.
|
staticprotected |
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay.OnUpdate.
Definition at line 24 of file effectmanager.c.
Referenced by Cleanup(), Event_OnFrameUpdate(), Init(), MissionBase::OnUpdate(), and SetEnableEventFrame().
|
staticprotected |
As the counter starts at 1, Effect ID can never be 0.
Definition at line 14 of file effectmanager.c.
Referenced by Event_OnUnregistered().
|
staticprotected |
Definition at line 26 of file effectmanager.c.
Referenced by Cleanup(), CreateParticleServer(), DestroyEffecterParticleServer(), InitServer(), OnUpdate(), ReactivateParticleServer(), ReinitParticleServer(), StartParticleServer(), and StopParticleServer().
Static map of all registered effects <id, Effect>.
Definition at line 8 of file effectmanager.c.
Referenced by Cleanup(), EffectRegister(), EffectUnregister(), GetEffectByID(), Init(), IsEffectExist(), and Stop().
Static array of IDs that were previously used, but freed up by unregistering Effecters.
Definition at line 28 of file effectmanager.c.
Referenced by GetFreeEffecterID(), and InitServer().
Static array of IDs that were previously used, but freed up by unregistering.
Definition at line 10 of file effectmanager.c.
Referenced by EffectUnregister(), GetFreeEffectID(), and Init().
|
staticprotected |
Definition at line 30 of file effectmanager.c.
Referenced by GetFreeEffecterID().
|
staticprotected |
Counter for quickly getting the next ID if FreeEffectIDs array is empty.
Definition at line 12 of file effectmanager.c.
Referenced by Cleanup(), and GetFreeEffectID().
|
staticprotected |
Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed.
Definition at line 16 of file effectmanager.c.
Referenced by Cleanup(), EffectRegister(), EffectUnregister(), GetEffectByID(), and IsEffectExist().
|
staticprotected |
Bool to check whether Init was called.
Definition at line 18 of file effectmanager.c.
|
staticprotected |
Static map of cached sound params, to prevent having to recreate them.
Definition at line 21 of file effectmanager.c.
Referenced by Cleanup(), GetCachedSoundParam(), and Init().