DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CarScript()

void CarScript ( )
protected

См. определение в файле CarScript.c строка 280

281 {
282#ifdef DIAG_DEVELOPER
283 _car = this;
284#endif
285
286 SetEventMask(EntityEvent.POSTSIMULATE);
287 SetEventMask(EntityEvent.POSTFRAME);
288
289 m_ContactCache = new CarContactCache;
290
291 m_Time = 0;
292 // sets max health for all components at init
293 m_EngineHealth = 1;
295 m_RadiatorHealth = -1;
296 m_BatteryHealth = -1;
297 m_PlugHealth = -1;
298
299 m_enginePtcFx = -1;
300 m_coolantPtcFx = -1;
301 m_exhaustPtcFx = -1;
302
304
305 m_PlayCrashSoundLight = false;
306 m_PlayCrashSoundHeavy = false;
307
308 m_CarHornState = ECarHornState.OFF;
309 m_CarEngineSoundState = CarEngineSoundState.NONE;
310
311 RegisterNetSyncVariableBool("m_HeadlightsOn");
312 RegisterNetSyncVariableBool("m_BrakesArePressed");
313 RegisterNetSyncVariableBool("m_ForceUpdateLights");
314 RegisterNetSyncVariableBoolSignal("m_PlayCrashSoundLight");
315 RegisterNetSyncVariableBoolSignal("m_PlayCrashSoundHeavy");
316 RegisterNetSyncVariableInt("m_CarHornState", ECarHornState.OFF, ECarHornState.LONG);
317 RegisterNetSyncVariableInt("m_CarEngineSoundState", CarEngineSoundState.NONE, CarEngineSoundState.STOP_NO_FUEL);
318
319 if ( MemoryPointExists("ptcExhaust_end") )
320 {
321 m_exhaustPtcPos = GetMemoryPointPos("ptcExhaust_end");
322 if ( MemoryPointExists("ptcExhaust_start") )
323 {
324 vector exhaustStart = GetMemoryPointPos("ptcExhaust_start");
325 vector tempOri = vector.Direction( exhaustStart, m_exhaustPtcPos);
326
327 m_exhaustPtcDir[0] = -tempOri[2];
328 m_exhaustPtcDir[1] = tempOri[1];
329 m_exhaustPtcDir[2] = tempOri[0];
330
331 m_exhaustPtcDir = m_exhaustPtcDir.Normalized().VectorToAngles();
332 }
333 }
334 else
335 {
336 m_exhaustPtcPos = "0 0 0";
337 m_exhaustPtcDir = "1 1 1";
338 }
339
340 if ( MemoryPointExists("ptcEnginePos") )
341 m_enginePtcPos = GetMemoryPointPos("ptcEnginePos");
342 else
343 m_enginePtcPos = "0 0 0";
344
345 if ( MemoryPointExists("ptcCoolantPos") )
346 m_coolantPtcPos = GetMemoryPointPos("ptcCoolantPos");
347 else
348 m_coolantPtcPos = "0 0 0";
349
350 if ( MemoryPointExists("drown_engine") )
351 m_DrownEnginePos = GetMemoryPointPos("drown_engine");
352 else
353 m_DrownEnginePos = "0 0 0";
354
355 if ( MemoryPointExists("dmgZone_engine") )
356 m_enginePos = GetMemoryPointPos("dmgZone_engine");
357 else
358 m_enginePos = "0 0 0";
359
360 if ( MemoryPointExists("dmgZone_front") )
361 m_frontPos = GetMemoryPointPos("dmgZone_front");
362 else
363 m_frontPos = "0 0 0";
364
365 if ( MemoryPointExists("dmgZone_back") )
366 m_backPos = GetMemoryPointPos("dmgZone_back");
367 else
368 m_backPos = "0 0 0";
369
370 if ( MemoryPointExists("dmgZone_fender_1_1") )
371 m_side_1_1Pos = GetMemoryPointPos("dmgZone_fender_1_1");
372 else
373 m_side_1_1Pos = "0 0 0";
374
375 if ( MemoryPointExists("dmgZone_fender_1_2") )
376 m_side_1_2Pos = GetMemoryPointPos("dmgZone_fender_1_2");
377 else
378 m_side_1_2Pos = "0 0 0";
379
380 if ( MemoryPointExists("dmgZone_fender_2_1") )
381 m_side_2_1Pos = GetMemoryPointPos("dmgZone_fender_2_1");
382 else
383 m_side_2_1Pos = "0 0 0";
384
385 if ( MemoryPointExists("dmgZone_fender_2_2") )
386 m_side_2_2Pos = GetMemoryPointPos("dmgZone_fender_2_2");
387 else
388 m_side_2_2Pos = "0 0 0";
389
390 if (!GetGame().IsDedicatedServer())
391 {
393 m_WheelSmokeFx.Resize(WheelCount());
395 m_WheelSmokePtcFx.Resize(WheelCount());
396 for (int i = 0; i < m_WheelSmokePtcFx.Count(); i++)
397 {
398 m_WheelSmokePtcFx.Set(i, -1);
399 }
400 }
401 }
float m_FuelTankHealth
Определения CarScript.c:171
ref array< ref EffWheelSmoke > m_WheelSmokeFx
Определения CarScript.c:270
float m_BatteryHealth
Определения CarScript.c:172
vector m_exhaustPtcPos
Определения CarScript.c:193
int m_CarHornState
Определения CarScript.c:243
int m_coolantPtcFx
Определения CarScript.c:190
vector m_enginePos
Определения CarScript.c:198
vector m_backPos
Определения CarScript.c:200
int m_enginePtcFx
Определения CarScript.c:189
float m_EngineHealth
Определения CarScript.c:169
int m_CarEngineSoundState
Определения CarScript.c:244
float m_EnviroHeatComfortOverride
Определения CarScript.c:162
bool m_PlayCrashSoundLight
Определения CarScript.c:231
int m_exhaustPtcFx
Определения CarScript.c:191
ref array< int > m_WheelSmokePtcFx
Определения CarScript.c:271
vector m_coolantPtcPos
Определения CarScript.c:196
vector m_frontPos
Определения CarScript.c:199
vector m_side_1_2Pos
Определения CarScript.c:202
vector m_enginePtcPos
Определения CarScript.c:195
vector m_exhaustPtcDir
Определения CarScript.c:194
vector m_side_1_1Pos
Определения CarScript.c:201
vector m_side_2_2Pos
Определения CarScript.c:204
float m_PlugHealth
Определения CarScript.c:173
vector m_side_2_1Pos
Определения CarScript.c:203
bool m_PlayCrashSoundHeavy
Определения CarScript.c:232
float m_RadiatorHealth
Определения CarScript.c:170
static vector m_DrownEnginePos
Определения CarScript.c:166
ref CarContactCache m_ContactCache
Определения CarScript.c:144
float m_Time
Определения WoundInfection.c:22
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
Определения EnConvert.c:220
Определения EnConvert.c:106
proto native CGame GetGame()
EntityEvent
Entity events for event-mask, or throwing event from code.
Определения EnEntity.c:45

Перекрестные ссылки vector::Direction(), GetGame(), m_backPos, m_BatteryHealth, m_CarEngineSoundState, m_CarHornState, m_ContactCache, m_coolantPtcFx, m_coolantPtcPos, m_DrownEnginePos, m_EngineHealth, m_enginePos, m_enginePtcFx, m_enginePtcPos, m_EnviroHeatComfortOverride, m_exhaustPtcDir, m_exhaustPtcFx, m_exhaustPtcPos, m_frontPos, m_FuelTankHealth, m_PlayCrashSoundHeavy, m_PlayCrashSoundLight, m_PlugHealth, m_RadiatorHealth, m_side_1_1Pos, m_side_1_2Pos, m_side_2_1Pos, m_side_2_2Pos, m_Time, m_WheelSmokeFx и m_WheelSmokePtcFx.