790{
794
796 {
797
798
804
809
812
813 SetEnginePos("0 0.7 1.2");
814 }
815
817 {
818 super.EEInit();
819
821 {
828
831 }
832 }
833
835 {
836 super.OnEngineStart();
837
839 {
841 }
842 }
843
845 {
846 super.OnEngineStop();
847
849 {
851 }
852 }
853
855 {
857 {
859 {
861 }
862 }
863 }
864
866 {
868 }
869
871 {
872 return 3.5;
873 }
874
876 {
877 switch (posIdx)
878 {
879 case 0:
881 case 1:
883 case 2:
885 case 3:
887 }
888
889 return 0;
890
891 }
892
893
895 {
897 }
898
900 {
902 }
903
905 {
906 if (!super.CanReleaseAttachment(attachment))
907 {
908 return false;
909 }
910
912 {
913 string attType = attachment.GetType();
914 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
915 {
916 return false;
917 }
918 }
919
920 return true;
921 }
922
924 {
926 }
927
929 {
930 if (!super.CanDisplayAttachmentCategory(category_name))
931 {
932 return false;
933 }
934
936 if (category_name.
Contains(
"engine"))
937 {
939 {
940 return false;
941 }
942 }
943
944 return true;
945 }
946
948 {
949 if (!super.CanDisplayCargo())
950 {
951 return false;
952 }
953
955 {
956 return false;
957 }
958
959 return true;
960 }
961
963 {
965
966 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
967 if (!carDoor)
968 {
970 }
971
972 switch (slotType)
973 {
974 case "NivaDriverDoors":
976
977 case "NivaCoDriverDoors":
979
980 case "NivaHood":
982
983 case "NivaTrunk":
985 }
986
988 }
989
991 {
993 switch (posIdx)
994 {
995 case 0:
997 return false;
998 else if (GetAnimationPhase("SeatDriver") > 0.5)
999 return false;
1000
1001 return true;
1002
1003 case 1:
1005 return false;
1006 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1007 return false;
1008
1009 return true;
1010
1011 case 2:
1013 return false;
1014 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1015 return false;
1016
1017 return true;
1018
1019 case 3:
1021 return false;
1022 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1023 return false;
1024
1025 return true;
1026 }
1027
1028 return false;
1029 }
1030
1032 {
1033 switch (posIdx)
1034 {
1035 case 0:
1036 case 2:
1037 return "doors_driver";
1038 case 1:
1039 case 3:
1040 return "doors_codriver";
1041 }
1042
1043 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1044 }
1045
1047 {
1048 switch (posIdx)
1049 {
1050 case 0:
1051 case 2:
1052 return "NivaDriverDoors";
1053 case 1:
1054 case 3:
1055 return "NivaCoDriverDoors";
1056 }
1057
1058 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1059 }
1060
1061
1062
1064 {
1065 float tempCap = 0.0;
1066
1067 switch (ctrl)
1068 {
1070 float newValue = 0;
1072 {
1073 newValue += 0.5;
1074 }
1075
1077 {
1078 newValue += 0.5;
1079 }
1080
1082 {
1083 newValue += 0.3;
1084 }
1085
1087 {
1088 newValue -= 0.6;
1089 }
1090
1092 {
1093 newValue -= 0.2;
1094 }
1095
1097 {
1098 newValue -= 0.2;
1099 }
1100
1102 break;
1103 }
1104
1105 return super.OnSound(ctrl, oldValue);
1106 }
1107
1109 {
1110 switch (selection)
1111 {
1112 case "doors_driver":
1113 return "DoorsDriver";
1114 case "doors_codriver":
1115 return "DoorsCoDriver";
1116 case "doors_hood":
1117 return "DoorsHood";
1118 case "doors_trunk":
1119 return "DoorsTrunk";
1120 case "seatback_driver":
1121 return "SeatDriver";
1122 case "seatback_codriver":
1123 return "SeatCoDriver";
1124 }
1125
1126 return "";
1127 }
1128
1130 {
1131 switch (selection)
1132 {
1133 case "seat_driver":
1134 case "seatback_driver":
1135 case "seat_cargo1":
1136 return "seat_con_1_1";
1137 case "seat_codriver":
1138 case "seatback_codriver":
1139 case "seat_cargo2":
1140 return "seat_con_2_1";
1141 }
1142
1143 return "";
1144 }
1145
1147 {
1148 switch (selection)
1149 {
1150 case "seatback_driver":
1151 return 0;
1152 case "seatback_codriver":
1153 return 1;
1154 }
1155
1156 return -1;
1157 }
1158
1160 {
1161 return false;
1162 }
1163
1165 {
1166 return false;
1167 }
1168
1170 {
1171 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1172 return false;
1173
1174 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1175 return false;
1176
1177 switch (currentSeat)
1178 {
1179 case 0:
1180 return nextSeat == 1;
1181
1182 case 1:
1183 return nextSeat == 0;
1184
1185 case 2:
1186 return nextSeat == 3;
1187
1188 case 3:
1189 return nextSeat == 2;
1190 }
1191
1192 return false;
1193 }
1194
1196 {
1197 switch (pCurrentSeat)
1198 {
1199 case 0:
1200 return pDoorsSelection == "DoorsDriver";
1201
1202 case 1:
1203 return pDoorsSelection == "DoorsCoDriver";
1204
1205 case 2:
1206 return pDoorsSelection == "DoorsDriver";
1207
1208 case 3:
1209 return pDoorsSelection == "DoorsCoDriver";
1210 }
1211
1212 return false;
1213 }
1214
1216 {
1217 switch (pDoorSelection)
1218 {
1219 case "DoorsDriver":
1220 return 0;
1221 case "DoorsCoDriver":
1222 return 1;
1223 }
1224
1225 return -1;
1226 }
1227
1229 {
1230 super.SetActions();
1231
1233 }
1234
1236 {
1240
1241 GetInventory().CreateInInventory("HatchbackWheel");
1242 GetInventory().CreateInInventory("HatchbackWheel");
1243 GetInventory().CreateInInventory("HatchbackWheel" );
1244 GetInventory().CreateInInventory("HatchbackWheel");
1245
1246 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1247 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1248 GetInventory().CreateInInventory("HatchbackHood");
1249 GetInventory().CreateInInventory("HatchbackTrunk");
1250
1251
1252 GetInventory().CreateInInventory("HatchbackWheel");
1253 GetInventory().CreateInInventory("HatchbackWheel");
1254 }
1255}
1256
1258{
1260 {
1264
1265 GetInventory().CreateInInventory("HatchbackWheel");
1266 GetInventory().CreateInInventory("HatchbackWheel");
1267 GetInventory().CreateInInventory("HatchbackWheel");
1268 GetInventory().CreateInInventory("HatchbackWheel");
1269
1270 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1271 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1272 GetInventory().CreateInInventory("HatchbackHood_White");
1273 GetInventory().CreateInInventory("HatchbackTrunk_White");
1274
1275
1276 GetInventory().CreateInInventory("HatchbackWheel");
1277 GetInventory().CreateInInventory("HatchbackWheel");
1278 }
1279}
1280
1282{
1284 {
1288
1289 GetInventory().CreateInInventory("HatchbackWheel");
1290 GetInventory().CreateInInventory("HatchbackWheel");
1291 GetInventory().CreateInInventory("HatchbackWheel");
1292 GetInventory().CreateInInventory("HatchbackWheel");
1293
1294 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1295 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1296 GetInventory().CreateInInventory("HatchbackHood_Blue");
1297 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1298
1299
1300 GetInventory().CreateInInventory("HatchbackWheel");
1301 GetInventory().CreateInInventory("HatchbackWheel");
1302 }
1303}
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.