628{
632
634 {
635
636
643
644 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
645 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
646 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
647 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
648
651
654
656
658 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
659 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
660 }
661
663 {
667 }
668
670 {
671 super.EEInit();
672
674 {
681
684 }
685 }
686
688 {
689 return true;
690 }
691
693 {
694 super.GetElectricitySourceDevice();
695
697 }
698
700 {
701 return "CarBattery";
702 }
703
705 {
706 super.OnEngineStart();
707
709 {
712 }
713 }
714
716 {
717 super.OnEngineStop();
718
720 {
723 }
724 }
725
727 {
729 {
731 {
733 }
734 }
735 }
736
738 {
740 }
741
743 {
744 return 3.5;
745 }
746
748 {
749 switch (posIdx)
750 {
751 case 0:
753 case 1:
755 case 2:
757 case 3:
759 }
760
761 return 0;
762
763 }
764
766 {
767 if (!super.CanReleaseAttachment(attachment))
768 {
769 return false;
770 }
771
773 {
774 string attType = attachment.GetType();
775 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
776 {
777 return false;
778 }
779 }
780
781 return true;
782 }
783
785 {
787 }
788
790 {
791 if (!super.CanDisplayAttachmentCategory(category_name))
792 {
793 return false;
794 }
795
797 if (category_name.
Contains(
"engine"))
798 {
800 {
801 return false;
802 }
803 }
804
805 return true;
806 }
807
809 {
810 if (!super.CanDisplayCargo())
811 {
812 return false;
813 }
814
816 {
817 return false;
818 }
819
820 return true;
821 }
822
824 {
826
827 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
828 if (!carDoor)
829 {
831 }
832
833 switch (slotType)
834 {
835 case "NivaDriverDoors":
836 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
837
838 case "NivaCoDriverDoors":
839 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
840
841 case "NivaHood":
842 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
843
844 case "NivaTrunk":
845 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
846 }
847
849 }
850
852 {
854 switch (posIdx)
855 {
856 case 0:
858 return false;
859 else if (GetAnimationPhase("SeatDriver") > 0.5)
860 return false;
861
862 return true;
863
864 case 1:
866 return false;
867 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
868 return false;
869
870 return true;
871
872 case 2:
874 return false;
875 else if (GetAnimationPhase("SeatDriver") <= 0.5)
876 return false;
877
878 return true;
879
880 case 3:
882 return false;
883 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
884 return false;
885
886 return true;
887 }
888
889 return false;
890 }
891
893 {
894 switch (posIdx)
895 {
896 case 0:
897 case 2:
898 return "doors_driver";
899 case 1:
900 case 3:
901 return "doors_codriver";
902 }
903
904 return super.GetDoorSelectionNameFromSeatPos(posIdx);
905 }
906
908 {
909 switch (posIdx)
910 {
911 case 0:
912 case 2:
913 return "NivaDriverDoors";
914 case 1:
915 case 3:
916 return "NivaCoDriverDoors";
917 }
918
919 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
920 }
921
922
923
925 {
926 float tempCap = 0.0;
927
928 switch (ctrl)
929 {
931 float newValue = 0;
933 {
934 newValue += 0.5;
935 }
936
938 {
939 newValue += 0.5;
940 }
941
943 {
944 newValue += 0.3;
945 }
946
948 {
949 newValue -= 0.6;
950 }
951
953 {
954 newValue -= 0.2;
955 }
956
958 {
959 newValue -= 0.2;
960 }
961
963 break;
964 }
965
966 return super.OnSound(ctrl, oldValue);
967 }
968
970 {
971 switch (selection)
972 {
973 case "doors_driver":
974 return "DoorsDriver";
975 case "doors_codriver":
976 return "DoorsCoDriver";
977 case "doors_hood":
978 return "DoorsHood";
979 case "doors_trunk":
980 return "DoorsTrunk";
981 case "seatback_driver":
982 return "SeatDriver";
983 case "seatback_codriver":
984 return "SeatCoDriver";
985 }
986
987 return "";
988 }
989
991 {
992 switch (selection)
993 {
994 case "seat_driver":
995 case "seatback_driver":
996 case "seat_cargo1":
997 return "seat_con_1_1";
998 case "seat_codriver":
999 case "seatback_codriver":
1000 case "seat_cargo2":
1001 return "seat_con_2_1";
1002 }
1003
1004 return "";
1005 }
1006
1008 {
1009 switch (selection)
1010 {
1011 case "seatback_driver":
1012 return 0;
1013 case "seatback_codriver":
1014 return 1;
1015 }
1016
1017 return -1;
1018 }
1019
1021 {
1022 return false;
1023 }
1024
1026 {
1027 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1028 return false;
1029
1030 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1031 return false;
1032
1033 switch (currentSeat)
1034 {
1035 case 0:
1036 return nextSeat == 1;
1037
1038 case 1:
1039 return nextSeat == 0;
1040
1041 case 2:
1042 return nextSeat == 3;
1043
1044 case 3:
1045 return nextSeat == 2;
1046 }
1047
1048 return false;
1049 }
1050
1052 {
1053 switch (pCurrentSeat)
1054 {
1055 case 0:
1056 return pDoorsSelection == "DoorsDriver";
1057
1058 case 1:
1059 return pDoorsSelection == "DoorsCoDriver";
1060
1061 case 2:
1062 return pDoorsSelection == "DoorsDriver";
1063
1064 case 3:
1065 return pDoorsSelection == "DoorsCoDriver";
1066 }
1067
1068 return false;
1069 }
1070
1072 {
1073 switch (pDoorSelection)
1074 {
1075 case "DoorsDriver":
1076 return 0;
1077 case "DoorsCoDriver":
1078 return 1;
1079 }
1080
1081 return -1;
1082 }
1083
1085 {
1086 super.SetActions();
1087
1089 }
1090
1092 {
1094 SpawnAdditionalItems();
1095 FillUpCarFluids();
1096
1102
1107
1108
1111 }
1112}
1113
1115{
1117 {
1119 SpawnAdditionalItems();
1120 FillUpCarFluids();
1121
1122 GameInventory inventory = GetInventory();
1127
1132
1133
1134
1137 }
1138}
1139
1141{
1143 {
1145 SpawnAdditionalItems();
1146 FillUpCarFluids();
1147
1148 GameInventory inventory = GetInventory();
1153
1158
1159
1162 }
1163}
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.