91 string configPath =
"CfgMagazines ";
92 string childClass =
"";
94 int count =
g_Game.ConfigGetChildrenCount(configPath);
97 for (
int i = 0; i < count; ++i)
99 g_Game.ConfigGetChildName(configPath, i, childClass);
105 int effCount =
g_Game.ConfigGetChildrenCount(configPath + childClass +
" Effects");
109 for (
int j = 0; j < effCount; ++j)
112 g_Game.ConfigGetChildName(configPath + childClass +
" Effects", j, stance);
114 string effectPath = configPath + childClass +
" Effects" +
" " + stance;
120 minDist =
g_Game.ConfigGetFloat(effectPath +
" minDist");
121 maxDist =
g_Game.ConfigGetFloat(effectPath +
" maxDist");
122 g_Game.ConfigGetTextArray(effectPath +
" Effects", effects);
137 string configPath =
"CfgSurfaces ";
138 string childClass =
"";
140 int count =
g_Game.ConfigGetChildrenCount(configPath);
143 for (
int i = 0; i < count; ++i)
145 g_Game.ConfigGetChildName(configPath, i, childClass);
149 int effectsCount =
g_Game.ConfigGetChildrenCount(configPath + childClass +
" DustEffects");
152 for (
int j = 0; j < effectsCount; j++)
154 string dustPath =
" ";
155 string effectClass =
" ";
157 g_Game.ConfigGetChildName(configPath + childClass +
" DustEffects", j, effectClass);
160 g_Game.ConfigGetText(configPath + childClass +
" DustEffects" +
" " + effectClass +
" path", dustPath);
162 if (dustPath.
Length() > 1)
168 if (effectsCount > 0)
179 float distance = fraction * depth;
186 if (distance >= data.m_MinDistance && distance < data.m_MaxDistance)
187 return data.m_Variants;
197 if (!dustKickupSound)
199 string errorMsgSound =
"Soundset is invalid, please check the value of m_DustKickupSoundSetName, as well as the config to see if the soundset is correct";
204 dustKickupSound.SetPosition(params.
position);
210 float now =
g_Game.GetTickTime();
225 if (!surfaceVariants)
228 bool effectPlayed =
false;
230 foreach (
string name : particleNames)
236 string errorMsg =
"No such particles exists. Check to see if the name of the particle inside the ammo config is correct";
237 ErrorEx(
string.Format(
"Particle: '%1'",
name, errorMsg));
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
class DustKickupEffectDistanceData DustKickupParticleData
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
ParticleAutoDestroyFlags
Flags to pass to ParticleSource.SetParticleAutoDestroyFlags.
ref array< string > m_Variants
void DustKickupEffectDistanceData(float minDist, float maxDist, array< string > variants)
float m_TimeUntilNextEffect
const float EFFECT_COOLDOWN_MAX
void LoadDustEffectPaths()
Going over all surfaces, extracting all dust particles paths from each surface.
const float EFFECT_COOLDOWN_MIN
vlaues for the cooldown are in seconds
static ref DustKickupEffects m_DustKickupEffects
static DustKickupEffects GetInstance()
string m_DustKickupSoundSetName
array< string > DetermineParticles(string ammoType, float fraction, float depth)
Determines what particles should play based on the ammo type and distance of the weapon from the grou...
void PlayParticle(DustKickupParams params)
const float MAX_DISTANCE_FOR_EFFECT
ref map< string, ref array< ref DustKickupEffectDistanceData > > m_EffectRanges
ref map< string, ref map< string, ref DustKickupParticleData > > m_DustEffPaths
static void CleanupInstance()
void PlaySoundEffect(DustKickupParams params)
We use this as an argument in the PlayParticle function, simply for readability's sake.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Wrapper class for managing sound through SEffectManager.
override void PlayParticle(int particle_id=-1)
Method to tell the particle to start playing.
static int RegisterParticleByFullPath(string fullPath)
proto native void SetParticleAutoDestroyFlags(ParticleAutoDestroyFlags flags)
Enables the particle to automatically clean up itself when ending or stopping.
Entity which has the particle instance as an ObjectComponent.
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.
Manager class for managing Effect (EffectParticle, EffectSound)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
proto native int Length()
Returns length of string.
bool Contains(string sample)
Returns true if sample is substring of string.