562{
566
568 {
569
570
577
578 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
579 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
580 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
581 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
582
585
588
590
592 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
593 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
594 }
595
597 {
601 }
602
604 {
605 super.EEInit();
606
608 {
615
618 }
619 }
620
622 {
623 return true;
624 }
625
627 {
628 super.GetElectricitySourceDevice();
629
631 }
632
634 {
635 return "CarBattery";
636 }
637
639 {
640 super.OnEngineStart();
641
643 {
646 }
647 }
648
650 {
651 super.OnEngineStop();
652
654 {
657 }
658 }
659
661 {
663 {
665 {
667 }
668 }
669 }
670
672 {
674 }
675
677 {
678 return 3.5;
679 }
680
682 {
683 switch (posIdx)
684 {
685 case 0:
687 case 1:
689 case 2:
691 case 3:
693 }
694
695 return 0;
696
697 }
698
700 {
701 if (!super.CanReleaseAttachment(attachment))
702 {
703 return false;
704 }
705
707 {
708 string attType = attachment.GetType();
709 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
710 {
711 return false;
712 }
713 }
714
715 return true;
716 }
717
719 {
721 }
722
724 {
725 if (!super.CanDisplayAttachmentCategory(category_name))
726 {
727 return false;
728 }
729
731 if (category_name.
Contains(
"engine"))
732 {
734 {
735 return false;
736 }
737 }
738
739 return true;
740 }
741
743 {
744 if (!super.CanDisplayCargo())
745 {
746 return false;
747 }
748
750 {
751 return false;
752 }
753
754 return true;
755 }
756
758 {
760
761 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
762 if (!carDoor)
763 {
765 }
766
767 switch (slotType)
768 {
769 case "NivaDriverDoors":
770 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
771
772 case "NivaCoDriverDoors":
773 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
774
775 case "NivaHood":
776 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
777
778 case "NivaTrunk":
779 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
780 }
781
783 }
784
786 {
788 switch (posIdx)
789 {
790 case 0:
792 return false;
793 else if (GetAnimationPhase("SeatDriver") > 0.5)
794 return false;
795
796 return true;
797
798 case 1:
800 return false;
801 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
802 return false;
803
804 return true;
805
806 case 2:
808 return false;
809 else if (GetAnimationPhase("SeatDriver") <= 0.5)
810 return false;
811
812 return true;
813
814 case 3:
816 return false;
817 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
818 return false;
819
820 return true;
821 }
822
823 return false;
824 }
825
827 {
828 switch (posIdx)
829 {
830 case 0:
831 case 2:
832 return "doors_driver";
833 case 1:
834 case 3:
835 return "doors_codriver";
836 }
837
838 return super.GetDoorSelectionNameFromSeatPos(posIdx);
839 }
840
842 {
843 switch (posIdx)
844 {
845 case 0:
846 case 2:
847 return "NivaDriverDoors";
848 case 1:
849 case 3:
850 return "NivaCoDriverDoors";
851 }
852
853 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
854 }
855
856
857
859 {
860 float tempCap = 0.0;
861
862 switch (ctrl)
863 {
865 float newValue = 0;
867 {
868 newValue += 0.5;
869 }
870
872 {
873 newValue += 0.5;
874 }
875
877 {
878 newValue += 0.3;
879 }
880
882 {
883 newValue -= 0.6;
884 }
885
887 {
888 newValue -= 0.2;
889 }
890
892 {
893 newValue -= 0.2;
894 }
895
897 break;
898 }
899
900 return super.OnSound(ctrl, oldValue);
901 }
902
904 {
905 switch (selection)
906 {
907 case "doors_driver":
908 return "DoorsDriver";
909 case "doors_codriver":
910 return "DoorsCoDriver";
911 case "doors_hood":
912 return "DoorsHood";
913 case "doors_trunk":
914 return "DoorsTrunk";
915 case "seatback_driver":
916 return "SeatDriver";
917 case "seatback_codriver":
918 return "SeatCoDriver";
919 }
920
921 return "";
922 }
923
925 {
926 switch (selection)
927 {
928 case "seat_driver":
929 case "seatback_driver":
930 case "seat_cargo1":
931 return "seat_con_1_1";
932 case "seat_codriver":
933 case "seatback_codriver":
934 case "seat_cargo2":
935 return "seat_con_2_1";
936 }
937
938 return "";
939 }
940
942 {
943 switch (selection)
944 {
945 case "seatback_driver":
946 return 0;
947 case "seatback_codriver":
948 return 1;
949 }
950
951 return -1;
952 }
953
955 {
956 return false;
957 }
958
960 {
961 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
962 return false;
963
964 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
965 return false;
966
967 switch (currentSeat)
968 {
969 case 0:
970 return nextSeat == 1;
971
972 case 1:
973 return nextSeat == 0;
974
975 case 2:
976 return nextSeat == 3;
977
978 case 3:
979 return nextSeat == 2;
980 }
981
982 return false;
983 }
984
986 {
987 switch (pCurrentSeat)
988 {
989 case 0:
990 return pDoorsSelection == "DoorsDriver";
991
992 case 1:
993 return pDoorsSelection == "DoorsCoDriver";
994
995 case 2:
996 return pDoorsSelection == "DoorsDriver";
997
998 case 3:
999 return pDoorsSelection == "DoorsCoDriver";
1000 }
1001
1002 return false;
1003 }
1004
1006 {
1007 switch (pDoorSelection)
1008 {
1009 case "DoorsDriver":
1010 return 0;
1011 case "DoorsCoDriver":
1012 return 1;
1013 }
1014
1015 return -1;
1016 }
1017
1019 {
1020 super.SetActions();
1021
1023 }
1024
1026 {
1028 SpawnAdditionalItems();
1029 FillUpCarFluids();
1030
1036
1041
1042
1045 }
1046}
1047
1049{
1051 {
1053 SpawnAdditionalItems();
1054 FillUpCarFluids();
1055
1056 GameInventory inventory = GetInventory();
1061
1066
1067
1068
1071 }
1072}
1073
1075{
1077 {
1079 SpawnAdditionalItems();
1080 FillUpCarFluids();
1081
1082 GameInventory inventory = GetInventory();
1087
1092
1093
1096 }
1097}
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.