605{
609
611 {
612
613
620
621 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
622 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
623 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
624 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
625
628
631
633
635 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
636 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
637 }
638
640 {
644 }
645
647 {
648 super.EEInit();
649
651 {
658
661 }
662 }
663
665 {
666 return true;
667 }
668
670 {
671 super.GetElectricitySourceDevice();
672
674 }
675
677 {
678 return "CarBattery";
679 }
680
682 {
683 super.OnEngineStart();
684
686 {
689 }
690 }
691
693 {
694 super.OnEngineStop();
695
697 {
700 }
701 }
702
704 {
706 {
708 {
710 }
711 }
712 }
713
715 {
717 }
718
720 {
721 return 3.5;
722 }
723
725 {
726 switch (posIdx)
727 {
728 case 0:
730 case 1:
732 case 2:
734 case 3:
736 }
737
738 return 0;
739
740 }
741
743 {
744 if (!super.CanReleaseAttachment(attachment))
745 {
746 return false;
747 }
748
750 {
751 string attType = attachment.GetType();
752 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
753 {
754 return false;
755 }
756 }
757
758 return true;
759 }
760
762 {
764 }
765
767 {
768 if (!super.CanDisplayAttachmentCategory(category_name))
769 {
770 return false;
771 }
772
774 if (category_name.
Contains(
"engine"))
775 {
777 {
778 return false;
779 }
780 }
781
782 return true;
783 }
784
786 {
787 if (!super.CanDisplayCargo())
788 {
789 return false;
790 }
791
793 {
794 return false;
795 }
796
797 return true;
798 }
799
801 {
803
804 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
805 if (!carDoor)
806 {
808 }
809
810 switch (slotType)
811 {
812 case "NivaDriverDoors":
813 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
814
815 case "NivaCoDriverDoors":
816 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
817
818 case "NivaHood":
819 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
820
821 case "NivaTrunk":
822 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
823 }
824
826 }
827
829 {
831 switch (posIdx)
832 {
833 case 0:
835 return false;
836 else if (GetAnimationPhase("SeatDriver") > 0.5)
837 return false;
838
839 return true;
840
841 case 1:
843 return false;
844 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
845 return false;
846
847 return true;
848
849 case 2:
851 return false;
852 else if (GetAnimationPhase("SeatDriver") <= 0.5)
853 return false;
854
855 return true;
856
857 case 3:
859 return false;
860 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
861 return false;
862
863 return true;
864 }
865
866 return false;
867 }
868
870 {
871 switch (posIdx)
872 {
873 case 0:
874 case 2:
875 return "doors_driver";
876 case 1:
877 case 3:
878 return "doors_codriver";
879 }
880
881 return super.GetDoorSelectionNameFromSeatPos(posIdx);
882 }
883
885 {
886 switch (posIdx)
887 {
888 case 0:
889 case 2:
890 return "NivaDriverDoors";
891 case 1:
892 case 3:
893 return "NivaCoDriverDoors";
894 }
895
896 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
897 }
898
899
900
902 {
903 float tempCap = 0.0;
904
905 switch (ctrl)
906 {
908 float newValue = 0;
910 {
911 newValue += 0.5;
912 }
913
915 {
916 newValue += 0.5;
917 }
918
920 {
921 newValue += 0.3;
922 }
923
925 {
926 newValue -= 0.6;
927 }
928
930 {
931 newValue -= 0.2;
932 }
933
935 {
936 newValue -= 0.2;
937 }
938
940 break;
941 }
942
943 return super.OnSound(ctrl, oldValue);
944 }
945
947 {
948 switch (selection)
949 {
950 case "doors_driver":
951 return "DoorsDriver";
952 case "doors_codriver":
953 return "DoorsCoDriver";
954 case "doors_hood":
955 return "DoorsHood";
956 case "doors_trunk":
957 return "DoorsTrunk";
958 case "seatback_driver":
959 return "SeatDriver";
960 case "seatback_codriver":
961 return "SeatCoDriver";
962 }
963
964 return "";
965 }
966
968 {
969 switch (selection)
970 {
971 case "seat_driver":
972 case "seatback_driver":
973 case "seat_cargo1":
974 return "seat_con_1_1";
975 case "seat_codriver":
976 case "seatback_codriver":
977 case "seat_cargo2":
978 return "seat_con_2_1";
979 }
980
981 return "";
982 }
983
985 {
986 switch (selection)
987 {
988 case "seatback_driver":
989 return 0;
990 case "seatback_codriver":
991 return 1;
992 }
993
994 return -1;
995 }
996
998 {
999 return false;
1000 }
1001
1003 {
1004 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1005 return false;
1006
1007 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1008 return false;
1009
1010 switch (currentSeat)
1011 {
1012 case 0:
1013 return nextSeat == 1;
1014
1015 case 1:
1016 return nextSeat == 0;
1017
1018 case 2:
1019 return nextSeat == 3;
1020
1021 case 3:
1022 return nextSeat == 2;
1023 }
1024
1025 return false;
1026 }
1027
1029 {
1030 switch (pCurrentSeat)
1031 {
1032 case 0:
1033 return pDoorsSelection == "DoorsDriver";
1034
1035 case 1:
1036 return pDoorsSelection == "DoorsCoDriver";
1037
1038 case 2:
1039 return pDoorsSelection == "DoorsDriver";
1040
1041 case 3:
1042 return pDoorsSelection == "DoorsCoDriver";
1043 }
1044
1045 return false;
1046 }
1047
1049 {
1050 switch (pDoorSelection)
1051 {
1052 case "DoorsDriver":
1053 return 0;
1054 case "DoorsCoDriver":
1055 return 1;
1056 }
1057
1058 return -1;
1059 }
1060
1062 {
1063 super.SetActions();
1064
1066 }
1067
1069 {
1071 SpawnAdditionalItems();
1072 FillUpCarFluids();
1073
1079
1084
1085
1088 }
1089}
1090
1092{
1094 {
1096 SpawnAdditionalItems();
1097 FillUpCarFluids();
1098
1099 GameInventory inventory = GetInventory();
1104
1109
1110
1111
1114 }
1115}
1116
1118{
1120 {
1122 SpawnAdditionalItems();
1123 FillUpCarFluids();
1124
1125 GameInventory inventory = GetInventory();
1130
1135
1136
1139 }
1140}
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.