870{
874
876 {
877
878
885
886 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
887 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
888 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
889 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
890
893
896
898
900 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
901 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
902 }
903
905 {
909 }
910
912 {
913 super.EEInit();
914
916 {
923
926 }
927 }
928
930 {
931 return true;
932 }
933
935 {
936 super.GetElectricitySourceDevice();
937
939 }
940
942 {
943 return "CarBattery";
944 }
945
947 {
948 super.OnEngineStart();
949
951 {
954 }
955 }
956
958 {
959 super.OnEngineStop();
960
962 {
965 }
966 }
967
969 {
971 {
973 {
975 }
976 }
977 }
978
980 {
982 }
983
985 {
986 return 3.5;
987 }
988
990 {
991 switch (posIdx)
992 {
993 case 0:
995 case 1:
997 case 2:
999 case 3:
1001 }
1002
1003 return 0;
1004
1005 }
1006
1008 {
1009 if (!super.CanReleaseAttachment(attachment))
1010 {
1011 return false;
1012 }
1013
1015 {
1016 string attType = attachment.GetType();
1017 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1018 {
1019 return false;
1020 }
1021 }
1022
1023 return true;
1024 }
1025
1027 {
1029 }
1030
1032 {
1033 if (!super.CanDisplayAttachmentCategory(category_name))
1034 {
1035 return false;
1036 }
1037
1039 if (category_name.
Contains(
"engine"))
1040 {
1042 {
1043 return false;
1044 }
1045 }
1046
1047 return true;
1048 }
1049
1051 {
1052 if (!super.CanDisplayCargo())
1053 {
1054 return false;
1055 }
1056
1058 {
1059 return false;
1060 }
1061
1062 return true;
1063 }
1064
1066 {
1068
1069 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1070 if (!carDoor)
1071 {
1073 }
1074
1075 switch (slotType)
1076 {
1077 case "NivaDriverDoors":
1078 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1079
1080 case "NivaCoDriverDoors":
1081 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1082
1083 case "NivaHood":
1084 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1085
1086 case "NivaTrunk":
1087 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1088 }
1089
1091 }
1092
1094 {
1096 switch (posIdx)
1097 {
1098 case 0:
1100 return false;
1101 else if (GetAnimationPhase("SeatDriver") > 0.5)
1102 return false;
1103
1104 return true;
1105
1106 case 1:
1108 return false;
1109 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1110 return false;
1111
1112 return true;
1113
1114 case 2:
1116 return false;
1117 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1118 return false;
1119
1120 return true;
1121
1122 case 3:
1124 return false;
1125 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1126 return false;
1127
1128 return true;
1129 }
1130
1131 return false;
1132 }
1133
1135 {
1136 switch (posIdx)
1137 {
1138 case 0:
1139 case 2:
1140 return "doors_driver";
1141 case 1:
1142 case 3:
1143 return "doors_codriver";
1144 }
1145
1146 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1147 }
1148
1150 {
1151 switch (posIdx)
1152 {
1153 case 0:
1154 case 2:
1155 return "NivaDriverDoors";
1156 case 1:
1157 case 3:
1158 return "NivaCoDriverDoors";
1159 }
1160
1161 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1162 }
1163
1164
1165
1167 {
1168 float tempCap = 0.0;
1169
1170 switch (ctrl)
1171 {
1173 float newValue = 0;
1175 {
1176 newValue += 0.5;
1177 }
1178
1180 {
1181 newValue += 0.5;
1182 }
1183
1185 {
1186 newValue += 0.3;
1187 }
1188
1190 {
1191 newValue -= 0.6;
1192 }
1193
1195 {
1196 newValue -= 0.2;
1197 }
1198
1200 {
1201 newValue -= 0.2;
1202 }
1203
1205 break;
1206 }
1207
1208 return super.OnSound(ctrl, oldValue);
1209 }
1210
1212 {
1213 switch (selection)
1214 {
1215 case "doors_driver":
1216 return "DoorsDriver";
1217 case "doors_codriver":
1218 return "DoorsCoDriver";
1219 case "doors_hood":
1220 return "DoorsHood";
1221 case "doors_trunk":
1222 return "DoorsTrunk";
1223 case "seatback_driver":
1224 return "SeatDriver";
1225 case "seatback_codriver":
1226 return "SeatCoDriver";
1227 }
1228
1229 return "";
1230 }
1231
1233 {
1234 switch (selection)
1235 {
1236 case "seat_driver":
1237 case "seatback_driver":
1238 case "seat_cargo1":
1239 return "seat_con_1_1";
1240 case "seat_codriver":
1241 case "seatback_codriver":
1242 case "seat_cargo2":
1243 return "seat_con_2_1";
1244 }
1245
1246 return "";
1247 }
1248
1250 {
1251 switch (selection)
1252 {
1253 case "seatback_driver":
1254 return 0;
1255 case "seatback_codriver":
1256 return 1;
1257 }
1258
1259 return -1;
1260 }
1261
1263 {
1264 return false;
1265 }
1266
1268 {
1269 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1270 return false;
1271
1272 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1273 return false;
1274
1275 switch (currentSeat)
1276 {
1277 case 0:
1278 return nextSeat == 1;
1279
1280 case 1:
1281 return nextSeat == 0;
1282
1283 case 2:
1284 return nextSeat == 3;
1285
1286 case 3:
1287 return nextSeat == 2;
1288 }
1289
1290 return false;
1291 }
1292
1294 {
1295 switch (pCurrentSeat)
1296 {
1297 case 0:
1298 return pDoorsSelection == "DoorsDriver";
1299
1300 case 1:
1301 return pDoorsSelection == "DoorsCoDriver";
1302
1303 case 2:
1304 return pDoorsSelection == "DoorsDriver";
1305
1306 case 3:
1307 return pDoorsSelection == "DoorsCoDriver";
1308 }
1309
1310 return false;
1311 }
1312
1314 {
1315 switch (pDoorSelection)
1316 {
1317 case "DoorsDriver":
1318 return 0;
1319 case "DoorsCoDriver":
1320 return 1;
1321 }
1322
1323 return -1;
1324 }
1325
1327 {
1328 super.SetActions();
1329
1331 }
1332
1334 {
1336 SpawnAdditionalItems();
1337 FillUpCarFluids();
1338
1344
1349
1350
1353 }
1354}
1355
1357{
1359 {
1361 SpawnAdditionalItems();
1362 FillUpCarFluids();
1363
1364 GameInventory inventory = GetInventory();
1369
1374
1375
1376
1379 }
1380}
1381
1383{
1385 {
1387 SpawnAdditionalItems();
1388 FillUpCarFluids();
1389
1390 GameInventory inventory = GetInventory();
1395
1400
1401
1404 }
1405}
void AddAction(typename actionName)
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
ref UniversalTemperatureSourceSettings m_UTSSettings
ref UniversalTemperatureSource m_UTSource
proto native void SetEnginePos(vector pos)
Override the position of engine (model space)
proto native bool EngineIsOn()
Returns true when engine is running, false otherwise.
void SpawnUniversalParts()
string m_EngineStartBattery
ref VehicleHornComponent m_HornComponent
ref VehicleLightsComponent m_LightsComponent
OffroadHatchbackLightProfileFront VehicleLightProfileFront OffroadHatchbackLightProfileRear()
void OffroadHatchbackLightProfileFront()
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
void VehicleLightData(VehicleLightProfileBase profile)
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
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 EntityAI GetElectricitySourceDevice()
override void OnEngineStart()
override int GetAnimInstance()
override bool CrewCanGetThrough(int posIdx)
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
bool CanManipulateSpareWheel(string slotSelectionName)
OffroadHatchback CarScript OnDebugSpawn()
override bool IsVitalGlowPlug()
override bool NeedElectricitySourceDevice()
override int GetSeatIndexFromDoor(string pDoorSelection)
override string GetElectricitySourceDeviceType()
override string GetDoorSelectionNameFromSeatPos(int posIdx)
override int GetCarDoorsState(string slotType)
override int GetCrewIndex(string selection)
override bool CanDisplayAttachmentCategory(string category_name)
Super root of all classes in Enforce script.
EntityAI CreateInInventory(string type)
creates entity somewhere in inventory
script counterpart to engine's class Inventory
override void OnDebugSpawn()
override void OnDebugSpawn()
original Timer deletes m_params which is unwanted
DayZPlayerConstants
defined in C++
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.