745{
749
751 {
752
753
759
764
767
768 SetEnginePos("0 0.7 1.2");
769 }
770
772 {
773 super.EEInit();
774
776 {
783
786 }
787 }
788
790 {
791 super.OnEngineStart();
792
794 {
796 }
797 }
798
800 {
801 super.OnEngineStop();
802
804 {
806 }
807 }
808
810 {
812 {
814 {
816 }
817 }
818 }
819
821 {
823 }
824
826 {
827 return 3.5;
828 }
829
831 {
832 switch (posIdx)
833 {
834 case 0:
836 case 1:
838 case 2:
840 case 3:
842 }
843
844 return 0;
845
846 }
847
848
850 {
852 }
853
855 {
857 }
858
860 {
861 if (!super.CanReleaseAttachment(attachment))
862 {
863 return false;
864 }
865
867 {
868 string attType = attachment.GetType();
869 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
870 {
871 return false;
872 }
873 }
874
875 return true;
876 }
877
879 {
881 }
882
884 {
885 if (!super.CanDisplayAttachmentCategory(category_name))
886 {
887 return false;
888 }
889
891 if (category_name.
Contains(
"engine"))
892 {
894 {
895 return false;
896 }
897 }
898
899 return true;
900 }
901
903 {
904 if (!super.CanDisplayCargo())
905 {
906 return false;
907 }
908
910 {
911 return false;
912 }
913
914 return true;
915 }
916
918 {
920
921 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
922 if (!carDoor)
923 {
925 }
926
927 switch (slotType)
928 {
929 case "NivaDriverDoors":
931
932 case "NivaCoDriverDoors":
934
935 case "NivaHood":
937
938 case "NivaTrunk":
940 }
941
943 }
944
946 {
948 switch (posIdx)
949 {
950 case 0:
952 return false;
953 else if (GetAnimationPhase("SeatDriver") > 0.5)
954 return false;
955
956 return true;
957
958 case 1:
960 return false;
961 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
962 return false;
963
964 return true;
965
966 case 2:
968 return false;
969 else if (GetAnimationPhase("SeatDriver") <= 0.5)
970 return false;
971
972 return true;
973
974 case 3:
976 return false;
977 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
978 return false;
979
980 return true;
981 }
982
983 return false;
984 }
985
987 {
988 switch (posIdx)
989 {
990 case 0:
991 case 2:
992 return "doors_driver";
993 case 1:
994 case 3:
995 return "doors_codriver";
996 }
997
998 return super.GetDoorSelectionNameFromSeatPos(posIdx);
999 }
1000
1002 {
1003 switch (posIdx)
1004 {
1005 case 0:
1006 case 2:
1007 return "NivaDriverDoors";
1008 case 1:
1009 case 3:
1010 return "NivaCoDriverDoors";
1011 }
1012
1013 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1014 }
1015
1016
1017
1019 {
1020 float tempCap = 0.0;
1021
1022 switch (ctrl)
1023 {
1025 float newValue = 0;
1027 {
1028 newValue += 0.5;
1029 }
1030
1032 {
1033 newValue += 0.5;
1034 }
1035
1037 {
1038 newValue += 0.3;
1039 }
1040
1042 {
1043 newValue -= 0.6;
1044 }
1045
1047 {
1048 newValue -= 0.2;
1049 }
1050
1052 {
1053 newValue -= 0.2;
1054 }
1055
1057 break;
1058 }
1059
1060 return super.OnSound(ctrl, oldValue);
1061 }
1062
1064 {
1065 switch (selection)
1066 {
1067 case "doors_driver":
1068 return "DoorsDriver";
1069 case "doors_codriver":
1070 return "DoorsCoDriver";
1071 case "doors_hood":
1072 return "DoorsHood";
1073 case "doors_trunk":
1074 return "DoorsTrunk";
1075 case "seatback_driver":
1076 return "SeatDriver";
1077 case "seatback_codriver":
1078 return "SeatCoDriver";
1079 }
1080
1081 return "";
1082 }
1083
1085 {
1086 switch (selection)
1087 {
1088 case "seat_driver":
1089 case "seatback_driver":
1090 case "seat_cargo1":
1091 return "seat_con_1_1";
1092 case "seat_codriver":
1093 case "seatback_codriver":
1094 case "seat_cargo2":
1095 return "seat_con_2_1";
1096 }
1097
1098 return "";
1099 }
1100
1102 {
1103 switch (selection)
1104 {
1105 case "seatback_driver":
1106 return 0;
1107 case "seatback_codriver":
1108 return 1;
1109 }
1110
1111 return -1;
1112 }
1113
1115 {
1116 return false;
1117 }
1118
1120 {
1121 return false;
1122 }
1123
1125 {
1126 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1127 return false;
1128
1129 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1130 return false;
1131
1132 switch (currentSeat)
1133 {
1134 case 0:
1135 return nextSeat == 1;
1136
1137 case 1:
1138 return nextSeat == 0;
1139
1140 case 2:
1141 return nextSeat == 3;
1142
1143 case 3:
1144 return nextSeat == 2;
1145 }
1146
1147 return false;
1148 }
1149
1151 {
1152 switch (pCurrentSeat)
1153 {
1154 case 0:
1155 return pDoorsSelection == "DoorsDriver";
1156
1157 case 1:
1158 return pDoorsSelection == "DoorsCoDriver";
1159
1160 case 2:
1161 return pDoorsSelection == "DoorsDriver";
1162
1163 case 3:
1164 return pDoorsSelection == "DoorsCoDriver";
1165 }
1166
1167 return false;
1168 }
1169
1171 {
1172 switch (pDoorSelection)
1173 {
1174 case "DoorsDriver":
1175 return 0;
1176 case "DoorsCoDriver":
1177 return 1;
1178 }
1179
1180 return -1;
1181 }
1182
1184 {
1185 super.SetActions();
1186
1188 }
1189
1191 {
1195
1196 GetInventory().CreateInInventory("HatchbackWheel");
1197 GetInventory().CreateInInventory("HatchbackWheel");
1198 GetInventory().CreateInInventory("HatchbackWheel" );
1199 GetInventory().CreateInInventory("HatchbackWheel");
1200
1201 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1202 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1203 GetInventory().CreateInInventory("HatchbackHood");
1204 GetInventory().CreateInInventory("HatchbackTrunk");
1205
1206
1207 GetInventory().CreateInInventory("HatchbackWheel");
1208 GetInventory().CreateInInventory("HatchbackWheel");
1209 }
1210}
1211
1213{
1215 {
1219
1220 GetInventory().CreateInInventory("HatchbackWheel");
1221 GetInventory().CreateInInventory("HatchbackWheel");
1222 GetInventory().CreateInInventory("HatchbackWheel");
1223 GetInventory().CreateInInventory("HatchbackWheel");
1224
1225 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1226 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1227 GetInventory().CreateInInventory("HatchbackHood_White");
1228 GetInventory().CreateInInventory("HatchbackTrunk_White");
1229
1230
1231 GetInventory().CreateInInventory("HatchbackWheel");
1232 GetInventory().CreateInInventory("HatchbackWheel");
1233 }
1234}
1235
1237{
1239 {
1243
1244 GetInventory().CreateInInventory("HatchbackWheel");
1245 GetInventory().CreateInInventory("HatchbackWheel");
1246 GetInventory().CreateInInventory("HatchbackWheel");
1247 GetInventory().CreateInInventory("HatchbackWheel");
1248
1249 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1250 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1251 GetInventory().CreateInInventory("HatchbackHood_Blue");
1252 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1253
1254
1255 GetInventory().CreateInInventory("HatchbackWheel");
1256 GetInventory().CreateInInventory("HatchbackWheel");
1257 }
1258}
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.