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

◆ CarScript()

void Car::CarScript ( )
inlineprotected

obsolete handling (since 1.30) - kept for backward compatibility

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

202 {
203#ifdef DIAG_DEVELOPER
204 _car = this;
205#endif
206
207 SetEventMask(EntityEvent.POSTSIMULATE);
208 SetEventMask(EntityEvent.POSTFRAME);
209
210 m_Time = 0;
211 // sets max health for all components at init
212 m_EngineHealth = 1;
214 m_RadiatorHealth = -1;
215 m_BatteryHealth = -1;
216 m_PlugHealth = -1;
217
218 m_enginePtcFx = -1;
219 m_coolantPtcFx = -1;
220 m_exhaustPtcFx = -1;
221
223
224 m_dmgContactCoef = 0.058;
225
226 m_CarEngineSoundState = CarEngineSoundState.NONE;
227
228 // TODO(kumarjac): MOVE THIS ALL TO 'CarScriptType' ONCE THAT EXISTS! re:Server Performance
229 m_LightsComponent = VehicleLightsComponent(this);
230 m_LightsComponent.RegisterSelection("DashboardOn", {new VehicleLightSelectionData(SELECTION_ID_DASHBOARD_LIGHT, "dashboardMatOn")});
231 m_LightsComponent.RegisterSelection("DashboardOff", {new VehicleLightSelectionData(SELECTION_ID_DASHBOARD_LIGHT, "dashboardMatOff")});
232 m_LightsComponent.RegisterSelection("FrontLeftOn", {new VehicleLightSelectionData(SELECTION_ID_FRONT_LIGHT_L, "frontReflectorMatOn")});
233 m_LightsComponent.RegisterSelection("FrontLeftOff", {new VehicleLightSelectionData(SELECTION_ID_FRONT_LIGHT_L, "frontReflectorMatOff")});
234 m_LightsComponent.RegisterSelection("FrontRightOn", {new VehicleLightSelectionData(SELECTION_ID_FRONT_LIGHT_R, "frontReflectorMatOn")});
235 m_LightsComponent.RegisterSelection("FrontRightOff", {new VehicleLightSelectionData(SELECTION_ID_FRONT_LIGHT_R, "frontReflectorMatOff")});
236
237 m_LightsComponent.RegisterSelection("TailOn", {
238 new VehicleLightSelectionData(SELECTION_ID_TAIL_LIGHT_L, "TailReflectorMatOn"),
239 new VehicleLightSelectionData(SELECTION_ID_TAIL_LIGHT_R, "TailReflectorMatOn"),
240 });
241 m_LightsComponent.RegisterSelection("TailOff", {
242 new VehicleLightSelectionData(SELECTION_ID_TAIL_LIGHT_L, "TailReflectorMatOff"),
243 new VehicleLightSelectionData(SELECTION_ID_TAIL_LIGHT_R, "TailReflectorMatOff"),
244 });
245 m_LightsComponent.RegisterSelection("TailLeftOnly", {
246 new VehicleLightSelectionData(SELECTION_ID_TAIL_LIGHT_L, "TailReflectorMatOn"),
247 new VehicleLightSelectionData(SELECTION_ID_TAIL_LIGHT_R, "TailReflectorMatOff"),
248 });
249 m_LightsComponent.RegisterSelection("TailRightOnly", {
250 new VehicleLightSelectionData(SELECTION_ID_TAIL_LIGHT_L, "TailReflectorMatOff"),
251 new VehicleLightSelectionData(SELECTION_ID_TAIL_LIGHT_R, "TailReflectorMatOn"),
252 });
253 m_LightsComponent.RegisterSelection("BrakesOn", {
254 new VehicleLightSelectionData(SELECTION_ID_BRAKE_LIGHT_L, "brakeReflectorMatOn"),
255 new VehicleLightSelectionData(SELECTION_ID_BRAKE_LIGHT_R, "brakeReflectorMatOn"),
256 });
257 m_LightsComponent.RegisterSelection("BrakesOff", {
258 new VehicleLightSelectionData(SELECTION_ID_BRAKE_LIGHT_L, "brakeReflectorMatOff"),
259 new VehicleLightSelectionData(SELECTION_ID_BRAKE_LIGHT_R, "brakeReflectorMatOff"),
260 });
261 m_LightsComponent.RegisterSelection("ReverseOn", {
262 new VehicleLightSelectionData(SELECTION_ID_REVERSE_LIGHT_L, "ReverseReflectorMatOn"),
263 new VehicleLightSelectionData(SELECTION_ID_REVERSE_LIGHT_R, "ReverseReflectorMatOn"),
264 });
265 m_LightsComponent.RegisterSelection("ReverseOff", {
266 new VehicleLightSelectionData(SELECTION_ID_REVERSE_LIGHT_L, "ReverseReflectorMatOff"),
267 new VehicleLightSelectionData(SELECTION_ID_REVERSE_LIGHT_R, "ReverseReflectorMatOff"),
268 });
269
270 m_LightsComponent.RegisterLight("Front", new VehicleLightData(new VehicleLightProfileBase()));
271 m_LightsComponent.RegisterLight("Rear", new VehicleLightData(new VehicleLightProfileBase()));
272
274 m_HornComponent.SetMode(VehicleHornMode.OFF);
275
276 if (MemoryPointExists("ptcCoolantPos"))
277 m_coolantPtcPos = GetMemoryPointPos("ptcCoolantPos");
278
279 RegisterNetSyncVariableBool("m_BrakesArePressed");
280 RegisterNetSyncVariableBoolSignal("m_PlayCrashSoundLight");
281 RegisterNetSyncVariableBoolSignal("m_PlayCrashSoundHeavy");
282
283 RegisterNetSyncVariableInt("m_HornComponent.m_Mode", VehicleHornMode.OFF, VehicleHornMode.COUNT);
284
285 RegisterNetSyncVariableInt("m_CarEngineSoundState", CarEngineSoundState.NONE, CarEngineSoundState.STOP_NO_FUEL);
286
288
290 m_CarHornState = ECarHornState.OFF;
291 RegisterNetSyncVariableInt("m_CarHornState", ECarHornState.OFF, ECarHornState.LONG);
292 }
void VehicleHornComponent(notnull EntityAI parent)
Определения VehicleHornComponent.c:24
void VehicleLightData(VehicleLightProfileBase profile)
Определения VehicleLightsComponent.c:21
int m_CarHornState
VehicleHornComponent.
Определения CarScript.c:2767
int m_CarEngineSoundState
Определения CarScript.c:184
vector m_coolantPtcPos
Определения CarScript.c:2790
static const int SELECTION_ID_TAIL_LIGHT_L
Определения CarScript.c:180
static const int SELECTION_ID_BRAKE_LIGHT_R
Определения CarScript.c:177
void InitializeParticles()
Определения CarScript.c:343
float m_EnviroHeatComfortOverride
Определения CarScript.c:115
static const int SELECTION_ID_BRAKE_LIGHT_L
Определения CarScript.c:176
float m_PlugHealth
Определения CarScript.c:126
static const int SELECTION_ID_REVERSE_LIGHT_R
Определения CarScript.c:179
static const int SELECTION_ID_REVERSE_LIGHT_L
Определения CarScript.c:178
float m_Time
Определения CarScript.c:100
float m_EngineHealth
Определения CarScript.c:122
ref VehicleLightsComponent m_LightsComponent
Определения CarScript.c:187
float m_RadiatorHealth
Определения CarScript.c:123
float m_FuelTankHealth
Определения CarScript.c:124
static const int SELECTION_ID_FRONT_LIGHT_R
Определения CarScript.c:175
int m_exhaustPtcFx
Определения CarScript.c:2786
static const int SELECTION_ID_TAIL_LIGHT_R
Определения CarScript.c:181
float m_BatteryHealth
Определения CarScript.c:125
static const int SELECTION_ID_DASHBOARD_LIGHT
Определения CarScript.c:182
int m_coolantPtcFx
Определения CarScript.c:2785
ref VehicleHornComponent m_HornComponent
Определения CarScript.c:188
int m_enginePtcFx
Определения CarScript.c:2784
static const int SELECTION_ID_FRONT_LIGHT_L
Определения CarScript.c:174
EntityEvent
Entity events for event-mask, or throwing event from code.
Определения EnEntity.c:45

Перекрестные ссылки VehicleHornMode::COUNT, InitializeParticles(), m_BatteryHealth, m_CarEngineSoundState, m_CarHornState, m_coolantPtcFx, m_coolantPtcPos, m_EngineHealth, m_enginePtcFx, m_EnviroHeatComfortOverride, m_exhaustPtcFx, m_FuelTankHealth, m_HornComponent, m_LightsComponent, m_PlugHealth, m_RadiatorHealth, m_Time, VehicleHornMode::OFF, SELECTION_ID_BRAKE_LIGHT_L, SELECTION_ID_BRAKE_LIGHT_R, SELECTION_ID_DASHBOARD_LIGHT, SELECTION_ID_FRONT_LIGHT_L, SELECTION_ID_FRONT_LIGHT_R, SELECTION_ID_REVERSE_LIGHT_L, SELECTION_ID_REVERSE_LIGHT_R, SELECTION_ID_TAIL_LIGHT_L, SELECTION_ID_TAIL_LIGHT_R, VehicleHornComponent() и VehicleLightData().