848{
852
854 {
855
856
857 m_EngineStartOK = "offroad_engine_start_SoundSet";
858 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
859 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
860 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
861 m_EngineStop = "offroad_engine_stop_SoundSet";
862 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
863
864 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
865 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
866 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
867 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
868
869 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
870 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
871
872 SetEnginePos("0 0.7 1.2");
873 }
874
876 {
877 super.EEInit();
878
880 {
887
890 }
891 }
892
894 {
895 super.OnEngineStart();
896
898 {
900 }
901 }
902
904 {
905 super.OnEngineStop();
906
908 {
910 }
911 }
912
914 {
916 {
918 {
920 }
921 }
922 }
923
925 {
927 }
928
930 {
931 return 3.5;
932 }
933
935 {
936 switch (posIdx)
937 {
938 case 0:
940 case 1:
942 case 2:
944 case 3:
946 }
947
948 return 0;
949
950 }
951
952
954 {
956 }
957
959 {
961 }
962
964 {
965 if (!super.CanReleaseAttachment(attachment))
966 {
967 return false;
968 }
969
971 {
972 string attType = attachment.GetType();
973 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
974 {
975 return false;
976 }
977 }
978
979 return true;
980 }
981
983 {
985 }
986
988 {
989 if (!super.CanDisplayAttachmentCategory(category_name))
990 {
991 return false;
992 }
993
995 if (category_name.
Contains(
"engine"))
996 {
998 {
999 return false;
1000 }
1001 }
1002
1003 return true;
1004 }
1005
1007 {
1008 if (!super.CanDisplayCargo())
1009 {
1010 return false;
1011 }
1012
1014 {
1015 return false;
1016 }
1017
1018 return true;
1019 }
1020
1022 {
1024
1025 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1026 if (!carDoor)
1027 {
1029 }
1030
1031 switch (slotType)
1032 {
1033 case "NivaDriverDoors":
1034 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1035
1036 case "NivaCoDriverDoors":
1037 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1038
1039 case "NivaHood":
1040 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1041
1042 case "NivaTrunk":
1043 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1044 }
1045
1047 }
1048
1050 {
1052 switch (posIdx)
1053 {
1054 case 0:
1056 return false;
1057 else if (GetAnimationPhase("SeatDriver") > 0.5)
1058 return false;
1059
1060 return true;
1061
1062 case 1:
1064 return false;
1065 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1066 return false;
1067
1068 return true;
1069
1070 case 2:
1072 return false;
1073 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1074 return false;
1075
1076 return true;
1077
1078 case 3:
1080 return false;
1081 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1082 return false;
1083
1084 return true;
1085 }
1086
1087 return false;
1088 }
1089
1091 {
1092 switch (posIdx)
1093 {
1094 case 0:
1095 case 2:
1096 return "doors_driver";
1097 case 1:
1098 case 3:
1099 return "doors_codriver";
1100 }
1101
1102 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1103 }
1104
1106 {
1107 switch (posIdx)
1108 {
1109 case 0:
1110 case 2:
1111 return "NivaDriverDoors";
1112 case 1:
1113 case 3:
1114 return "NivaCoDriverDoors";
1115 }
1116
1117 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1118 }
1119
1120
1121
1123 {
1124 float tempCap = 0.0;
1125
1126 switch (ctrl)
1127 {
1129 float newValue = 0;
1131 {
1132 newValue += 0.5;
1133 }
1134
1136 {
1137 newValue += 0.5;
1138 }
1139
1141 {
1142 newValue += 0.3;
1143 }
1144
1146 {
1147 newValue -= 0.6;
1148 }
1149
1151 {
1152 newValue -= 0.2;
1153 }
1154
1156 {
1157 newValue -= 0.2;
1158 }
1159
1161 break;
1162 }
1163
1164 return super.OnSound(ctrl, oldValue);
1165 }
1166
1168 {
1169 switch (selection)
1170 {
1171 case "doors_driver":
1172 return "DoorsDriver";
1173 case "doors_codriver":
1174 return "DoorsCoDriver";
1175 case "doors_hood":
1176 return "DoorsHood";
1177 case "doors_trunk":
1178 return "DoorsTrunk";
1179 case "seatback_driver":
1180 return "SeatDriver";
1181 case "seatback_codriver":
1182 return "SeatCoDriver";
1183 }
1184
1185 return "";
1186 }
1187
1189 {
1190 switch (selection)
1191 {
1192 case "seat_driver":
1193 case "seatback_driver":
1194 case "seat_cargo1":
1195 return "seat_con_1_1";
1196 case "seat_codriver":
1197 case "seatback_codriver":
1198 case "seat_cargo2":
1199 return "seat_con_2_1";
1200 }
1201
1202 return "";
1203 }
1204
1206 {
1207 switch (selection)
1208 {
1209 case "seatback_driver":
1210 return 0;
1211 case "seatback_codriver":
1212 return 1;
1213 }
1214
1215 return -1;
1216 }
1217
1219 {
1220 return false;
1221 }
1222
1224 {
1225 return false;
1226 }
1227
1229 {
1230 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1231 return false;
1232
1233 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1234 return false;
1235
1236 switch (currentSeat)
1237 {
1238 case 0:
1239 return nextSeat == 1;
1240
1241 case 1:
1242 return nextSeat == 0;
1243
1244 case 2:
1245 return nextSeat == 3;
1246
1247 case 3:
1248 return nextSeat == 2;
1249 }
1250
1251 return false;
1252 }
1253
1255 {
1256 switch (pCurrentSeat)
1257 {
1258 case 0:
1259 return pDoorsSelection == "DoorsDriver";
1260
1261 case 1:
1262 return pDoorsSelection == "DoorsCoDriver";
1263
1264 case 2:
1265 return pDoorsSelection == "DoorsDriver";
1266
1267 case 3:
1268 return pDoorsSelection == "DoorsCoDriver";
1269 }
1270
1271 return false;
1272 }
1273
1275 {
1276 switch (pDoorSelection)
1277 {
1278 case "DoorsDriver":
1279 return 0;
1280 case "DoorsCoDriver":
1281 return 1;
1282 }
1283
1284 return -1;
1285 }
1286
1288 {
1289 super.SetActions();
1290
1292 }
1293
1295 {
1296 SpawnUniversalParts();
1297 SpawnAdditionalItems();
1298 FillUpCarFluids();
1299
1300 GetInventory().CreateInInventory("HatchbackWheel");
1301 GetInventory().CreateInInventory("HatchbackWheel");
1302 GetInventory().CreateInInventory("HatchbackWheel" );
1303 GetInventory().CreateInInventory("HatchbackWheel");
1304
1305 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1306 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1307 GetInventory().CreateInInventory("HatchbackHood");
1308 GetInventory().CreateInInventory("HatchbackTrunk");
1309
1310
1311 GetInventory().CreateInInventory("HatchbackWheel");
1312 GetInventory().CreateInInventory("HatchbackWheel");
1313 }
1314}
1315
1317{
1319 {
1320 SpawnUniversalParts();
1321 SpawnAdditionalItems();
1322 FillUpCarFluids();
1323
1324 GetInventory().CreateInInventory("HatchbackWheel");
1325 GetInventory().CreateInInventory("HatchbackWheel");
1326 GetInventory().CreateInInventory("HatchbackWheel");
1327 GetInventory().CreateInInventory("HatchbackWheel");
1328
1329 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1330 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1331 GetInventory().CreateInInventory("HatchbackHood_White");
1332 GetInventory().CreateInInventory("HatchbackTrunk_White");
1333
1334
1335 GetInventory().CreateInInventory("HatchbackWheel");
1336 GetInventory().CreateInInventory("HatchbackWheel");
1337 }
1338}
1339
1341{
1343 {
1344 SpawnUniversalParts();
1345 SpawnAdditionalItems();
1346 FillUpCarFluids();
1347
1348 GetInventory().CreateInInventory("HatchbackWheel");
1349 GetInventory().CreateInInventory("HatchbackWheel");
1350 GetInventory().CreateInInventory("HatchbackWheel");
1351 GetInventory().CreateInInventory("HatchbackWheel");
1352
1353 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1354 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1355 GetInventory().CreateInInventory("HatchbackHood_Blue");
1356 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1357
1358
1359 GetInventory().CreateInInventory("HatchbackWheel");
1360 GetInventory().CreateInInventory("HatchbackWheel");
1361 }
1362}
void AddAction(typename actionName)
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
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.