600{
604
606 {
607
608
615
616 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
617 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
618 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
619 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
620
623
626
628
630 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
631 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
632 }
633
635 {
639 }
640
642 {
643 super.EEInit();
644
646 {
653
656 }
657 }
658
660 {
661 return true;
662 }
663
665 {
666 super.GetElectricitySourceDevice();
667
669 }
670
672 {
673 return "CarBattery";
674 }
675
677 {
678 super.OnEngineStart();
679
681 {
684 }
685 }
686
688 {
689 super.OnEngineStop();
690
692 {
695 }
696 }
697
699 {
701 {
703 {
705 }
706 }
707 }
708
710 {
712 }
713
715 {
716 return 3.5;
717 }
718
720 {
721 switch (posIdx)
722 {
723 case 0:
725 case 1:
727 case 2:
729 case 3:
731 }
732
733 return 0;
734
735 }
736
738 {
739 if (!super.CanReleaseAttachment(attachment))
740 {
741 return false;
742 }
743
745 {
746 string attType = attachment.GetType();
747 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
748 {
749 return false;
750 }
751 }
752
753 return true;
754 }
755
757 {
759 }
760
762 {
763 if (!super.CanDisplayAttachmentCategory(category_name))
764 {
765 return false;
766 }
767
769 if (category_name.
Contains(
"engine"))
770 {
772 {
773 return false;
774 }
775 }
776
777 return true;
778 }
779
781 {
782 if (!super.CanDisplayCargo())
783 {
784 return false;
785 }
786
788 {
789 return false;
790 }
791
792 return true;
793 }
794
796 {
798
799 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
800 if (!carDoor)
801 {
803 }
804
805 switch (slotType)
806 {
807 case "NivaDriverDoors":
808 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
809
810 case "NivaCoDriverDoors":
811 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
812
813 case "NivaHood":
814 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
815
816 case "NivaTrunk":
817 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
818 }
819
821 }
822
824 {
826 switch (posIdx)
827 {
828 case 0:
830 return false;
831 else if (GetAnimationPhase("SeatDriver") > 0.5)
832 return false;
833
834 return true;
835
836 case 1:
838 return false;
839 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
840 return false;
841
842 return true;
843
844 case 2:
846 return false;
847 else if (GetAnimationPhase("SeatDriver") <= 0.5)
848 return false;
849
850 return true;
851
852 case 3:
854 return false;
855 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
856 return false;
857
858 return true;
859 }
860
861 return false;
862 }
863
865 {
866 switch (posIdx)
867 {
868 case 0:
869 case 2:
870 return "doors_driver";
871 case 1:
872 case 3:
873 return "doors_codriver";
874 }
875
876 return super.GetDoorSelectionNameFromSeatPos(posIdx);
877 }
878
880 {
881 switch (posIdx)
882 {
883 case 0:
884 case 2:
885 return "NivaDriverDoors";
886 case 1:
887 case 3:
888 return "NivaCoDriverDoors";
889 }
890
891 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
892 }
893
894
895
897 {
898 float tempCap = 0.0;
899
900 switch (ctrl)
901 {
903 float newValue = 0;
905 {
906 newValue += 0.5;
907 }
908
910 {
911 newValue += 0.5;
912 }
913
915 {
916 newValue += 0.3;
917 }
918
920 {
921 newValue -= 0.6;
922 }
923
925 {
926 newValue -= 0.2;
927 }
928
930 {
931 newValue -= 0.2;
932 }
933
935 break;
936 }
937
938 return super.OnSound(ctrl, oldValue);
939 }
940
942 {
943 switch (selection)
944 {
945 case "doors_driver":
946 return "DoorsDriver";
947 case "doors_codriver":
948 return "DoorsCoDriver";
949 case "doors_hood":
950 return "DoorsHood";
951 case "doors_trunk":
952 return "DoorsTrunk";
953 case "seatback_driver":
954 return "SeatDriver";
955 case "seatback_codriver":
956 return "SeatCoDriver";
957 }
958
959 return "";
960 }
961
963 {
964 switch (selection)
965 {
966 case "seat_driver":
967 case "seatback_driver":
968 case "seat_cargo1":
969 return "seat_con_1_1";
970 case "seat_codriver":
971 case "seatback_codriver":
972 case "seat_cargo2":
973 return "seat_con_2_1";
974 }
975
976 return "";
977 }
978
980 {
981 switch (selection)
982 {
983 case "seatback_driver":
984 return 0;
985 case "seatback_codriver":
986 return 1;
987 }
988
989 return -1;
990 }
991
993 {
994 return false;
995 }
996
998 {
999 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1000 return false;
1001
1002 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1003 return false;
1004
1005 switch (currentSeat)
1006 {
1007 case 0:
1008 return nextSeat == 1;
1009
1010 case 1:
1011 return nextSeat == 0;
1012
1013 case 2:
1014 return nextSeat == 3;
1015
1016 case 3:
1017 return nextSeat == 2;
1018 }
1019
1020 return false;
1021 }
1022
1024 {
1025 switch (pCurrentSeat)
1026 {
1027 case 0:
1028 return pDoorsSelection == "DoorsDriver";
1029
1030 case 1:
1031 return pDoorsSelection == "DoorsCoDriver";
1032
1033 case 2:
1034 return pDoorsSelection == "DoorsDriver";
1035
1036 case 3:
1037 return pDoorsSelection == "DoorsCoDriver";
1038 }
1039
1040 return false;
1041 }
1042
1044 {
1045 switch (pDoorSelection)
1046 {
1047 case "DoorsDriver":
1048 return 0;
1049 case "DoorsCoDriver":
1050 return 1;
1051 }
1052
1053 return -1;
1054 }
1055
1057 {
1058 super.SetActions();
1059
1061 }
1062
1064 {
1066 SpawnAdditionalItems();
1067 FillUpCarFluids();
1068
1074
1079
1080
1083 }
1084}
1085
1087{
1089 {
1091 SpawnAdditionalItems();
1092 FillUpCarFluids();
1093
1094 GameInventory inventory = GetInventory();
1099
1104
1105
1106
1109 }
1110}
1111
1113{
1115 {
1117 SpawnAdditionalItems();
1118 FillUpCarFluids();
1119
1120 GameInventory inventory = GetInventory();
1125
1130
1131
1134 }
1135}
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.