846{
850
852 {
853
854
860
865
868
869 SetEnginePos("0 0.7 1.2");
870 }
871
873 {
874 super.EEInit();
875
877 {
884
887 }
888 }
889
891 {
892 super.OnEngineStart();
893
895 {
897 }
898 }
899
901 {
902 super.OnEngineStop();
903
905 {
907 }
908 }
909
911 {
913 {
915 {
917 }
918 }
919 }
920
922 {
924 }
925
927 {
928 return 3.5;
929 }
930
932 {
933 switch (posIdx)
934 {
935 case 0:
937 case 1:
939 case 2:
941 case 3:
943 }
944
945 return 0;
946
947 }
948
949
951 {
953 }
954
956 {
958 }
959
961 {
962 if (!super.CanReleaseAttachment(attachment))
963 {
964 return false;
965 }
966
968 {
969 string attType = attachment.GetType();
970 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
971 {
972 return false;
973 }
974 }
975
976 return true;
977 }
978
980 {
982 }
983
985 {
986 if (!super.CanDisplayAttachmentCategory(category_name))
987 {
988 return false;
989 }
990
992 if (category_name.
Contains(
"engine"))
993 {
995 {
996 return false;
997 }
998 }
999
1000 return true;
1001 }
1002
1004 {
1005 if (!super.CanDisplayCargo())
1006 {
1007 return false;
1008 }
1009
1011 {
1012 return false;
1013 }
1014
1015 return true;
1016 }
1017
1019 {
1021
1022 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1023 if (!carDoor)
1024 {
1026 }
1027
1028 switch (slotType)
1029 {
1030 case "NivaDriverDoors":
1032
1033 case "NivaCoDriverDoors":
1035
1036 case "NivaHood":
1038
1039 case "NivaTrunk":
1041 }
1042
1044 }
1045
1047 {
1049 switch (posIdx)
1050 {
1051 case 0:
1053 return false;
1054 else if (GetAnimationPhase("SeatDriver") > 0.5)
1055 return false;
1056
1057 return true;
1058
1059 case 1:
1061 return false;
1062 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1063 return false;
1064
1065 return true;
1066
1067 case 2:
1069 return false;
1070 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1071 return false;
1072
1073 return true;
1074
1075 case 3:
1077 return false;
1078 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1079 return false;
1080
1081 return true;
1082 }
1083
1084 return false;
1085 }
1086
1088 {
1089 switch (posIdx)
1090 {
1091 case 0:
1092 case 2:
1093 return "doors_driver";
1094 case 1:
1095 case 3:
1096 return "doors_codriver";
1097 }
1098
1099 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1100 }
1101
1103 {
1104 switch (posIdx)
1105 {
1106 case 0:
1107 case 2:
1108 return "NivaDriverDoors";
1109 case 1:
1110 case 3:
1111 return "NivaCoDriverDoors";
1112 }
1113
1114 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1115 }
1116
1117
1118
1120 {
1121 float tempCap = 0.0;
1122
1123 switch (ctrl)
1124 {
1126 float newValue = 0;
1128 {
1129 newValue += 0.5;
1130 }
1131
1133 {
1134 newValue += 0.5;
1135 }
1136
1138 {
1139 newValue += 0.3;
1140 }
1141
1143 {
1144 newValue -= 0.6;
1145 }
1146
1148 {
1149 newValue -= 0.2;
1150 }
1151
1153 {
1154 newValue -= 0.2;
1155 }
1156
1158 break;
1159 }
1160
1161 return super.OnSound(ctrl, oldValue);
1162 }
1163
1165 {
1166 switch (selection)
1167 {
1168 case "doors_driver":
1169 return "DoorsDriver";
1170 case "doors_codriver":
1171 return "DoorsCoDriver";
1172 case "doors_hood":
1173 return "DoorsHood";
1174 case "doors_trunk":
1175 return "DoorsTrunk";
1176 case "seatback_driver":
1177 return "SeatDriver";
1178 case "seatback_codriver":
1179 return "SeatCoDriver";
1180 }
1181
1182 return "";
1183 }
1184
1186 {
1187 switch (selection)
1188 {
1189 case "seat_driver":
1190 case "seatback_driver":
1191 case "seat_cargo1":
1192 return "seat_con_1_1";
1193 case "seat_codriver":
1194 case "seatback_codriver":
1195 case "seat_cargo2":
1196 return "seat_con_2_1";
1197 }
1198
1199 return "";
1200 }
1201
1203 {
1204 switch (selection)
1205 {
1206 case "seatback_driver":
1207 return 0;
1208 case "seatback_codriver":
1209 return 1;
1210 }
1211
1212 return -1;
1213 }
1214
1216 {
1217 return false;
1218 }
1219
1221 {
1222 return false;
1223 }
1224
1226 {
1227 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1228 return false;
1229
1230 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1231 return false;
1232
1233 switch (currentSeat)
1234 {
1235 case 0:
1236 return nextSeat == 1;
1237
1238 case 1:
1239 return nextSeat == 0;
1240
1241 case 2:
1242 return nextSeat == 3;
1243
1244 case 3:
1245 return nextSeat == 2;
1246 }
1247
1248 return false;
1249 }
1250
1252 {
1253 switch (pCurrentSeat)
1254 {
1255 case 0:
1256 return pDoorsSelection == "DoorsDriver";
1257
1258 case 1:
1259 return pDoorsSelection == "DoorsCoDriver";
1260
1261 case 2:
1262 return pDoorsSelection == "DoorsDriver";
1263
1264 case 3:
1265 return pDoorsSelection == "DoorsCoDriver";
1266 }
1267
1268 return false;
1269 }
1270
1272 {
1273 switch (pDoorSelection)
1274 {
1275 case "DoorsDriver":
1276 return 0;
1277 case "DoorsCoDriver":
1278 return 1;
1279 }
1280
1281 return -1;
1282 }
1283
1285 {
1286 super.SetActions();
1287
1289 }
1290
1292 {
1296
1297 GetInventory().CreateInInventory("HatchbackWheel");
1298 GetInventory().CreateInInventory("HatchbackWheel");
1299 GetInventory().CreateInInventory("HatchbackWheel" );
1300 GetInventory().CreateInInventory("HatchbackWheel");
1301
1302 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1303 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1304 GetInventory().CreateInInventory("HatchbackHood");
1305 GetInventory().CreateInInventory("HatchbackTrunk");
1306
1307
1308 GetInventory().CreateInInventory("HatchbackWheel");
1309 GetInventory().CreateInInventory("HatchbackWheel");
1310 }
1311}
1312
1314{
1316 {
1320
1321 GetInventory().CreateInInventory("HatchbackWheel");
1322 GetInventory().CreateInInventory("HatchbackWheel");
1323 GetInventory().CreateInInventory("HatchbackWheel");
1324 GetInventory().CreateInInventory("HatchbackWheel");
1325
1326 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1327 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1328 GetInventory().CreateInInventory("HatchbackHood_White");
1329 GetInventory().CreateInInventory("HatchbackTrunk_White");
1330
1331
1332 GetInventory().CreateInInventory("HatchbackWheel");
1333 GetInventory().CreateInInventory("HatchbackWheel");
1334 }
1335}
1336
1338{
1340 {
1344
1345 GetInventory().CreateInInventory("HatchbackWheel");
1346 GetInventory().CreateInInventory("HatchbackWheel");
1347 GetInventory().CreateInInventory("HatchbackWheel");
1348 GetInventory().CreateInInventory("HatchbackWheel");
1349
1350 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1351 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1352 GetInventory().CreateInInventory("HatchbackHood_Blue");
1353 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1354
1355
1356 GetInventory().CreateInInventory("HatchbackWheel");
1357 GetInventory().CreateInInventory("HatchbackWheel");
1358 }
1359}
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.