850{
854
856 {
857
858
865
866 m_CarDoorOpenSound = "offroad_02_door_open_SoundSet";
867 m_CarDoorCloseSound = "offroad_02_door_close_SoundSet";
868
871
875 });
879 });
880
883
885
887 m_CarHornShortSoundName = "Offroad_02_Horn_Short_SoundSet";
888 m_CarHornLongSoundName = "Offroad_02_Horn_SoundSet";
889 }
890
892 {
896 }
897
899 {
900 super.EEInit();
901
903 {
910
913 }
914 }
915
917 {
918 return true;
919 }
920
922 {
923 return true;
924 }
925
927 {
928 super.GetElectricitySourceDevice();
929
931 }
932
934 {
935 return "CarBattery";
936 }
937
939 {
940 super.OnEngineStart();
941
943 {
946 }
947 }
948
950 {
951 super.OnEngineStop();
952
954 {
957 }
958 }
959
961 {
963 {
965 {
967 }
968 }
969 }
970
972 {
974 }
975
977 {
978 return 5.1;
979 }
980
982 {
983 return 1.5;
984 }
985
987 {
988 switch (posIdx)
989 {
990 case 0:
992 case 1:
994 case 2:
996 case 3:
998 }
999
1000 return 0;
1001 }
1002
1004 {
1005 if (!super.CanReleaseAttachment(attachment))
1006 {
1007 return false;
1008 }
1009
1010 string attType = attachment.GetType();
1011 switch (attType)
1012 {
1013 case "CarBattery":
1015 {
1016 return false;
1017 }
1018 break;
1019
1020 case "GlowPlug":
1022 {
1023 return false;
1024 }
1025 break;
1026 }
1027
1028 return true;
1029 }
1030
1032 {
1034 }
1035
1037 {
1038 if ( !super.CanDisplayAttachmentCategory(category_name))
1039 {
1040 return false;
1041 }
1042
1044 if (category_name.
Contains(
"engine"))
1045 {
1047 {
1048 return false;
1049 }
1050 }
1051
1052 return true;
1053 }
1054
1056 {
1057 if ( !super.CanDisplayCargo() )
1058 return false;
1059
1061 return false;
1062
1063 return true;
1064 }
1065
1067 {
1069
1070 Class.
CastTo( carDoor, FindAttachmentBySlotName( slotType ) );
1071 if (!carDoor)
1072 {
1074 }
1075
1076 switch (slotType)
1077 {
1078 case "Offroad_02_Door_1_1":
1079 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1080
1081 case "Offroad_02_Door_2_1":
1082 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1083
1084 case "Offroad_02_Door_1_2":
1085 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
1086
1087 case "Offroad_02_Door_2_2":
1088 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
1089
1090 case "Offroad_02_Hood":
1091 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1092
1093 case "Offroad_02_Trunk":
1094 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1095 }
1096
1098 }
1099
1100
1102 {
1103 switch( posIdx )
1104 {
1105 case 0:
1107 return false;
1108
1109 return true;
1110 break;
1111
1112 case 1:
1114 return false;
1115
1116 return true;
1117 break;
1118
1119 case 2:
1121 return false;
1122
1123 return true;
1124 break;
1125
1126 case 3:
1128 return false;
1129
1130 return true;
1131 break;
1132 }
1133
1134 return false;
1135 }
1136
1138 {
1139 switch( posIdx )
1140 {
1141 case 0:
1142 return "doors_driver";
1143 break;
1144 case 1:
1145 return "doors_codriver";
1146 break;
1147 case 2:
1148 return "doors_cargo1";
1149 break;
1150 case 3:
1151 return "doors_cargo2";
1152 break;
1153 }
1154
1155 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1156 }
1157
1159 {
1160 switch (posIdx)
1161 {
1162 case 0:
1163 return "Offroad_02_Door_1_1";
1164 case 1:
1165 return "Offroad_02_Door_2_1";
1166 case 2:
1167 return "Offroad_02_Door_1_2";
1168 case 3:
1169 return "Offroad_02_Door_2_2";
1170 }
1171
1172 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1173 }
1174
1176 {
1177 switch ( ctrl )
1178 {
1180 float newValue = 0;
1182 {
1183 newValue += 0.25;
1184 }
1185
1187 {
1188 newValue += 0.25;
1189 }
1190
1192 {
1193 newValue += 0.25;
1194 }
1195
1197 {
1198 newValue += 0.25;
1199 }
1200
1202 break;
1203 }
1204
1205 return super.OnSound(ctrl, oldValue);
1206 }
1207
1209 {
1210 switch (selection)
1211 {
1212 case "doors_driver":
1213 return "DoorsDriver";
1214 case "doors_codriver":
1215 return "DoorsCoDriver";
1216 case "doors_cargo1":
1217 return "DoorsCargo1";
1218 case "doors_cargo2":
1219 return "DoorsCargo2";
1220 case "doors_hood":
1221 return "DoorsHood";
1222 case "doors_trunk":
1223 return "DoorsTrunk";
1224 }
1225
1226 return "";
1227 }
1228
1230 {
1231 switch (currentSeat)
1232 {
1233 case 0:
1234 return nextSeat == 1;
1235 case 1:
1236 return nextSeat == 0;
1237 case 2:
1238 return nextSeat == 3;
1239 case 3:
1240 return nextSeat == 2;
1241 }
1242
1243 return false;
1244 }
1245
1247 {
1248 switch (pCurrentSeat)
1249 {
1250 case 0:
1251 return pDoorsSelection == "DoorsDriver";
1252 case 1:
1253 return pDoorsSelection == "DoorsCoDriver";
1254 case 2:
1255 return pDoorsSelection == "DoorsCargo1";
1256 case 3:
1257 return pDoorsSelection == "DoorsCargo2";
1258 }
1259
1260 return false;
1261 }
1262
1264 {
1265 return false;
1266 }
1267
1269 {
1270 return false;
1271 }
1272
1274 {
1276 SpawnAdditionalItems();
1277 FillUpCarFluids();
1278
1284
1291
1292
1295 }
1296}
1297
1298
1300{
1302 {
1304 SpawnAdditionalItems();
1305 FillUpCarFluids();
1306
1307 GetInventory().CreateInInventory("Offroad_02_Wheel");
1308 GetInventory().CreateInInventory("Offroad_02_Wheel");
1309 GetInventory().CreateInInventory("Offroad_02_Wheel");
1310 GetInventory().CreateInInventory("Offroad_02_Wheel");
1311
1312 GetInventory().CreateInInventory("Offroad_02_Door_1_1_Beige");
1313 GetInventory().CreateInInventory("Offroad_02_Door_1_2_Beige");
1314 GetInventory().CreateInInventory("Offroad_02_Door_2_1_Beige");
1315 GetInventory().CreateInInventory("Offroad_02_Door_2_2_Beige");
1316 GetInventory().CreateInInventory("Offroad_02_Trunk_Beige");
1317 GetInventory().CreateInInventory("Offroad_02_Hood_Beige");
1318
1319
1320 GetInventory().CreateInInventory("Offroad_02_Wheel");
1321 GetInventory().CreateInInventory("Offroad_02_Wheel");
1322 }
1323}
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
Offroad_02LightProfileFront VehicleLightProfileFront Offroad_02LightProfileRear()
void Offroad_02LightProfileFront()
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
void VehicleLightData(VehicleLightProfileBase profile)
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
override bool IsVitalRadiator()
override bool IsVitalSparkPlug()
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
override string GetAnimSourceFromSelection(string selection)
override int GetSeatAnimationType(int posIdx)
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()
Offroad_02 CarScript OnDebugSpawn()
override EntityAI GetElectricitySourceDevice()
override void OnEngineStart()
override bool HasGangedTailAndBrakeLights()
override int GetAnimInstance()
override bool CrewCanGetThrough(int posIdx)
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
bool CanManipulateSpareWheel(string slotSelectionName)
override bool NeedElectricitySourceDevice()
override float GetWeightCoef()
override string GetElectricitySourceDeviceType()
override string GetDoorSelectionNameFromSeatPos(int posIdx)
override int GetCarDoorsState(string slotType)
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()
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.