853{
857
859 {
860
861
868
869 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
870 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
871 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
872 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
873
876
879
881
883 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
884 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
885 }
886
888 {
892 }
893
895 {
896 super.EEInit();
897
899 {
906
909 }
910 }
911
913 {
914 return true;
915 }
916
918 {
919 super.GetElectricitySourceDevice();
920
922 }
923
925 {
926 return "CarBattery";
927 }
928
930 {
931 super.OnEngineStart();
932
934 {
937 }
938 }
939
941 {
942 super.OnEngineStop();
943
945 {
948 }
949 }
950
952 {
954 {
956 {
958 }
959 }
960 }
961
963 {
965 }
966
968 {
969 return 3.5;
970 }
971
973 {
974 switch (posIdx)
975 {
976 case 0:
978 case 1:
980 case 2:
982 case 3:
984 }
985
986 return 0;
987
988 }
989
991 {
992 if (!super.CanReleaseAttachment(attachment))
993 {
994 return false;
995 }
996
998 {
999 string attType = attachment.GetType();
1000 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1001 {
1002 return false;
1003 }
1004 }
1005
1006 return true;
1007 }
1008
1010 {
1012 }
1013
1015 {
1016 if (!super.CanDisplayAttachmentCategory(category_name))
1017 {
1018 return false;
1019 }
1020
1022 if (category_name.
Contains(
"engine"))
1023 {
1025 {
1026 return false;
1027 }
1028 }
1029
1030 return true;
1031 }
1032
1034 {
1035 if (!super.CanDisplayCargo())
1036 {
1037 return false;
1038 }
1039
1041 {
1042 return false;
1043 }
1044
1045 return true;
1046 }
1047
1049 {
1051
1052 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
1053 if (!carDoor)
1054 {
1056 }
1057
1058 switch (slotType)
1059 {
1060 case "NivaDriverDoors":
1061 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1062
1063 case "NivaCoDriverDoors":
1064 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1065
1066 case "NivaHood":
1067 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1068
1069 case "NivaTrunk":
1070 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1071 }
1072
1074 }
1075
1077 {
1079 switch (posIdx)
1080 {
1081 case 0:
1083 return false;
1084 else if (GetAnimationPhase("SeatDriver") > 0.5)
1085 return false;
1086
1087 return true;
1088
1089 case 1:
1091 return false;
1092 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1093 return false;
1094
1095 return true;
1096
1097 case 2:
1099 return false;
1100 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1101 return false;
1102
1103 return true;
1104
1105 case 3:
1107 return false;
1108 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1109 return false;
1110
1111 return true;
1112 }
1113
1114 return false;
1115 }
1116
1118 {
1119 switch (posIdx)
1120 {
1121 case 0:
1122 case 2:
1123 return "doors_driver";
1124 case 1:
1125 case 3:
1126 return "doors_codriver";
1127 }
1128
1129 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1130 }
1131
1133 {
1134 switch (posIdx)
1135 {
1136 case 0:
1137 case 2:
1138 return "NivaDriverDoors";
1139 case 1:
1140 case 3:
1141 return "NivaCoDriverDoors";
1142 }
1143
1144 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1145 }
1146
1147
1148
1150 {
1151 float tempCap = 0.0;
1152
1153 switch (ctrl)
1154 {
1156 float newValue = 0;
1158 {
1159 newValue += 0.5;
1160 }
1161
1163 {
1164 newValue += 0.5;
1165 }
1166
1168 {
1169 newValue += 0.3;
1170 }
1171
1173 {
1174 newValue -= 0.6;
1175 }
1176
1178 {
1179 newValue -= 0.2;
1180 }
1181
1183 {
1184 newValue -= 0.2;
1185 }
1186
1188 break;
1189 }
1190
1191 return super.OnSound(ctrl, oldValue);
1192 }
1193
1195 {
1196 switch (selection)
1197 {
1198 case "doors_driver":
1199 return "DoorsDriver";
1200 case "doors_codriver":
1201 return "DoorsCoDriver";
1202 case "doors_hood":
1203 return "DoorsHood";
1204 case "doors_trunk":
1205 return "DoorsTrunk";
1206 case "seatback_driver":
1207 return "SeatDriver";
1208 case "seatback_codriver":
1209 return "SeatCoDriver";
1210 }
1211
1212 return "";
1213 }
1214
1216 {
1217 switch (selection)
1218 {
1219 case "seat_driver":
1220 case "seatback_driver":
1221 case "seat_cargo1":
1222 return "seat_con_1_1";
1223 case "seat_codriver":
1224 case "seatback_codriver":
1225 case "seat_cargo2":
1226 return "seat_con_2_1";
1227 }
1228
1229 return "";
1230 }
1231
1233 {
1234 switch (selection)
1235 {
1236 case "seatback_driver":
1237 return 0;
1238 case "seatback_codriver":
1239 return 1;
1240 }
1241
1242 return -1;
1243 }
1244
1246 {
1247 return false;
1248 }
1249
1251 {
1252 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1253 return false;
1254
1255 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1256 return false;
1257
1258 switch (currentSeat)
1259 {
1260 case 0:
1261 return nextSeat == 1;
1262
1263 case 1:
1264 return nextSeat == 0;
1265
1266 case 2:
1267 return nextSeat == 3;
1268
1269 case 3:
1270 return nextSeat == 2;
1271 }
1272
1273 return false;
1274 }
1275
1277 {
1278 switch (pCurrentSeat)
1279 {
1280 case 0:
1281 return pDoorsSelection == "DoorsDriver";
1282
1283 case 1:
1284 return pDoorsSelection == "DoorsCoDriver";
1285
1286 case 2:
1287 return pDoorsSelection == "DoorsDriver";
1288
1289 case 3:
1290 return pDoorsSelection == "DoorsCoDriver";
1291 }
1292
1293 return false;
1294 }
1295
1297 {
1298 switch (pDoorSelection)
1299 {
1300 case "DoorsDriver":
1301 return 0;
1302 case "DoorsCoDriver":
1303 return 1;
1304 }
1305
1306 return -1;
1307 }
1308
1310 {
1311 super.SetActions();
1312
1314 }
1315
1317 {
1319 SpawnAdditionalItems();
1320 FillUpCarFluids();
1321
1327
1332
1333
1336 }
1337}
1338
1340{
1342 {
1344 SpawnAdditionalItems();
1345 FillUpCarFluids();
1346
1347 GameInventory inventory = GetInventory();
1352
1357
1358
1359
1362 }
1363}
1364
1366{
1368 {
1370 SpawnAdditionalItems();
1371 FillUpCarFluids();
1372
1373 GameInventory inventory = GetInventory();
1378
1383
1384
1387 }
1388}
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.