910{
914
916 {
917
918
924
929
932
933 SetEnginePos("0 0.7 1.2");
934 }
935
937 {
938 super.EEInit();
939
941 {
948
951 }
952 }
953
955 {
956 super.OnEngineStart();
957
959 {
961 }
962 }
963
965 {
966 super.OnEngineStop();
967
969 {
971 }
972 }
973
975 {
977 {
979 {
981 }
982 }
983 }
984
986 {
988 }
989
991 {
992 return 3.5;
993 }
994
996 {
997 switch (posIdx)
998 {
999 case 0:
1001 case 1:
1003 case 2:
1005 case 3:
1007 }
1008
1009 return 0;
1010
1011 }
1012
1013
1015 {
1017 }
1018
1020 {
1022 }
1023
1025 {
1026 if (!super.CanReleaseAttachment(attachment))
1027 {
1028 return false;
1029 }
1030
1032 {
1033 string attType = attachment.GetType();
1034 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1035 {
1036 return false;
1037 }
1038 }
1039
1040 return true;
1041 }
1042
1044 {
1046 }
1047
1049 {
1050 if (!super.CanDisplayAttachmentCategory(category_name))
1051 {
1052 return false;
1053 }
1054
1056 if (category_name.
Contains(
"engine"))
1057 {
1059 {
1060 return false;
1061 }
1062 }
1063
1064 return true;
1065 }
1066
1068 {
1069 if (!super.CanDisplayCargo())
1070 {
1071 return false;
1072 }
1073
1075 {
1076 return false;
1077 }
1078
1079 return true;
1080 }
1081
1083 {
1085
1086 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1087 if (!carDoor)
1088 {
1090 }
1091
1092 switch (slotType)
1093 {
1094 case "NivaDriverDoors":
1096
1097 case "NivaCoDriverDoors":
1099
1100 case "NivaHood":
1102
1103 case "NivaTrunk":
1105 }
1106
1108 }
1109
1111 {
1113 switch (posIdx)
1114 {
1115 case 0:
1117 return false;
1118 else if (GetAnimationPhase("SeatDriver") > 0.5)
1119 return false;
1120
1121 return true;
1122
1123 case 1:
1125 return false;
1126 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1127 return false;
1128
1129 return true;
1130
1131 case 2:
1133 return false;
1134 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1135 return false;
1136
1137 return true;
1138
1139 case 3:
1141 return false;
1142 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1143 return false;
1144
1145 return true;
1146 }
1147
1148 return false;
1149 }
1150
1152 {
1153 switch (posIdx)
1154 {
1155 case 0:
1156 case 2:
1157 return "doors_driver";
1158 case 1:
1159 case 3:
1160 return "doors_codriver";
1161 }
1162
1163 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1164 }
1165
1167 {
1168 switch (posIdx)
1169 {
1170 case 0:
1171 case 2:
1172 return "NivaDriverDoors";
1173 case 1:
1174 case 3:
1175 return "NivaCoDriverDoors";
1176 }
1177
1178 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1179 }
1180
1181
1182
1184 {
1185 float tempCap = 0.0;
1186
1187 switch (ctrl)
1188 {
1190 float newValue = 0;
1192 {
1193 newValue += 0.5;
1194 }
1195
1197 {
1198 newValue += 0.5;
1199 }
1200
1202 {
1203 newValue += 0.3;
1204 }
1205
1207 {
1208 newValue -= 0.6;
1209 }
1210
1212 {
1213 newValue -= 0.2;
1214 }
1215
1217 {
1218 newValue -= 0.2;
1219 }
1220
1222 break;
1223 }
1224
1225 return super.OnSound(ctrl, oldValue);
1226 }
1227
1229 {
1230 switch (selection)
1231 {
1232 case "doors_driver":
1233 return "DoorsDriver";
1234 case "doors_codriver":
1235 return "DoorsCoDriver";
1236 case "doors_hood":
1237 return "DoorsHood";
1238 case "doors_trunk":
1239 return "DoorsTrunk";
1240 case "seatback_driver":
1241 return "SeatDriver";
1242 case "seatback_codriver":
1243 return "SeatCoDriver";
1244 }
1245
1246 return "";
1247 }
1248
1250 {
1251 switch (selection)
1252 {
1253 case "seat_driver":
1254 case "seatback_driver":
1255 case "seat_cargo1":
1256 return "seat_con_1_1";
1257 case "seat_codriver":
1258 case "seatback_codriver":
1259 case "seat_cargo2":
1260 return "seat_con_2_1";
1261 }
1262
1263 return "";
1264 }
1265
1267 {
1268 switch (selection)
1269 {
1270 case "seatback_driver":
1271 return 0;
1272 case "seatback_codriver":
1273 return 1;
1274 }
1275
1276 return -1;
1277 }
1278
1280 {
1281 return false;
1282 }
1283
1285 {
1286 return false;
1287 }
1288
1290 {
1291 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1292 return false;
1293
1294 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1295 return false;
1296
1297 switch (currentSeat)
1298 {
1299 case 0:
1300 return nextSeat == 1;
1301
1302 case 1:
1303 return nextSeat == 0;
1304
1305 case 2:
1306 return nextSeat == 3;
1307
1308 case 3:
1309 return nextSeat == 2;
1310 }
1311
1312 return false;
1313 }
1314
1316 {
1317 switch (pCurrentSeat)
1318 {
1319 case 0:
1320 return pDoorsSelection == "DoorsDriver";
1321
1322 case 1:
1323 return pDoorsSelection == "DoorsCoDriver";
1324
1325 case 2:
1326 return pDoorsSelection == "DoorsDriver";
1327
1328 case 3:
1329 return pDoorsSelection == "DoorsCoDriver";
1330 }
1331
1332 return false;
1333 }
1334
1336 {
1337 switch (pDoorSelection)
1338 {
1339 case "DoorsDriver":
1340 return 0;
1341 case "DoorsCoDriver":
1342 return 1;
1343 }
1344
1345 return -1;
1346 }
1347
1349 {
1350 super.SetActions();
1351
1353 }
1354
1356 {
1360
1361 GetInventory().CreateInInventory("HatchbackWheel");
1362 GetInventory().CreateInInventory("HatchbackWheel");
1363 GetInventory().CreateInInventory("HatchbackWheel" );
1364 GetInventory().CreateInInventory("HatchbackWheel");
1365
1366 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1367 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1368 GetInventory().CreateInInventory("HatchbackHood");
1369 GetInventory().CreateInInventory("HatchbackTrunk");
1370
1371
1372 GetInventory().CreateInInventory("HatchbackWheel");
1373 GetInventory().CreateInInventory("HatchbackWheel");
1374 }
1375}
1376
1378{
1380 {
1384
1385 GetInventory().CreateInInventory("HatchbackWheel");
1386 GetInventory().CreateInInventory("HatchbackWheel");
1387 GetInventory().CreateInInventory("HatchbackWheel");
1388 GetInventory().CreateInInventory("HatchbackWheel");
1389
1390 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1391 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1392 GetInventory().CreateInInventory("HatchbackHood_White");
1393 GetInventory().CreateInInventory("HatchbackTrunk_White");
1394
1395
1396 GetInventory().CreateInInventory("HatchbackWheel");
1397 GetInventory().CreateInInventory("HatchbackWheel");
1398 }
1399}
1400
1402{
1404 {
1408
1409 GetInventory().CreateInInventory("HatchbackWheel");
1410 GetInventory().CreateInInventory("HatchbackWheel");
1411 GetInventory().CreateInInventory("HatchbackWheel");
1412 GetInventory().CreateInInventory("HatchbackWheel");
1413
1414 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1415 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1416 GetInventory().CreateInInventory("HatchbackHood_Blue");
1417 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1418
1419
1420 GetInventory().CreateInInventory("HatchbackWheel");
1421 GetInventory().CreateInInventory("HatchbackWheel");
1422 }
1423}
void AddAction(typename actionName)
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
void SpawnUniversalParts()
string m_CarSeatShiftInSound
CarDoorState TranslateAnimationPhaseToCarDoorState(string animation)
void SpawnAdditionalItems()
string m_EngineStartOK
Sounds.
string m_CarDoorCloseSound
string m_EngineStartBattery
string m_CarHornShortSoundName
string m_CarHornLongSoundName
string m_CarSeatShiftOutSound
string m_CarDoorOpenSound
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
ref UniversalTemperatureSourceSettings m_UTSSettings
ref UniversalTemperatureSource m_UTSource
override void SetActions()
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
override string GetAnimSourceFromSelection(string selection)
override int GetSeatAnimationType(int posIdx)
override string GetDoorConditionPointFromSelection(string selection)
override float OnSound(CarSoundCtrl ctrl, float oldValue)
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
override void EOnPostSimulate(IEntity other, float timeSlice)
override void OnEngineStop()
override float GetTransportCameraDistance()
override bool CanReleaseAttachment(EntityAI attachment)
override bool CanDisplayCargo()
override void OnEngineStart()
override CarLightBase CreateFrontLight()
override int GetAnimInstance()
override bool CrewCanGetThrough(int posIdx)
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
bool CanManipulateSpareWheel(string slotSelectionName)
override bool IsVitalGlowPlug()
override CarRearLightBase CreateRearLight()
class OffroadHatchback extends CarScript OnDebugSpawn()
override int GetSeatIndexFromDoor(string pDoorSelection)
override bool IsVitalTruckBattery()
override string GetDoorSelectionNameFromSeatPos(int posIdx)
override int GetCarDoorsState(string slotType)
override int GetCrewIndex(string selection)
override bool CanDisplayAttachmentCategory(string category_name)
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
Super root of all classes in Enforce script.
override void OnDebugSpawn()
original Timer deletes m_params which is unwanted
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
bool Contains(string sample)
Returns true if sample is substring of string.
proto int ToLower()
Changes string to lowercase. Returns length.