719{
723
725 {
726
727
734
735 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
736 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
737
740
743
745
747 m_CarHornShortSoundName = "Hatchback_02_Horn_Short_SoundSet";
748 m_CarHornLongSoundName = "Hatchback_02_Horn_SoundSet";
749 }
750
752 {
756 }
757
759 {
760 super.EEInit();
761
763 {
770
773 }
774 }
775
777 {
778 return true;
779 }
780
782 {
783 super.GetElectricitySourceDevice();
784
786 }
787
789 {
790 return "CarBattery";
791 }
792
794 {
795 super.OnEngineStart();
796
798 {
801 }
802 }
803
805 {
806 super.OnEngineStop();
807
809 {
812 }
813 }
814
816 {
818 {
820 {
822 }
823 }
824 }
825
827 {
829 }
830
832 {
833 switch (posIdx)
834 {
835 case 0:
837 case 1:
839 case 2:
841 case 3:
843 }
844
845 return 0;
846 }
847
849 {
850 if (!super.CanReleaseAttachment(attachment))
851 {
852 return false;
853 }
854
856 {
857 string attType = attachment.GetType();
858 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
859 {
860 return false;
861 }
862 }
863
864 return true;
865 }
866
868 {
870 }
871
873 {
874
875 if ( !super.CanDisplayAttachmentCategory( category_name ) )
876 return false;
877
878
880 if ( category_name.
Contains(
"engine") )
881 {
883 return false;
884 }
885
886 return true;
887 }
888
890 {
891 if ( !super.CanDisplayCargo() )
892 return false;
893
895 return false;
896
897 return true;
898 }
899
901 {
903
904 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
905 if (!carDoor)
906 {
908 }
909
910 switch (slotType)
911 {
912 case "Hatchback_02_Door_1_1":
913 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
914
915 case "Hatchback_02_Door_2_1":
916 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
917
918 case "Hatchback_02_Door_1_2":
919 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
920
921 case "Hatchback_02_Door_2_2":
922 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
923
924 case "Hatchback_02_Hood":
925 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
926
927 case "Hatchback_02_Trunk":
928 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
929 }
930
932 }
933
934
936 {
937 switch (posIdx)
938 {
939 case 0:
941 {
942 return false;
943 }
944
945 return true;
946
947 case 1:
949 {
950 return false;
951 }
952
953 return true;
954
955 case 2:
957 {
958 return false;
959 }
960
961 return true;
962
963 case 3:
965 {
966 return false;
967 }
968
969 return true;
970 }
971
972 return false;
973 }
974
976 {
977 switch( posIdx )
978 {
979 case 0:
980 return "doors_driver";
981 break;
982 case 1:
983 return "doors_codriver";
984 break;
985 case 2:
986 return "doors_cargo1";
987 break;
988 case 3:
989 return "doors_cargo2";
990 break;
991 }
992
993 return super.GetDoorSelectionNameFromSeatPos(posIdx);
994 }
995
997 {
998 switch( posIdx )
999 {
1000 case 0:
1001 return "Hatchback_02_Door_1_1";
1002 break;
1003 case 1:
1004 return "Hatchback_02_Door_2_1";
1005 break;
1006 case 2:
1007 return "Hatchback_02_Door_1_2";
1008 break;
1009 case 3:
1010 return "Hatchback_02_Door_2_2";
1011 break;
1012 }
1013
1014 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1015 }
1016
1018 {
1019 switch (ctrl)
1020 {
1022 float newValue = 0;
1024 {
1025 newValue += 0.25;
1026 }
1027
1029 {
1030 newValue += 0.25;
1031 }
1032
1034 {
1035 newValue += 0.25;
1036 }
1037
1039 {
1040 newValue += 0.25;
1041 }
1042
1044 break;
1045 }
1046
1047 return super.OnSound(ctrl, oldValue);
1048 }
1049
1051 {
1052 switch( selection )
1053 {
1054 case "doors_driver":
1055 return "DoorsDriver";
1056 case "doors_codriver":
1057 return "DoorsCoDriver";
1058 case "doors_cargo1":
1059 return "DoorsCargo1";
1060 case "doors_cargo2":
1061 return "DoorsCargo2";
1062 case "doors_hood":
1063 return "DoorsHood";
1064 case "doors_trunk":
1065 return "DoorsTrunk";
1066 }
1067
1068 return "";
1069 }
1070
1072 {
1073 return false;
1074 }
1075
1077 {
1078 switch (currentSeat)
1079 {
1080 case 0:
1081 return nextSeat == 1;
1082 case 1:
1083 return nextSeat == 0;
1084 case 2:
1085 return nextSeat == 3;
1086 case 3:
1087 return nextSeat == 2;
1088 }
1089
1090 return false;
1091 }
1092
1094 {
1095 switch (pCurrentSeat)
1096 {
1097 case 0:
1098 return pDoorsSelection == "DoorsDriver";
1099 case 1:
1100 return pDoorsSelection == "DoorsCoDriver";
1101 case 2:
1102 return pDoorsSelection == "DoorsCargo1";
1103 case 3:
1104 return pDoorsSelection == "DoorsCargo2";
1105 }
1106
1107 return false;
1108 }
1109
1111 {
1113 SpawnAdditionalItems();
1114 FillUpCarFluids();
1115
1121
1128
1129
1132 }
1133}
1134
1136{
1138 {
1140 SpawnAdditionalItems();
1141 FillUpCarFluids();
1142
1143 GameInventory inventory = GetInventory();
1148
1155
1156
1159 }
1160}
1161
1163{
1165 {
1167 SpawnAdditionalItems();
1168 FillUpCarFluids();
1169
1170 GameInventory inventory = GetInventory();
1175
1182
1183
1186 }
1187}
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
Hatchback_02LightProfileFront VehicleLightProfileFront Hatchback_02LightProfileRear()
void Hatchback_02LightProfileFront()
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
void VehicleLightData(VehicleLightProfileBase profile)
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
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 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)
override bool IsVitalGlowPlug()
override bool NeedElectricitySourceDevice()
override string GetElectricitySourceDeviceType()
override string GetDoorSelectionNameFromSeatPos(int posIdx)
override int GetCarDoorsState(string slotType)
Hatchback_02 CarScript OnDebugSpawn()
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.