812{
816
818 {
819
820
827
828 m_CarDoorOpenSound = "offroad_02_door_open_SoundSet";
829 m_CarDoorCloseSound = "offroad_02_door_close_SoundSet";
830
833
837 });
841 });
842
845
847
849 m_CarHornShortSoundName = "Offroad_02_Horn_Short_SoundSet";
850 m_CarHornLongSoundName = "Offroad_02_Horn_SoundSet";
851 }
852
854 {
858 }
859
861 {
862 super.EEInit();
863
865 {
872
875 }
876 }
877
879 {
880 return true;
881 }
882
884 {
885 return true;
886 }
887
889 {
890 super.GetElectricitySourceDevice();
891
893 }
894
896 {
897 return "CarBattery";
898 }
899
901 {
902 super.OnEngineStart();
903
905 {
908 }
909 }
910
912 {
913 super.OnEngineStop();
914
916 {
919 }
920 }
921
923 {
925 {
927 {
929 }
930 }
931 }
932
934 {
936 }
937
939 {
940 return 5.1;
941 }
942
944 {
945 return 1.5;
946 }
947
949 {
950 switch (posIdx)
951 {
952 case 0:
954 case 1:
956 case 2:
958 case 3:
960 }
961
962 return 0;
963 }
964
966 {
967 if (!super.CanReleaseAttachment(attachment))
968 {
969 return false;
970 }
971
972 string attType = attachment.GetType();
973 switch (attType)
974 {
975 case "CarBattery":
977 {
978 return false;
979 }
980 break;
981
982 case "GlowPlug":
984 {
985 return false;
986 }
987 break;
988 }
989
990 return true;
991 }
992
994 {
996 }
997
999 {
1000 if ( !super.CanDisplayAttachmentCategory(category_name))
1001 {
1002 return false;
1003 }
1004
1006 if (category_name.
Contains(
"engine"))
1007 {
1009 {
1010 return false;
1011 }
1012 }
1013
1014 return true;
1015 }
1016
1018 {
1019 if ( !super.CanDisplayCargo() )
1020 return false;
1021
1023 return false;
1024
1025 return true;
1026 }
1027
1029 {
1031
1032 Class.
CastTo( carDoor, FindAttachmentBySlotName( slotType ) );
1033 if (!carDoor)
1034 {
1036 }
1037
1038 switch (slotType)
1039 {
1040 case "Offroad_02_Door_1_1":
1041 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1042
1043 case "Offroad_02_Door_2_1":
1044 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1045
1046 case "Offroad_02_Door_1_2":
1047 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
1048
1049 case "Offroad_02_Door_2_2":
1050 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
1051
1052 case "Offroad_02_Hood":
1053 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1054
1055 case "Offroad_02_Trunk":
1056 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1057 }
1058
1060 }
1061
1062
1064 {
1065 switch( posIdx )
1066 {
1067 case 0:
1069 return false;
1070
1071 return true;
1072 break;
1073
1074 case 1:
1076 return false;
1077
1078 return true;
1079 break;
1080
1081 case 2:
1083 return false;
1084
1085 return true;
1086 break;
1087
1088 case 3:
1090 return false;
1091
1092 return true;
1093 break;
1094 }
1095
1096 return false;
1097 }
1098
1100 {
1101 switch( posIdx )
1102 {
1103 case 0:
1104 return "doors_driver";
1105 break;
1106 case 1:
1107 return "doors_codriver";
1108 break;
1109 case 2:
1110 return "doors_cargo1";
1111 break;
1112 case 3:
1113 return "doors_cargo2";
1114 break;
1115 }
1116
1117 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1118 }
1119
1121 {
1122 switch (posIdx)
1123 {
1124 case 0:
1125 return "Offroad_02_Door_1_1";
1126 case 1:
1127 return "Offroad_02_Door_2_1";
1128 case 2:
1129 return "Offroad_02_Door_1_2";
1130 case 3:
1131 return "Offroad_02_Door_2_2";
1132 }
1133
1134 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1135 }
1136
1138 {
1139 switch ( ctrl )
1140 {
1142 float newValue = 0;
1144 {
1145 newValue += 0.25;
1146 }
1147
1149 {
1150 newValue += 0.25;
1151 }
1152
1154 {
1155 newValue += 0.25;
1156 }
1157
1159 {
1160 newValue += 0.25;
1161 }
1162
1164 break;
1165 }
1166
1167 return super.OnSound(ctrl, oldValue);
1168 }
1169
1171 {
1172 switch (selection)
1173 {
1174 case "doors_driver":
1175 return "DoorsDriver";
1176 case "doors_codriver":
1177 return "DoorsCoDriver";
1178 case "doors_cargo1":
1179 return "DoorsCargo1";
1180 case "doors_cargo2":
1181 return "DoorsCargo2";
1182 case "doors_hood":
1183 return "DoorsHood";
1184 case "doors_trunk":
1185 return "DoorsTrunk";
1186 }
1187
1188 return "";
1189 }
1190
1192 {
1193 switch (currentSeat)
1194 {
1195 case 0:
1196 return nextSeat == 1;
1197 case 1:
1198 return nextSeat == 0;
1199 case 2:
1200 return nextSeat == 3;
1201 case 3:
1202 return nextSeat == 2;
1203 }
1204
1205 return false;
1206 }
1207
1209 {
1210 switch (pCurrentSeat)
1211 {
1212 case 0:
1213 return pDoorsSelection == "DoorsDriver";
1214 case 1:
1215 return pDoorsSelection == "DoorsCoDriver";
1216 case 2:
1217 return pDoorsSelection == "DoorsCargo1";
1218 case 3:
1219 return pDoorsSelection == "DoorsCargo2";
1220 }
1221
1222 return false;
1223 }
1224
1226 {
1227 return false;
1228 }
1229
1231 {
1232 return false;
1233 }
1234
1236 {
1238 SpawnAdditionalItems();
1239 FillUpCarFluids();
1240
1246
1253
1254
1257 }
1258}
1259
1260
1262{
1264 {
1266 SpawnAdditionalItems();
1267 FillUpCarFluids();
1268
1269 GetInventory().CreateInInventory("Offroad_02_Wheel");
1270 GetInventory().CreateInInventory("Offroad_02_Wheel");
1271 GetInventory().CreateInInventory("Offroad_02_Wheel");
1272 GetInventory().CreateInInventory("Offroad_02_Wheel");
1273
1274 GetInventory().CreateInInventory("Offroad_02_Door_1_1_Beige");
1275 GetInventory().CreateInInventory("Offroad_02_Door_1_2_Beige");
1276 GetInventory().CreateInInventory("Offroad_02_Door_2_1_Beige");
1277 GetInventory().CreateInInventory("Offroad_02_Door_2_2_Beige");
1278 GetInventory().CreateInInventory("Offroad_02_Trunk_Beige");
1279 GetInventory().CreateInInventory("Offroad_02_Hood_Beige");
1280
1281
1282 GetInventory().CreateInInventory("Offroad_02_Wheel");
1283 GetInventory().CreateInInventory("Offroad_02_Wheel");
1284 }
1285}
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.