589{
593
595 {
596
597
604
605 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
606 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
607 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
608 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
609
612
615
617
619 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
620 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
621 }
622
624 {
628 }
629
631 {
632 super.EEInit();
633
635 {
642
645 }
646 }
647
649 {
650 return true;
651 }
652
654 {
655 super.GetElectricitySourceDevice();
656
658 }
659
661 {
662 return "CarBattery";
663 }
664
666 {
667 super.OnEngineStart();
668
670 {
673 }
674 }
675
677 {
678 super.OnEngineStop();
679
681 {
684 }
685 }
686
688 {
690 {
692 {
694 }
695 }
696 }
697
699 {
701 }
702
704 {
705 return 3.5;
706 }
707
709 {
710 switch (posIdx)
711 {
712 case 0:
714 case 1:
716 case 2:
718 case 3:
720 }
721
722 return 0;
723
724 }
725
727 {
728 if (!super.CanReleaseAttachment(attachment))
729 {
730 return false;
731 }
732
734 {
735 string attType = attachment.GetType();
736 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
737 {
738 return false;
739 }
740 }
741
742 return true;
743 }
744
746 {
748 }
749
751 {
752 if (!super.CanDisplayAttachmentCategory(category_name))
753 {
754 return false;
755 }
756
758 if (category_name.
Contains(
"engine"))
759 {
761 {
762 return false;
763 }
764 }
765
766 return true;
767 }
768
770 {
771 if (!super.CanDisplayCargo())
772 {
773 return false;
774 }
775
777 {
778 return false;
779 }
780
781 return true;
782 }
783
785 {
787
788 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
789 if (!carDoor)
790 {
792 }
793
794 switch (slotType)
795 {
796 case "NivaDriverDoors":
797 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
798
799 case "NivaCoDriverDoors":
800 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
801
802 case "NivaHood":
803 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
804
805 case "NivaTrunk":
806 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
807 }
808
810 }
811
813 {
815 switch (posIdx)
816 {
817 case 0:
819 return false;
820 else if (GetAnimationPhase("SeatDriver") > 0.5)
821 return false;
822
823 return true;
824
825 case 1:
827 return false;
828 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
829 return false;
830
831 return true;
832
833 case 2:
835 return false;
836 else if (GetAnimationPhase("SeatDriver") <= 0.5)
837 return false;
838
839 return true;
840
841 case 3:
843 return false;
844 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
845 return false;
846
847 return true;
848 }
849
850 return false;
851 }
852
854 {
855 switch (posIdx)
856 {
857 case 0:
858 case 2:
859 return "doors_driver";
860 case 1:
861 case 3:
862 return "doors_codriver";
863 }
864
865 return super.GetDoorSelectionNameFromSeatPos(posIdx);
866 }
867
869 {
870 switch (posIdx)
871 {
872 case 0:
873 case 2:
874 return "NivaDriverDoors";
875 case 1:
876 case 3:
877 return "NivaCoDriverDoors";
878 }
879
880 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
881 }
882
883
884
886 {
887 float tempCap = 0.0;
888
889 switch (ctrl)
890 {
892 float newValue = 0;
894 {
895 newValue += 0.5;
896 }
897
899 {
900 newValue += 0.5;
901 }
902
904 {
905 newValue += 0.3;
906 }
907
909 {
910 newValue -= 0.6;
911 }
912
914 {
915 newValue -= 0.2;
916 }
917
919 {
920 newValue -= 0.2;
921 }
922
924 break;
925 }
926
927 return super.OnSound(ctrl, oldValue);
928 }
929
931 {
932 switch (selection)
933 {
934 case "doors_driver":
935 return "DoorsDriver";
936 case "doors_codriver":
937 return "DoorsCoDriver";
938 case "doors_hood":
939 return "DoorsHood";
940 case "doors_trunk":
941 return "DoorsTrunk";
942 case "seatback_driver":
943 return "SeatDriver";
944 case "seatback_codriver":
945 return "SeatCoDriver";
946 }
947
948 return "";
949 }
950
952 {
953 switch (selection)
954 {
955 case "seat_driver":
956 case "seatback_driver":
957 case "seat_cargo1":
958 return "seat_con_1_1";
959 case "seat_codriver":
960 case "seatback_codriver":
961 case "seat_cargo2":
962 return "seat_con_2_1";
963 }
964
965 return "";
966 }
967
969 {
970 switch (selection)
971 {
972 case "seatback_driver":
973 return 0;
974 case "seatback_codriver":
975 return 1;
976 }
977
978 return -1;
979 }
980
982 {
983 return false;
984 }
985
987 {
988 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
989 return false;
990
991 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
992 return false;
993
994 switch (currentSeat)
995 {
996 case 0:
997 return nextSeat == 1;
998
999 case 1:
1000 return nextSeat == 0;
1001
1002 case 2:
1003 return nextSeat == 3;
1004
1005 case 3:
1006 return nextSeat == 2;
1007 }
1008
1009 return false;
1010 }
1011
1013 {
1014 switch (pCurrentSeat)
1015 {
1016 case 0:
1017 return pDoorsSelection == "DoorsDriver";
1018
1019 case 1:
1020 return pDoorsSelection == "DoorsCoDriver";
1021
1022 case 2:
1023 return pDoorsSelection == "DoorsDriver";
1024
1025 case 3:
1026 return pDoorsSelection == "DoorsCoDriver";
1027 }
1028
1029 return false;
1030 }
1031
1033 {
1034 switch (pDoorSelection)
1035 {
1036 case "DoorsDriver":
1037 return 0;
1038 case "DoorsCoDriver":
1039 return 1;
1040 }
1041
1042 return -1;
1043 }
1044
1046 {
1047 super.SetActions();
1048
1050 }
1051
1053 {
1055 SpawnAdditionalItems();
1056 FillUpCarFluids();
1057
1063
1068
1069
1072 }
1073}
1074
1076{
1078 {
1080 SpawnAdditionalItems();
1081 FillUpCarFluids();
1082
1083 GameInventory inventory = GetInventory();
1088
1093
1094
1095
1098 }
1099}
1100
1102{
1104 {
1106 SpawnAdditionalItems();
1107 FillUpCarFluids();
1108
1109 GameInventory inventory = GetInventory();
1114
1119
1120
1123 }
1124}
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.