117 if (
m_Parent.MemoryPointExists(memoryPointName))
118 return m_Parent.GetMemoryPointPos(memoryPointName);
130 #ifdef DIAG_DEVELOPER
144 for (
int i = 0; i < count; ++i)
149 #ifdef DIAG_DEVELOPER
183 surfaceParams.
position = parent.GetPosition();
184 g_Game.GetSurface(surfaceParams, surfaceResult);
185 surfaceInfo = surfaceResult.
surface;
189 if(data.m_EffectId == -1)
192 if (data.m_Position ==
"-1 -1 -1")
195 data.m_Effect.ParticleParamsOverride(data.m_ParticleParamsData);
204 if (!data.m_Effect.IsPlaying())
206 data.m_Effect.Start();
207 data.m_ParticleParamsData.ClearAll();
213 data.m_Effect.SelectFromSurface(surfaceInfo);
218 data.m_Effect.ParticleParamsOverride(data.m_ParticleParamsData);
308 #ifdef DIAG_DEVELOPER
379 #ifdef DIAG_DEVELOPER
422 #ifdef DIAG_DEVELOPER
429 data.SetCooldown(seconds);
459 float maxRemaining = 0;
462 float remaining = data.GetRemainingCooldown();
463 if (remaining > maxRemaining)
464 maxRemaining = remaining;
479 data.ResetCooldown();
505 if (!groupData || !positions)
508 int count =
Math.
Min(groupData.Count(), positions.Count());
509 for (
int i = 0; i < count; ++i)
524 data.m_Effect.SetParticleState(particleId);
537 if (data && data.m_ParticleParamsData)
538 return data.m_ParticleParamsData;
542 #ifdef DIAG_DEVELOPER
566 #ifdef DIAG_DEVELOPER
570 Print(
string.Format(
"[VFX] group '%1' members=%2",
EnumTools.
EnumToString(EVehicleVFXEffectGroup, groupId), groupData.Count()));
578 foreach (
int effectId, VehicleVFXData data :
m_EffectsMap)
579 Print(
string.Format(
"[VFX] '%1' cooldown=%2s canPlay=%3 remaining=%4s", EnumTools.EnumToString(
EVehicleVFXEffect, effectId), data.GetCooldown(), data.CanPlay(), data.GetRemainingCooldown()));
583 foreach (
int index, VehicleVFXData groupEffectData : groupData)
584 Print(
string.Format(
"[VFX] group '%1'[%2] cooldown=%3s canPlay=%4 remaining=%5s", EnumTools.EnumToString(EVehicleVFXEffectGroup, groupId), index, groupEffectData.GetCooldown(), groupEffectData.CanPlay(), groupEffectData.GetRemainingCooldown()));
EVehicleVFXEffect
Identifiers of individual vehicle VFX effects.
vector m_Position
Cached world position.
void VehicleVFXDataParams(vector position=vector.Zero, vector orientation=vector.Up, float cooldownSec=0.0)
override void Stop()
Stops all elements this effect consists of.
void SetParticleState(int state)
override void SetCurrentLocalPosition(vector pos, bool updateCached=true)
Set the current local position of the managed Particle.
Wrapper class for managing particles through SEffectManager.
Legacy way of using particles in the game.
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.
Manager class for managing Effect (EffectParticle, EffectSound)
vector position
3D position to trace the surface from
UseObjectsMode syncMode
See UseObjectsMode, SurfaceTraceType.Roadway only.
SurfaceInfo surface
Returned SurfaceInfo, plain pointer.
void StopEffectGroup(EVehicleVFXEffectGroup groupId)
void SetEffectCooldown(EVehicleVFXEffect effectId, float seconds)
void ResetEffectGroupCooldown(EVehicleVFXEffectGroup groupId)
float GetEffectGroupRemainingCooldown(EVehicleVFXEffectGroup groupId)
longest remaining cooldown across the group members
bool IsEffectDataPlaying(VehicleVFXData data)
void SetEffectGroupParticleState(EVehicleVFXEffectGroup groupId, int particleId)
bool IsEffectPlayed(EVehicleVFXEffect effectId)
float GetEffectRemainingCooldown(EVehicleVFXEffect effectId)
void PlayEffectData(notnull VehicleVFXData data, EntityAI parent)
void PlayEffect(EVehicleVFXEffect effectId, EntityAI parent=null)
single effect API
SurfaceInfo m_SurfaceInfo
void StopEffectData(VehicleVFXData data)
void SetEffectGroupCooldown(EVehicleVFXEffectGroup groupId, float seconds)
bool m_SurfaceInfoOverriden
bool CanPlayEffectData(VehicleVFXData data)
ref map< int, ref array< ref VehicleVFXData > > m_EffectGroupsMap
keyed by EVehicleVFXEffectGroup
bool CanPlayEffect(EVehicleVFXEffect effectId)
void RegisterEffectGroup(EVehicleVFXEffectGroup groupId, typename effectTypename, int count, VehicleVFXDataParams params)
register multiple instances of single type of effect owned by the given group
void SetEffectDataPosition(VehicleVFXData data, vector position)
void SetEffectParticleState(EVehicleVFXEffect effectId, int particleId)
void ResetEffectCooldown(EVehicleVFXEffect effectId)
ref ParticleParamsOverrideData GetParticleParamsOverrideData(EVehicleVFXEffect effectId)
void StopEffect(EVehicleVFXEffect effectId)
vector ConvertMemPointToPosition(string memoryPointName)
void SetSurfaceInfo(SurfaceInfo surfaceInfo)
bool IsEffectGroupPlayed(EVehicleVFXEffectGroup groupId)
true when any member of the group is playing
ref map< int, ref VehicleVFXData > m_EffectsMap
keyed by EVehicleVFXEffect
void SetEffectGroupPositions(EVehicleVFXEffectGroup groupId, TVectorArray positions)
void PlayEffectGroup(EVehicleVFXEffectGroup groupId, EntityAI parent=null)
effect group API
void SetEffectPosition(EVehicleVFXEffect effectId, vector position)
bool CanPlayEffectGroup(EVehicleVFXEffectGroup groupId)
true only when every member of the group can play
VehicleVFXData CreateEffectData(typename effectTypename, VehicleVFXDataParams params)
void VehicleVFXComponent(notnull EntityAI parent)
void RegisterEffect(EVehicleVFXEffect effectId, typename effectTypename, VehicleVFXDataParams params)
register single instance of effect
ref ParticleParamsOverrideData GetEffectGroupParticleParamsOverrideData(EVehicleVFXEffectGroup groupId)
float GetRemainingCooldown()
void SetCooldown(float seconds)
set the cooldown window (in seconds); 0 disables the guard
ref EffectParticle m_Effect
ref ParticleParamsOverrideData m_ParticleParamsData
void SetPosition(vector position)
bool CanPlay()
true if enough time has elapsed since the last playback (or it never played / no cooldown set)
int m_LastPlayedTime
g_Game.GetTime() (ms) when this effect last started; -1 = never played
float m_CooldownSec
minimum seconds required between playbacks (0 = no guard)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto void Print(void var)
Prints content of variable to console/log.
array< vector > TVectorArray
static proto float Min(float x, float y)
Returns smaller of two given values.