741{
745
747 {
748
749
756
757 m_CarDoorOpenSound = "offroad_02_door_open_SoundSet";
758 m_CarDoorCloseSound = "offroad_02_door_close_SoundSet";
759
762
766 });
770 });
771
774
776
778 m_CarHornShortSoundName = "Offroad_02_Horn_Short_SoundSet";
779 m_CarHornLongSoundName = "Offroad_02_Horn_SoundSet";
780 }
781
783 {
787 }
788
790 {
791 super.EEInit();
792
794 {
801
804 }
805 }
806
808 {
809 return true;
810 }
811
813 {
814 return true;
815 }
816
818 {
819 super.GetElectricitySourceDevice();
820
822 }
823
825 {
826 return "CarBattery";
827 }
828
830 {
831 super.OnEngineStart();
832
834 {
837 }
838 }
839
841 {
842 super.OnEngineStop();
843
845 {
848 }
849 }
850
852 {
854 {
856 {
858 }
859 }
860 }
861
863 {
865 }
866
868 {
869 return 5.1;
870 }
871
873 {
874 return 1.5;
875 }
876
878 {
879 switch (posIdx)
880 {
881 case 0:
883 case 1:
885 case 2:
887 case 3:
889 }
890
891 return 0;
892 }
893
895 {
896 if (!super.CanReleaseAttachment(attachment))
897 {
898 return false;
899 }
900
901 string attType = attachment.GetType();
902 switch (attType)
903 {
904 case "CarBattery":
906 {
907 return false;
908 }
909 break;
910
911 case "GlowPlug":
913 {
914 return false;
915 }
916 break;
917 }
918
919 return true;
920 }
921
923 {
925 }
926
928 {
929 if ( !super.CanDisplayAttachmentCategory(category_name))
930 {
931 return false;
932 }
933
935 if (category_name.
Contains(
"engine"))
936 {
938 {
939 return false;
940 }
941 }
942
943 return true;
944 }
945
947 {
948 if ( !super.CanDisplayCargo() )
949 return false;
950
952 return false;
953
954 return true;
955 }
956
958 {
960
961 Class.
CastTo( carDoor, FindAttachmentBySlotName( slotType ) );
962 if (!carDoor)
963 {
965 }
966
967 switch (slotType)
968 {
969 case "Offroad_02_Door_1_1":
970 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
971
972 case "Offroad_02_Door_2_1":
973 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
974
975 case "Offroad_02_Door_1_2":
976 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
977
978 case "Offroad_02_Door_2_2":
979 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
980
981 case "Offroad_02_Hood":
982 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
983
984 case "Offroad_02_Trunk":
985 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
986 }
987
989 }
990
991
993 {
994 switch( posIdx )
995 {
996 case 0:
998 return false;
999
1000 return true;
1001 break;
1002
1003 case 1:
1005 return false;
1006
1007 return true;
1008 break;
1009
1010 case 2:
1012 return false;
1013
1014 return true;
1015 break;
1016
1017 case 3:
1019 return false;
1020
1021 return true;
1022 break;
1023 }
1024
1025 return false;
1026 }
1027
1029 {
1030 switch( posIdx )
1031 {
1032 case 0:
1033 return "doors_driver";
1034 break;
1035 case 1:
1036 return "doors_codriver";
1037 break;
1038 case 2:
1039 return "doors_cargo1";
1040 break;
1041 case 3:
1042 return "doors_cargo2";
1043 break;
1044 }
1045
1046 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1047 }
1048
1050 {
1051 switch (posIdx)
1052 {
1053 case 0:
1054 return "Offroad_02_Door_1_1";
1055 case 1:
1056 return "Offroad_02_Door_2_1";
1057 case 2:
1058 return "Offroad_02_Door_1_2";
1059 case 3:
1060 return "Offroad_02_Door_2_2";
1061 }
1062
1063 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1064 }
1065
1067 {
1068 switch ( ctrl )
1069 {
1071 float newValue = 0;
1073 {
1074 newValue += 0.25;
1075 }
1076
1078 {
1079 newValue += 0.25;
1080 }
1081
1083 {
1084 newValue += 0.25;
1085 }
1086
1088 {
1089 newValue += 0.25;
1090 }
1091
1093 break;
1094 }
1095
1096 return super.OnSound(ctrl, oldValue);
1097 }
1098
1100 {
1101 switch (selection)
1102 {
1103 case "doors_driver":
1104 return "DoorsDriver";
1105 case "doors_codriver":
1106 return "DoorsCoDriver";
1107 case "doors_cargo1":
1108 return "DoorsCargo1";
1109 case "doors_cargo2":
1110 return "DoorsCargo2";
1111 case "doors_hood":
1112 return "DoorsHood";
1113 case "doors_trunk":
1114 return "DoorsTrunk";
1115 }
1116
1117 return "";
1118 }
1119
1121 {
1122 switch (currentSeat)
1123 {
1124 case 0:
1125 return nextSeat == 1;
1126 case 1:
1127 return nextSeat == 0;
1128 case 2:
1129 return nextSeat == 3;
1130 case 3:
1131 return nextSeat == 2;
1132 }
1133
1134 return false;
1135 }
1136
1138 {
1139 switch (pCurrentSeat)
1140 {
1141 case 0:
1142 return pDoorsSelection == "DoorsDriver";
1143 case 1:
1144 return pDoorsSelection == "DoorsCoDriver";
1145 case 2:
1146 return pDoorsSelection == "DoorsCargo1";
1147 case 3:
1148 return pDoorsSelection == "DoorsCargo2";
1149 }
1150
1151 return false;
1152 }
1153
1155 {
1156 return false;
1157 }
1158
1160 {
1161 return false;
1162 }
1163
1165 {
1167 SpawnAdditionalItems();
1168 FillUpCarFluids();
1169
1175
1182
1183
1186 }
1187}
1188
1189
1191{
1193 {
1195 SpawnAdditionalItems();
1196 FillUpCarFluids();
1197
1198 GetInventory().CreateInInventory("Offroad_02_Wheel");
1199 GetInventory().CreateInInventory("Offroad_02_Wheel");
1200 GetInventory().CreateInInventory("Offroad_02_Wheel");
1201 GetInventory().CreateInInventory("Offroad_02_Wheel");
1202
1203 GetInventory().CreateInInventory("Offroad_02_Door_1_1_Beige");
1204 GetInventory().CreateInInventory("Offroad_02_Door_1_2_Beige");
1205 GetInventory().CreateInInventory("Offroad_02_Door_2_1_Beige");
1206 GetInventory().CreateInInventory("Offroad_02_Door_2_2_Beige");
1207 GetInventory().CreateInInventory("Offroad_02_Trunk_Beige");
1208 GetInventory().CreateInInventory("Offroad_02_Hood_Beige");
1209
1210
1211 GetInventory().CreateInInventory("Offroad_02_Wheel");
1212 GetInventory().CreateInInventory("Offroad_02_Wheel");
1213 }
1214}
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.