610{
614
616 {
617
618
625
626 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
627 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
628 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
629 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
630
633
636
638
640 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
641 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
642 }
643
645 {
649 }
650
652 {
653 super.EEInit();
654
656 {
663
666 }
667 }
668
670 {
671 return true;
672 }
673
675 {
676 super.GetElectricitySourceDevice();
677
679 }
680
682 {
683 return "CarBattery";
684 }
685
687 {
688 super.OnEngineStart();
689
691 {
694 }
695 }
696
698 {
699 super.OnEngineStop();
700
702 {
705 }
706 }
707
709 {
711 {
713 {
715 }
716 }
717 }
718
720 {
722 }
723
725 {
726 return 3.5;
727 }
728
730 {
731 switch (posIdx)
732 {
733 case 0:
735 case 1:
737 case 2:
739 case 3:
741 }
742
743 return 0;
744
745 }
746
748 {
749 if (!super.CanReleaseAttachment(attachment))
750 {
751 return false;
752 }
753
755 {
756 string attType = attachment.GetType();
757 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
758 {
759 return false;
760 }
761 }
762
763 return true;
764 }
765
767 {
769 }
770
772 {
773 if (!super.CanDisplayAttachmentCategory(category_name))
774 {
775 return false;
776 }
777
779 if (category_name.
Contains(
"engine"))
780 {
782 {
783 return false;
784 }
785 }
786
787 return true;
788 }
789
791 {
792 if (!super.CanDisplayCargo())
793 {
794 return false;
795 }
796
798 {
799 return false;
800 }
801
802 return true;
803 }
804
806 {
808
809 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
810 if (!carDoor)
811 {
813 }
814
815 switch (slotType)
816 {
817 case "NivaDriverDoors":
818 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
819
820 case "NivaCoDriverDoors":
821 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
822
823 case "NivaHood":
824 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
825
826 case "NivaTrunk":
827 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
828 }
829
831 }
832
834 {
836 switch (posIdx)
837 {
838 case 0:
840 return false;
841 else if (GetAnimationPhase("SeatDriver") > 0.5)
842 return false;
843
844 return true;
845
846 case 1:
848 return false;
849 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
850 return false;
851
852 return true;
853
854 case 2:
856 return false;
857 else if (GetAnimationPhase("SeatDriver") <= 0.5)
858 return false;
859
860 return true;
861
862 case 3:
864 return false;
865 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
866 return false;
867
868 return true;
869 }
870
871 return false;
872 }
873
875 {
876 switch (posIdx)
877 {
878 case 0:
879 case 2:
880 return "doors_driver";
881 case 1:
882 case 3:
883 return "doors_codriver";
884 }
885
886 return super.GetDoorSelectionNameFromSeatPos(posIdx);
887 }
888
890 {
891 switch (posIdx)
892 {
893 case 0:
894 case 2:
895 return "NivaDriverDoors";
896 case 1:
897 case 3:
898 return "NivaCoDriverDoors";
899 }
900
901 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
902 }
903
904
905
907 {
908 float tempCap = 0.0;
909
910 switch (ctrl)
911 {
913 float newValue = 0;
915 {
916 newValue += 0.5;
917 }
918
920 {
921 newValue += 0.5;
922 }
923
925 {
926 newValue += 0.3;
927 }
928
930 {
931 newValue -= 0.6;
932 }
933
935 {
936 newValue -= 0.2;
937 }
938
940 {
941 newValue -= 0.2;
942 }
943
945 break;
946 }
947
948 return super.OnSound(ctrl, oldValue);
949 }
950
952 {
953 switch (selection)
954 {
955 case "doors_driver":
956 return "DoorsDriver";
957 case "doors_codriver":
958 return "DoorsCoDriver";
959 case "doors_hood":
960 return "DoorsHood";
961 case "doors_trunk":
962 return "DoorsTrunk";
963 case "seatback_driver":
964 return "SeatDriver";
965 case "seatback_codriver":
966 return "SeatCoDriver";
967 }
968
969 return "";
970 }
971
973 {
974 switch (selection)
975 {
976 case "seat_driver":
977 case "seatback_driver":
978 case "seat_cargo1":
979 return "seat_con_1_1";
980 case "seat_codriver":
981 case "seatback_codriver":
982 case "seat_cargo2":
983 return "seat_con_2_1";
984 }
985
986 return "";
987 }
988
990 {
991 switch (selection)
992 {
993 case "seatback_driver":
994 return 0;
995 case "seatback_codriver":
996 return 1;
997 }
998
999 return -1;
1000 }
1001
1003 {
1004 return false;
1005 }
1006
1008 {
1009 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1010 return false;
1011
1012 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1013 return false;
1014
1015 switch (currentSeat)
1016 {
1017 case 0:
1018 return nextSeat == 1;
1019
1020 case 1:
1021 return nextSeat == 0;
1022
1023 case 2:
1024 return nextSeat == 3;
1025
1026 case 3:
1027 return nextSeat == 2;
1028 }
1029
1030 return false;
1031 }
1032
1034 {
1035 switch (pCurrentSeat)
1036 {
1037 case 0:
1038 return pDoorsSelection == "DoorsDriver";
1039
1040 case 1:
1041 return pDoorsSelection == "DoorsCoDriver";
1042
1043 case 2:
1044 return pDoorsSelection == "DoorsDriver";
1045
1046 case 3:
1047 return pDoorsSelection == "DoorsCoDriver";
1048 }
1049
1050 return false;
1051 }
1052
1054 {
1055 switch (pDoorSelection)
1056 {
1057 case "DoorsDriver":
1058 return 0;
1059 case "DoorsCoDriver":
1060 return 1;
1061 }
1062
1063 return -1;
1064 }
1065
1067 {
1068 super.SetActions();
1069
1071 }
1072
1074 {
1076 SpawnAdditionalItems();
1077 FillUpCarFluids();
1078
1084
1089
1090
1093 }
1094}
1095
1097{
1099 {
1101 SpawnAdditionalItems();
1102 FillUpCarFluids();
1103
1104 GameInventory inventory = GetInventory();
1109
1114
1115
1116
1119 }
1120}
1121
1123{
1125 {
1127 SpawnAdditionalItems();
1128 FillUpCarFluids();
1129
1130 GameInventory inventory = GetInventory();
1135
1140
1141
1144 }
1145}
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.