670{
674
676 {
677
678
685
686 m_CarDoorOpenSound = "offroad_02_door_open_SoundSet";
687 m_CarDoorCloseSound = "offroad_02_door_close_SoundSet";
688
691
695 });
699 });
700
703
705
707 m_CarHornShortSoundName = "Offroad_02_Horn_Short_SoundSet";
708 m_CarHornLongSoundName = "Offroad_02_Horn_SoundSet";
709 }
710
712 {
716 }
717
719 {
720 super.EEInit();
721
723 {
730
733 }
734 }
735
737 {
738 return true;
739 }
740
742 {
743 return true;
744 }
745
747 {
748 super.GetElectricitySourceDevice();
749
751 }
752
754 {
755 return "CarBattery";
756 }
757
759 {
760 super.OnEngineStart();
761
763 {
766 }
767 }
768
770 {
771 super.OnEngineStop();
772
774 {
777 }
778 }
779
781 {
783 {
785 {
787 }
788 }
789 }
790
792 {
794 }
795
797 {
798 return 5.1;
799 }
800
802 {
803 return 1.5;
804 }
805
807 {
808 switch (posIdx)
809 {
810 case 0:
812 case 1:
814 case 2:
816 case 3:
818 }
819
820 return 0;
821 }
822
824 {
825 if (!super.CanReleaseAttachment(attachment))
826 {
827 return false;
828 }
829
830 string attType = attachment.GetType();
831 switch (attType)
832 {
833 case "CarBattery":
835 {
836 return false;
837 }
838 break;
839
840 case "GlowPlug":
842 {
843 return false;
844 }
845 break;
846 }
847
848 return true;
849 }
850
852 {
854 }
855
857 {
858 if ( !super.CanDisplayAttachmentCategory(category_name))
859 {
860 return false;
861 }
862
864 if (category_name.
Contains(
"engine"))
865 {
867 {
868 return false;
869 }
870 }
871
872 return true;
873 }
874
876 {
877 if ( !super.CanDisplayCargo() )
878 return false;
879
881 return false;
882
883 return true;
884 }
885
887 {
889
890 Class.
CastTo( carDoor, FindAttachmentBySlotName( slotType ) );
891 if (!carDoor)
892 {
894 }
895
896 switch (slotType)
897 {
898 case "Offroad_02_Door_1_1":
899 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
900
901 case "Offroad_02_Door_2_1":
902 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
903
904 case "Offroad_02_Door_1_2":
905 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
906
907 case "Offroad_02_Door_2_2":
908 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
909
910 case "Offroad_02_Hood":
911 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
912
913 case "Offroad_02_Trunk":
914 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
915 }
916
918 }
919
920
922 {
923 switch( posIdx )
924 {
925 case 0:
927 return false;
928
929 return true;
930 break;
931
932 case 1:
934 return false;
935
936 return true;
937 break;
938
939 case 2:
941 return false;
942
943 return true;
944 break;
945
946 case 3:
948 return false;
949
950 return true;
951 break;
952 }
953
954 return false;
955 }
956
958 {
959 switch( posIdx )
960 {
961 case 0:
962 return "doors_driver";
963 break;
964 case 1:
965 return "doors_codriver";
966 break;
967 case 2:
968 return "doors_cargo1";
969 break;
970 case 3:
971 return "doors_cargo2";
972 break;
973 }
974
975 return super.GetDoorSelectionNameFromSeatPos(posIdx);
976 }
977
979 {
980 switch (posIdx)
981 {
982 case 0:
983 return "Offroad_02_Door_1_1";
984 case 1:
985 return "Offroad_02_Door_2_1";
986 case 2:
987 return "Offroad_02_Door_1_2";
988 case 3:
989 return "Offroad_02_Door_2_2";
990 }
991
992 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
993 }
994
996 {
997 switch ( ctrl )
998 {
1000 float newValue = 0;
1002 {
1003 newValue += 0.25;
1004 }
1005
1007 {
1008 newValue += 0.25;
1009 }
1010
1012 {
1013 newValue += 0.25;
1014 }
1015
1017 {
1018 newValue += 0.25;
1019 }
1020
1022 break;
1023 }
1024
1025 return super.OnSound(ctrl, oldValue);
1026 }
1027
1029 {
1030 switch (selection)
1031 {
1032 case "doors_driver":
1033 return "DoorsDriver";
1034 case "doors_codriver":
1035 return "DoorsCoDriver";
1036 case "doors_cargo1":
1037 return "DoorsCargo1";
1038 case "doors_cargo2":
1039 return "DoorsCargo2";
1040 case "doors_hood":
1041 return "DoorsHood";
1042 case "doors_trunk":
1043 return "DoorsTrunk";
1044 }
1045
1046 return "";
1047 }
1048
1050 {
1051 switch (currentSeat)
1052 {
1053 case 0:
1054 return nextSeat == 1;
1055 case 1:
1056 return nextSeat == 0;
1057 case 2:
1058 return nextSeat == 3;
1059 case 3:
1060 return nextSeat == 2;
1061 }
1062
1063 return false;
1064 }
1065
1067 {
1068 switch (pCurrentSeat)
1069 {
1070 case 0:
1071 return pDoorsSelection == "DoorsDriver";
1072 case 1:
1073 return pDoorsSelection == "DoorsCoDriver";
1074 case 2:
1075 return pDoorsSelection == "DoorsCargo1";
1076 case 3:
1077 return pDoorsSelection == "DoorsCargo2";
1078 }
1079
1080 return false;
1081 }
1082
1084 {
1085 return false;
1086 }
1087
1089 {
1090 return false;
1091 }
1092
1094 {
1096 SpawnAdditionalItems();
1097 FillUpCarFluids();
1098
1104
1111
1112
1115 }
1116}
1117
1118
1120{
1122 {
1124 SpawnAdditionalItems();
1125 FillUpCarFluids();
1126
1127 GetInventory().CreateInInventory("Offroad_02_Wheel");
1128 GetInventory().CreateInInventory("Offroad_02_Wheel");
1129 GetInventory().CreateInInventory("Offroad_02_Wheel");
1130 GetInventory().CreateInInventory("Offroad_02_Wheel");
1131
1132 GetInventory().CreateInInventory("Offroad_02_Door_1_1_Beige");
1133 GetInventory().CreateInInventory("Offroad_02_Door_1_2_Beige");
1134 GetInventory().CreateInInventory("Offroad_02_Door_2_1_Beige");
1135 GetInventory().CreateInInventory("Offroad_02_Door_2_2_Beige");
1136 GetInventory().CreateInInventory("Offroad_02_Trunk_Beige");
1137 GetInventory().CreateInInventory("Offroad_02_Hood_Beige");
1138
1139
1140 GetInventory().CreateInInventory("Offroad_02_Wheel");
1141 GetInventory().CreateInInventory("Offroad_02_Wheel");
1142 }
1143}
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.