54 eff.SetPosition( pos );
80 eff.SetPosition(local_pos);
84 eff.SetPosition(obj.GetPosition());
88 eff.SetLocalPosition(local_pos);
89 eff.SetAttachedLocalOri(local_ori);
91 if (force_rotation_relative_to_world)
110 static void Stop(
int effect_id)
120 ErrorEx(
string.Format(
"Failed to stop Effect with ID %1. The ID is not registered in m_EffectsMap!", effect_id));
144 static EffectSound CreateSound(
string sound_set,
vector position,
float play_fade_in = 0,
float stop_fade_out = 0,
bool loop =
false,
bool enviroment =
false)
148 effect_sound.SetPosition(position);
190 EffectSound effect_sound =
CreateSound(params.GetName(), position, play_fade_in, stop_fade_out, loop,
false);
211 EffectSound effect_sound =
CreateSound(params.GetName(), position, play_fade_in, stop_fade_out, loop,
false);
249 EffectSound effect_sound =
CreateSound(sound_set, parent_object.GetPosition(), play_fade_in, stop_fade_out, loop);
275 if (effect.CanDestroy())
283 effect.SetAutodestroy(
true);
324 if (effect.IsRegistered())
326 ErrorEx(
string.Format(
"Attempted to register Effect '%1' which was already registered.", effect.GetDebugName()),
ErrorExSeverity.INFO);
327 return effect.GetID();
336 effect.Event_OnRegistered(
id);
339 ErrorEx(
"Attempted to register Effect while SEffectManager is cleaning up, request ignored.",
ErrorExSeverity.WARNING);
377 effect.Event_OnUnregistered();
541 Print(
"--- SEffectManager Cleanup dump - Begin ------------------------");
549 eff.Event_OnUnregistered();
551 Print(
string.Format(
"%1 :: %2 :: %3", eff,
typename.EnumToString(
EffectType, eff.GetEffectType()), eff.GetDebugName() ));
561 Print(
"--- SEffectManager Cleanup dump - End --------------------------");
588 eff.Init(
id, parameters);
598 eff.Init(effecterID,parameters);
646 effecter.DecreaseLifespan(timeslice);
692 RegisterNetSyncVariableInt(
"m_CommandSync");
757 return EInventoryIconVisibility.HIDE_VICINITY;
770 RegisterNetSyncVariableInt(
"m_ParticleEffectIDSync");
775 super.Init(
id, parameters);
808 case EffecterCommands.START:
816 case EffecterCommands.STOP:
823 case EffecterCommands.REACTIVATE0:
824 case EffecterCommands.REACTIVATE1:
872 super.SetParticleID(
id);
override void OnVariablesSynchronized()
const int ECE_PLACE_ON_SURFACE
void Start()
Plays all elements this effects consists of.
EffectType
Enum to determine what type of effect the Effect is.
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
bool IsPlaying()
Returns true when the Effect is playing, false otherwise.
void DecreaseLifespan(float timeSlice)
ParticleEffecter m_LastParticleID
class SEffectManager m_EffecterType
void EffecterParameters(string type, float lifespan)
class SEffectManager REACTIVATE0
void EffectParticleGeneral()
class SEffectManager START
void SetLifespan(float lifespan)
override int GetHideIconMask()
ParticleEffecterParameters NOT_DEFINED_LIFESPAN
override void Stop()
Stops all elements this effect consists of.
override void Start()
Plays all elements this effect consists of.
void SetParticleID(int id)
Sets the id of the particle to be used.
void SetParticle(Particle p)
Sets the main particle which this Effect will manage.
void ForceParticleRotationRelativeToWorld(bool state)
Set orientation setting to be used by the effect when the Effect starts.
Wrapper class for managing particles through SEffectManager.
void SetSoundSet(string snd)
Set soundset for the sound.
override void SetParent(Object parent_obj)
Set parent for the sound to follow.
bool SoundPlayEx(out SoundParams params)
Plays sound.
void SetSoundLoop(bool loop)
Set if the sound loops.
void SetSoundFadeIn(float fade_in)
Set the sound fade in duration.
void SetSoundFadeOut(float fade_out)
Set the sound fade out duration.
void SetEnviromentVariables(bool setEnvVariables)
Sets whether AddEnvSoundVariables needs to be called during Loading.
bool SoundPlay()
Plays sound.
Wrapper class for managing sound through SEffectManager.
override void Init(int id, EffecterParameters parameters)
ref EffectParticleGeneral m_Effect
void ParticleEffecter(int lifespan)
void SetParticle(int particleID)
override void OnVariablesSynchronized()
int m_ParticleEffectIDSync
void ParticleEffecterParameters(string type, float lifespan, int particleID)
static void Event_OnSoundWaveEnded(EffectSound effect_sound)
Event called from EffectSound.Event_OnSoundWaveEnded.
static int GetFreeEffecterID()
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 void EffectUnregister(int id)
Unregisters Effect in SEffectManager.
static void Cleanup()
Cleanup method to properly clean up the static data.
static ref map< int, EffecterBase > m_EffectersMap
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 ref array< int > m_FreeEffecterIDs
Static array of IDs that were previously used, but freed up by unregistering Effecters.
static void DestroyEffecterParticleServer(int effecterID)
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 int GetFreeEffectID()
Helper function for EffectRegister to decide an Effect ID.
static ref array< int > m_FreeEffectIDs
Static array of IDs that were previously used, but freed up by unregistering.
static const int INVALID_ID
As the counter starts at 1, Effect ID can never be 0.
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
static ref ScriptInvoker Event_OnFrameUpdate
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay....
static int m_HighestFreeEffecterID
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 int CreateParticleServer(vector pos, EffecterParameters parameters)
returns unique effecter ID
static Effect GetEffectByID(int effect_id)
Gets the Effect with the given registered Effect ID.
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.
static ref map< int, ref Effect > m_EffectsMap
Static map of all registered effects <id, Effect>
static int m_HighestFreeEffectID
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 void OnUpdate(float timeslice)
static void Init()
Initialize the containers.
static void StartParticleServer(int effecterID)
static void Stop(int effect_id)
Stops the Effect.
static SoundParams GetCachedSoundParam(string soundset)
Get or create a cached SoundParams object.
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 bool m_IsInitialized
Bool to check whether Init was called.
static bool IsEffectExist(int effect_id)
Checks whether an Effect ID is registered in SEffectManager.
static bool DestroySound(EffectSound sound_effect)
Legacy, backwards compatibility.
static void EffectUnregisterEx(Effect effect)
Unregisters Effect in SEffectManager.
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 ref map< string, ref SoundParams > m_ParamsMap
Static map of cached sound params, to prevent having to recreate them.
static void ReinitParticleServer(int effecterID, EffecterParameters parameters)
allows re-initializing existing effecter with new parameters (extept m_EffecterType,...
static int EffectRegister(Effect effect)
Registers Effect in SEffectManager.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
static void StopParticleServer(int effecterID)
static void Event_OnFrameUpdate(float time_delta)
Event called on frame.
static void ReactivateParticleServer(int effecterID)
Manager class for managing Effect (EffectParticle, EffectSound)
ScriptInvoker Class provide list of callbacks usage:
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
class SoundObject SoundParams(string name)
void Stop()
Stops all elements this effect consists of.