770{
774
776 {
777
778
785
786 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
787 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
788 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
789 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
790
793
796
798
800 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
801 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
802 }
803
805 {
809 }
810
812 {
813 super.EEInit();
814
816 {
823
826 }
827 }
828
830 {
831 return true;
832 }
833
835 {
836 super.GetElectricitySourceDevice();
837
839 }
840
842 {
843 return "CarBattery";
844 }
845
847 {
848 super.OnEngineStart();
849
851 {
854 }
855 }
856
858 {
859 super.OnEngineStop();
860
862 {
865 }
866 }
867
869 {
871 {
873 {
875 }
876 }
877 }
878
880 {
882 }
883
885 {
886 return 3.5;
887 }
888
890 {
891 switch (posIdx)
892 {
893 case 0:
895 case 1:
897 case 2:
899 case 3:
901 }
902
903 return 0;
904
905 }
906
908 {
909 if (!super.CanReleaseAttachment(attachment))
910 {
911 return false;
912 }
913
915 {
916 string attType = attachment.GetType();
917 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
918 {
919 return false;
920 }
921 }
922
923 return true;
924 }
925
927 {
929 }
930
932 {
933 if (!super.CanDisplayAttachmentCategory(category_name))
934 {
935 return false;
936 }
937
939 if (category_name.
Contains(
"engine"))
940 {
942 {
943 return false;
944 }
945 }
946
947 return true;
948 }
949
951 {
952 if (!super.CanDisplayCargo())
953 {
954 return false;
955 }
956
958 {
959 return false;
960 }
961
962 return true;
963 }
964
966 {
968
969 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
970 if (!carDoor)
971 {
973 }
974
975 switch (slotType)
976 {
977 case "NivaDriverDoors":
978 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
979
980 case "NivaCoDriverDoors":
981 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
982
983 case "NivaHood":
984 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
985
986 case "NivaTrunk":
987 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
988 }
989
991 }
992
994 {
996 switch (posIdx)
997 {
998 case 0:
1000 return false;
1001 else if (GetAnimationPhase("SeatDriver") > 0.5)
1002 return false;
1003
1004 return true;
1005
1006 case 1:
1008 return false;
1009 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1010 return false;
1011
1012 return true;
1013
1014 case 2:
1016 return false;
1017 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1018 return false;
1019
1020 return true;
1021
1022 case 3:
1024 return false;
1025 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1026 return false;
1027
1028 return true;
1029 }
1030
1031 return false;
1032 }
1033
1035 {
1036 switch (posIdx)
1037 {
1038 case 0:
1039 case 2:
1040 return "doors_driver";
1041 case 1:
1042 case 3:
1043 return "doors_codriver";
1044 }
1045
1046 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1047 }
1048
1050 {
1051 switch (posIdx)
1052 {
1053 case 0:
1054 case 2:
1055 return "NivaDriverDoors";
1056 case 1:
1057 case 3:
1058 return "NivaCoDriverDoors";
1059 }
1060
1061 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1062 }
1063
1064
1065
1067 {
1068 float tempCap = 0.0;
1069
1070 switch (ctrl)
1071 {
1073 float newValue = 0;
1075 {
1076 newValue += 0.5;
1077 }
1078
1080 {
1081 newValue += 0.5;
1082 }
1083
1085 {
1086 newValue += 0.3;
1087 }
1088
1090 {
1091 newValue -= 0.6;
1092 }
1093
1095 {
1096 newValue -= 0.2;
1097 }
1098
1100 {
1101 newValue -= 0.2;
1102 }
1103
1105 break;
1106 }
1107
1108 return super.OnSound(ctrl, oldValue);
1109 }
1110
1112 {
1113 switch (selection)
1114 {
1115 case "doors_driver":
1116 return "DoorsDriver";
1117 case "doors_codriver":
1118 return "DoorsCoDriver";
1119 case "doors_hood":
1120 return "DoorsHood";
1121 case "doors_trunk":
1122 return "DoorsTrunk";
1123 case "seatback_driver":
1124 return "SeatDriver";
1125 case "seatback_codriver":
1126 return "SeatCoDriver";
1127 }
1128
1129 return "";
1130 }
1131
1133 {
1134 switch (selection)
1135 {
1136 case "seat_driver":
1137 case "seatback_driver":
1138 case "seat_cargo1":
1139 return "seat_con_1_1";
1140 case "seat_codriver":
1141 case "seatback_codriver":
1142 case "seat_cargo2":
1143 return "seat_con_2_1";
1144 }
1145
1146 return "";
1147 }
1148
1150 {
1151 switch (selection)
1152 {
1153 case "seatback_driver":
1154 return 0;
1155 case "seatback_codriver":
1156 return 1;
1157 }
1158
1159 return -1;
1160 }
1161
1163 {
1164 return false;
1165 }
1166
1168 {
1169 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1170 return false;
1171
1172 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1173 return false;
1174
1175 switch (currentSeat)
1176 {
1177 case 0:
1178 return nextSeat == 1;
1179
1180 case 1:
1181 return nextSeat == 0;
1182
1183 case 2:
1184 return nextSeat == 3;
1185
1186 case 3:
1187 return nextSeat == 2;
1188 }
1189
1190 return false;
1191 }
1192
1194 {
1195 switch (pCurrentSeat)
1196 {
1197 case 0:
1198 return pDoorsSelection == "DoorsDriver";
1199
1200 case 1:
1201 return pDoorsSelection == "DoorsCoDriver";
1202
1203 case 2:
1204 return pDoorsSelection == "DoorsDriver";
1205
1206 case 3:
1207 return pDoorsSelection == "DoorsCoDriver";
1208 }
1209
1210 return false;
1211 }
1212
1214 {
1215 switch (pDoorSelection)
1216 {
1217 case "DoorsDriver":
1218 return 0;
1219 case "DoorsCoDriver":
1220 return 1;
1221 }
1222
1223 return -1;
1224 }
1225
1227 {
1228 super.SetActions();
1229
1231 }
1232
1234 {
1236 SpawnAdditionalItems();
1237 FillUpCarFluids();
1238
1244
1249
1250
1253 }
1254}
1255
1257{
1259 {
1261 SpawnAdditionalItems();
1262 FillUpCarFluids();
1263
1264 GameInventory inventory = GetInventory();
1269
1274
1275
1276
1279 }
1280}
1281
1283{
1285 {
1287 SpawnAdditionalItems();
1288 FillUpCarFluids();
1289
1290 GameInventory inventory = GetInventory();
1295
1300
1301
1304 }
1305}
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.