DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ConstructionEffects.c
См. документацию.
1//TODO: move to entitytype part data later
3{
4 protected bool m_IsValid;
5
8
9 protected string m_PartBuildSoundset;
10 protected string m_PartDismantleSoundset;
11 protected string m_PartDestroySoundset;
13
15 //inits//
17 void Init(string partPath, ConstructionPartTypeData typeDataObject)
18 {
19 string effectPath = partPath + " EffectsData";
20 if (!g_Game.ConfigIsExisting(effectPath)) //none of this is valid without an existing class
21 return;
22
23 int materialType = typeDataObject.GetMaterialType();
24
25 //none of this is valid without SOME defined position points..
26 if (g_Game.ConfigIsExisting(effectPath + " soundEffectPositions"))
27 {
28 g_Game.ConfigGetTextArray(effectPath + " soundEffectPositions", m_SoundEffectMemoryPointNames);
29
30 if (m_SoundEffectMemoryPointNames.Count() > 0)
31 {
32 m_IsValid = true;
33 InitConstructionSoundsData(effectPath, materialType);
34 }
35 }
36
37 if (g_Game.ConfigIsExisting(effectPath + " particleEffectPositions"))
38 {
39 g_Game.ConfigGetTextArray(effectPath + " particleEffectPositions", m_ParticleEffectMemoryPointNames);
40
42 {
43 m_IsValid = true;
44 InitConstructionParticleData(effectPath, materialType);
45 }
46 }
47 }
48
49 protected void InitConstructionSoundsData(string effectPath, int materialType)
50 {
51 InitBuildSoundset(effectPath + " build_soundset_override", materialType);
52 InitDismantleSoundset(effectPath + " dismantle_soundset_override", materialType);
53 InitDestroySoundset(effectPath + " destroy_soundset_override", materialType);
54 }
55
56 protected void InitConstructionParticleData(string effectPath, int materialType)
57 {
58 InitDestroyParticle(effectPath + " destroy_particle_override", materialType);
59 }
60
61 protected void InitBuildSoundset(string path, int materialType)
62 {
63 if (g_Game.ConfigIsExisting(path))
64 {
65 m_PartBuildSoundset = g_Game.ConfigGetTextOut(path);
66 }
67 else
68 {
70 }
71 }
72
73 protected void InitDismantleSoundset(string path, int materialType)
74 {
75 if (g_Game.ConfigIsExisting(path))
76 {
77 m_PartDismantleSoundset = g_Game.ConfigGetTextOut(path);
78 }
79 else
80 {
82 }
83 }
84
85 protected void InitDestroySoundset(string path, int materialType)
86 {
87 if (g_Game.ConfigIsExisting(path))
88 {
89 m_PartDestroySoundset = g_Game.ConfigGetTextOut(path);
90 }
91 else
92 {
94 }
95 }
96
97 protected void InitDestroyParticle(string path, int materialType)
98 {
99 if (g_Game.ConfigIsExisting(path))
100 {
101 m_PartDestroyParticleID = ParticleList.RegisterParticleByFullPath(g_Game.ConfigGetTextOut(path)); //look for warnings in the log if your particle does not play
102 }
103 else
104 {
106 }
107 }
108
110 //defaults//
112
113 protected string DefaultBuildSoundset(int materialType)
114 {
115 string soundset = "";
116 switch (materialType)
117 {
118 case ConstructionMaterialType.MATERIAL_LOG:
119 soundset = BaseBuildingBase.SOUND_BUILD_WOOD_LOG;
120 break;
121
122 case ConstructionMaterialType.MATERIAL_WOOD:
123 soundset = "BuildWood_SoundSet";
124 break;
125
126 case ConstructionMaterialType.MATERIAL_STAIRS:
127 soundset = BaseBuildingBase.SOUND_BUILD_WOOD_STAIRS;
128 break;
129
130 case ConstructionMaterialType.MATERIAL_METAL:
131 soundset = "BuildMetal_SoundSet";
132 break;
133
134 case ConstructionMaterialType.MATERIAL_WIRE:
135 soundset = BaseBuildingBase.SOUND_BUILD_WIRE;
136 break;
137
138 case ConstructionMaterialType.MATERIAL_BRICK:
139 soundset = "BuildBrick_SoundSet";
140 break;
141
142 case ConstructionMaterialType.MATERIAL_RUBBLE:
143 soundset = "ClearRubble_SoundSet";
144 break;
145 }
146
147 return soundset;
148 }
149
150 protected string DefaultDismantleSoundset(int materialType)
151 {
152 string soundset = "";
153 switch (materialType)
154 {
155 case ConstructionMaterialType.MATERIAL_LOG:
156 soundset = BaseBuildingBase.SOUND_DISMANTLE_WOOD_LOG;
157 break;
158
159 case ConstructionMaterialType.MATERIAL_WOOD:
160 soundset = "DismantleWood_SoundSet";
161 break;
162
163 case ConstructionMaterialType.MATERIAL_STAIRS:
164 soundset = BaseBuildingBase.SOUND_DISMANTLE_WOOD_STAIRS;
165 break;
166
167 case ConstructionMaterialType.MATERIAL_METAL:
168 soundset = "DismantleMetal_SoundSet";
169 break;
170
171 case ConstructionMaterialType.MATERIAL_WIRE:
172 soundset = BaseBuildingBase.SOUND_DISMANTLE_WIRE;
173 break;
174
175 case ConstructionMaterialType.MATERIAL_BRICK:
176 soundset = "DismantleBrick_SoundSet";
177 break;
178 }
179
180 return soundset;
181 }
182
183 protected string DefaultDestroySoundset(int materialType)
184 {
185 string soundset = "";
186 switch (materialType)
187 {
188 case ConstructionMaterialType.MATERIAL_LOG:
189 soundset = "DestroyWood_SoundSet";
190 break;
191
192 case ConstructionMaterialType.MATERIAL_WOOD:
193 soundset = "DestroyWood_SoundSet";
194 break;
195
196 case ConstructionMaterialType.MATERIAL_STAIRS:
197 soundset = "DestroyWood_SoundSet";
198 break;
199
200 case ConstructionMaterialType.MATERIAL_METAL:
201 soundset = "DestroyMetal_SoundSet";
202 break;
203
204 case ConstructionMaterialType.MATERIAL_WIRE:
205 soundset = "DestroyMetal_SoundSet";
206 break;
207
208 case ConstructionMaterialType.MATERIAL_BRICK:
209 soundset = "DestroyBrick_SoundSet";
210 break;
211 }
212
213 return soundset;
214 }
215
216 protected int DefaultDestroyParticle(int materialType)
217 {
218 switch (materialType)
219 {
220 case ConstructionMaterialType.MATERIAL_LOG:
221 case ConstructionMaterialType.MATERIAL_WOOD:
222 case ConstructionMaterialType.MATERIAL_STAIRS:
224
225 case ConstructionMaterialType.MATERIAL_METAL:
226 case ConstructionMaterialType.MATERIAL_WIRE:
228
229 case ConstructionMaterialType.MATERIAL_BRICK:
231 }
232
233 //default
235 }
236
238 //getters//
240 bool IsValid()
241 {
242 return m_IsValid;
243 }
244
246 {
247 return m_PartBuildSoundset;
248 }
249
251 {
253 }
254
256 {
258 }
259
261 {
263 }
264
269
274}
ConstructionMaterialType
used to guide action sound selection, mostly. Could be also used for particles and stuff,...
Определения ConstructionBase.c:3
DayZGame g_Game
Определения DayZGame.c:4074
string path
Определения OptionSelectorMultistate.c:142
Определения Fence.c:2
void InitDestroySoundset(string path, int materialType)
Определения ConstructionEffects.c:85
string GetSoundsetBuild()
Определения ConstructionEffects.c:245
string DefaultDestroySoundset(int materialType)
Определения ConstructionEffects.c:183
string m_PartDestroySoundset
Определения ConstructionEffects.c:11
void InitBuildSoundset(string path, int materialType)
Определения ConstructionEffects.c:61
void InitConstructionSoundsData(string effectPath, int materialType)
Определения ConstructionEffects.c:49
ref array< string > m_SoundEffectMemoryPointNames
Определения ConstructionEffects.c:6
void Init(string partPath, ConstructionPartTypeData typeDataObject)
Определения ConstructionEffects.c:17
int DefaultDestroyParticle(int materialType)
Определения ConstructionEffects.c:216
string m_PartBuildSoundset
Определения ConstructionEffects.c:9
array< string > GetSoundEffectMemoryPointNames()
Определения ConstructionEffects.c:265
void InitDismantleSoundset(string path, int materialType)
Определения ConstructionEffects.c:73
ref array< string > m_ParticleEffectMemoryPointNames
Определения ConstructionEffects.c:7
string DefaultBuildSoundset(int materialType)
Определения ConstructionEffects.c:113
string DefaultDismantleSoundset(int materialType)
Определения ConstructionEffects.c:150
void InitDestroyParticle(string path, int materialType)
Определения ConstructionEffects.c:97
string GetSoundsetDismantle()
Определения ConstructionEffects.c:250
string m_PartDismantleSoundset
Определения ConstructionEffects.c:10
string GetSoundsetDestroy()
Определения ConstructionEffects.c:255
void InitConstructionParticleData(string effectPath, int materialType)
Определения ConstructionEffects.c:56
array< string > GetParticleEffectMemoryPointNames()
Определения ConstructionEffects.c:270
int GetMaterialType()
rough material type, used for effect playback
Определения ConstructionPartTyped.c:588
static parts info, lives on EntityType level. Instanced data in 'ConstructionPart' class
Определения ConstructionPartTyped.c:3
static const int BUILDNG_DESTRUCT_BRICK
Определения ParticleList.c:382
static const int BUILDNG_DESTRUCT_WOOD
Определения ParticleList.c:381
static const int BUILDNG_DESTRUCT_METAL
Определения ParticleList.c:383
static int RegisterParticleByFullPath(string fullPath)
Определения ParticleList.c:421
Определения ParticleList.c:12
Result for an object found in CGame.IsBoxCollidingGeometryProxy.