851{
855
857 {
858
859
865
870
873
874 SetEnginePos("0 0.7 1.2");
875 }
876
878 {
879 super.EEInit();
880
882 {
889
892 }
893 }
894
896 {
897 super.OnEngineStart();
898
900 {
902 }
903 }
904
906 {
907 super.OnEngineStop();
908
910 {
912 }
913 }
914
916 {
918 {
920 {
922 }
923 }
924 }
925
927 {
929 }
930
932 {
933 return 3.5;
934 }
935
937 {
938 switch (posIdx)
939 {
940 case 0:
942 case 1:
944 case 2:
946 case 3:
948 }
949
950 return 0;
951
952 }
953
954
956 {
958 }
959
961 {
963 }
964
966 {
967 if (!super.CanReleaseAttachment(attachment))
968 {
969 return false;
970 }
971
973 {
974 string attType = attachment.GetType();
975 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
976 {
977 return false;
978 }
979 }
980
981 return true;
982 }
983
985 {
987 }
988
990 {
991 if (!super.CanDisplayAttachmentCategory(category_name))
992 {
993 return false;
994 }
995
997 if (category_name.
Contains(
"engine"))
998 {
1000 {
1001 return false;
1002 }
1003 }
1004
1005 return true;
1006 }
1007
1009 {
1010 if (!super.CanDisplayCargo())
1011 {
1012 return false;
1013 }
1014
1016 {
1017 return false;
1018 }
1019
1020 return true;
1021 }
1022
1024 {
1026
1027 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1028 if (!carDoor)
1029 {
1031 }
1032
1033 switch (slotType)
1034 {
1035 case "NivaDriverDoors":
1037
1038 case "NivaCoDriverDoors":
1040
1041 case "NivaHood":
1043
1044 case "NivaTrunk":
1046 }
1047
1049 }
1050
1052 {
1054 switch (posIdx)
1055 {
1056 case 0:
1058 return false;
1059 else if (GetAnimationPhase("SeatDriver") > 0.5)
1060 return false;
1061
1062 return true;
1063
1064 case 1:
1066 return false;
1067 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1068 return false;
1069
1070 return true;
1071
1072 case 2:
1074 return false;
1075 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1076 return false;
1077
1078 return true;
1079
1080 case 3:
1082 return false;
1083 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1084 return false;
1085
1086 return true;
1087 }
1088
1089 return false;
1090 }
1091
1093 {
1094 switch (posIdx)
1095 {
1096 case 0:
1097 case 2:
1098 return "doors_driver";
1099 case 1:
1100 case 3:
1101 return "doors_codriver";
1102 }
1103
1104 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1105 }
1106
1108 {
1109 switch (posIdx)
1110 {
1111 case 0:
1112 case 2:
1113 return "NivaDriverDoors";
1114 case 1:
1115 case 3:
1116 return "NivaCoDriverDoors";
1117 }
1118
1119 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1120 }
1121
1122
1123
1125 {
1126 float tempCap = 0.0;
1127
1128 switch (ctrl)
1129 {
1131 float newValue = 0;
1133 {
1134 newValue += 0.5;
1135 }
1136
1138 {
1139 newValue += 0.5;
1140 }
1141
1143 {
1144 newValue += 0.3;
1145 }
1146
1148 {
1149 newValue -= 0.6;
1150 }
1151
1153 {
1154 newValue -= 0.2;
1155 }
1156
1158 {
1159 newValue -= 0.2;
1160 }
1161
1163 break;
1164 }
1165
1166 return super.OnSound(ctrl, oldValue);
1167 }
1168
1170 {
1171 switch (selection)
1172 {
1173 case "doors_driver":
1174 return "DoorsDriver";
1175 case "doors_codriver":
1176 return "DoorsCoDriver";
1177 case "doors_hood":
1178 return "DoorsHood";
1179 case "doors_trunk":
1180 return "DoorsTrunk";
1181 case "seatback_driver":
1182 return "SeatDriver";
1183 case "seatback_codriver":
1184 return "SeatCoDriver";
1185 }
1186
1187 return "";
1188 }
1189
1191 {
1192 switch (selection)
1193 {
1194 case "seat_driver":
1195 case "seatback_driver":
1196 case "seat_cargo1":
1197 return "seat_con_1_1";
1198 case "seat_codriver":
1199 case "seatback_codriver":
1200 case "seat_cargo2":
1201 return "seat_con_2_1";
1202 }
1203
1204 return "";
1205 }
1206
1208 {
1209 switch (selection)
1210 {
1211 case "seatback_driver":
1212 return 0;
1213 case "seatback_codriver":
1214 return 1;
1215 }
1216
1217 return -1;
1218 }
1219
1221 {
1222 return false;
1223 }
1224
1226 {
1227 return false;
1228 }
1229
1231 {
1232 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1233 return false;
1234
1235 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1236 return false;
1237
1238 switch (currentSeat)
1239 {
1240 case 0:
1241 return nextSeat == 1;
1242
1243 case 1:
1244 return nextSeat == 0;
1245
1246 case 2:
1247 return nextSeat == 3;
1248
1249 case 3:
1250 return nextSeat == 2;
1251 }
1252
1253 return false;
1254 }
1255
1257 {
1258 switch (pCurrentSeat)
1259 {
1260 case 0:
1261 return pDoorsSelection == "DoorsDriver";
1262
1263 case 1:
1264 return pDoorsSelection == "DoorsCoDriver";
1265
1266 case 2:
1267 return pDoorsSelection == "DoorsDriver";
1268
1269 case 3:
1270 return pDoorsSelection == "DoorsCoDriver";
1271 }
1272
1273 return false;
1274 }
1275
1277 {
1278 switch (pDoorSelection)
1279 {
1280 case "DoorsDriver":
1281 return 0;
1282 case "DoorsCoDriver":
1283 return 1;
1284 }
1285
1286 return -1;
1287 }
1288
1290 {
1291 super.SetActions();
1292
1294 }
1295
1297 {
1301
1302 GetInventory().CreateInInventory("HatchbackWheel");
1303 GetInventory().CreateInInventory("HatchbackWheel");
1304 GetInventory().CreateInInventory("HatchbackWheel" );
1305 GetInventory().CreateInInventory("HatchbackWheel");
1306
1307 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1308 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1309 GetInventory().CreateInInventory("HatchbackHood");
1310 GetInventory().CreateInInventory("HatchbackTrunk");
1311
1312
1313 GetInventory().CreateInInventory("HatchbackWheel");
1314 GetInventory().CreateInInventory("HatchbackWheel");
1315 }
1316}
1317
1319{
1321 {
1325
1326 GetInventory().CreateInInventory("HatchbackWheel");
1327 GetInventory().CreateInInventory("HatchbackWheel");
1328 GetInventory().CreateInInventory("HatchbackWheel");
1329 GetInventory().CreateInInventory("HatchbackWheel");
1330
1331 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1332 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1333 GetInventory().CreateInInventory("HatchbackHood_White");
1334 GetInventory().CreateInInventory("HatchbackTrunk_White");
1335
1336
1337 GetInventory().CreateInInventory("HatchbackWheel");
1338 GetInventory().CreateInInventory("HatchbackWheel");
1339 }
1340}
1341
1343{
1345 {
1349
1350 GetInventory().CreateInInventory("HatchbackWheel");
1351 GetInventory().CreateInInventory("HatchbackWheel");
1352 GetInventory().CreateInInventory("HatchbackWheel");
1353 GetInventory().CreateInInventory("HatchbackWheel");
1354
1355 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1356 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1357 GetInventory().CreateInInventory("HatchbackHood_Blue");
1358 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1359
1360
1361 GetInventory().CreateInInventory("HatchbackWheel");
1362 GetInventory().CreateInInventory("HatchbackWheel");
1363 }
1364}
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.