612{
616
618 {
619
620
621 m_EngineStartOK = "offroad_engine_start_SoundSet";
622 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
623 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
624 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
625 m_EngineStop = "offroad_engine_stop_SoundSet";
626 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
627
628 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
629 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
630 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
631 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
632
633 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
634 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
635
636 SetEnginePos("0 0.7 1.2");
637 }
638
640 {
641 super.EEInit();
642
644 {
651
654 }
655 }
656
658 {
659 super.OnEngineStart();
660
662 {
664 }
665 }
666
668 {
669 super.OnEngineStop();
670
672 {
674 }
675 }
676
678 {
680 {
682 {
684 }
685 }
686 }
687
689 {
691 }
692
694 {
695 return 3.5;
696 }
697
699 {
700 switch (posIdx)
701 {
702 case 0:
704 case 1:
706 case 2:
708 case 3:
710 }
711
712 return 0;
713
714 }
715
716
718 {
720 }
721
723 {
725 }
726
728 {
729 if (!super.CanReleaseAttachment(attachment))
730 {
731 return false;
732 }
733
735 {
736 string attType = attachment.GetType();
737 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
738 {
739 return false;
740 }
741 }
742
743 return true;
744 }
745
747 {
749 }
750
752 {
753 if (!super.CanDisplayAttachmentCategory(category_name))
754 {
755 return false;
756 }
757
759 if (category_name.
Contains(
"engine"))
760 {
762 {
763 return false;
764 }
765 }
766
767 return true;
768 }
769
771 {
772 if (!super.CanDisplayCargo())
773 {
774 return false;
775 }
776
778 {
779 return false;
780 }
781
782 return true;
783 }
784
786 {
788
789 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
790 if (!carDoor)
791 {
793 }
794
795 switch (slotType)
796 {
797 case "NivaDriverDoors":
798 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
799
800 case "NivaCoDriverDoors":
801 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
802
803 case "NivaHood":
804 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
805
806 case "NivaTrunk":
807 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
808 }
809
811 }
812
814 {
816 switch (posIdx)
817 {
818 case 0:
820 return false;
821 else if (GetAnimationPhase("SeatDriver") > 0.5)
822 return false;
823
824 return true;
825
826 case 1:
828 return false;
829 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
830 return false;
831
832 return true;
833
834 case 2:
836 return false;
837 else if (GetAnimationPhase("SeatDriver") <= 0.5)
838 return false;
839
840 return true;
841
842 case 3:
844 return false;
845 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
846 return false;
847
848 return true;
849 }
850
851 return false;
852 }
853
855 {
856 switch (posIdx)
857 {
858 case 0:
859 case 2:
860 return "doors_driver";
861 case 1:
862 case 3:
863 return "doors_codriver";
864 }
865
866 return super.GetDoorSelectionNameFromSeatPos(posIdx);
867 }
868
870 {
871 switch (posIdx)
872 {
873 case 0:
874 case 2:
875 return "NivaDriverDoors";
876 case 1:
877 case 3:
878 return "NivaCoDriverDoors";
879 }
880
881 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
882 }
883
884
885
887 {
888 float tempCap = 0.0;
889
890 switch (ctrl)
891 {
893 float newValue = 0;
895 {
896 newValue += 0.5;
897 }
898
900 {
901 newValue += 0.5;
902 }
903
905 {
906 newValue += 0.3;
907 }
908
910 {
911 newValue -= 0.6;
912 }
913
915 {
916 newValue -= 0.2;
917 }
918
920 {
921 newValue -= 0.2;
922 }
923
925 break;
926 }
927
928 return super.OnSound(ctrl, oldValue);
929 }
930
932 {
933 switch (selection)
934 {
935 case "doors_driver":
936 return "DoorsDriver";
937 case "doors_codriver":
938 return "DoorsCoDriver";
939 case "doors_hood":
940 return "DoorsHood";
941 case "doors_trunk":
942 return "DoorsTrunk";
943 case "seatback_driver":
944 return "SeatDriver";
945 case "seatback_codriver":
946 return "SeatCoDriver";
947 }
948
949 return "";
950 }
951
953 {
954 switch (selection)
955 {
956 case "seat_driver":
957 case "seatback_driver":
958 case "seat_cargo1":
959 return "seat_con_1_1";
960 case "seat_codriver":
961 case "seatback_codriver":
962 case "seat_cargo2":
963 return "seat_con_2_1";
964 }
965
966 return "";
967 }
968
970 {
971 switch (selection)
972 {
973 case "seatback_driver":
974 return 0;
975 case "seatback_codriver":
976 return 1;
977 }
978
979 return -1;
980 }
981
983 {
984 return false;
985 }
986
988 {
989 return false;
990 }
991
993 {
994 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
995 return false;
996
997 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
998 return false;
999
1000 switch (currentSeat)
1001 {
1002 case 0:
1003 return nextSeat == 1;
1004
1005 case 1:
1006 return nextSeat == 0;
1007
1008 case 2:
1009 return nextSeat == 3;
1010
1011 case 3:
1012 return nextSeat == 2;
1013 }
1014
1015 return false;
1016 }
1017
1019 {
1020 switch (pCurrentSeat)
1021 {
1022 case 0:
1023 return pDoorsSelection == "DoorsDriver";
1024
1025 case 1:
1026 return pDoorsSelection == "DoorsCoDriver";
1027
1028 case 2:
1029 return pDoorsSelection == "DoorsDriver";
1030
1031 case 3:
1032 return pDoorsSelection == "DoorsCoDriver";
1033 }
1034
1035 return false;
1036 }
1037
1039 {
1040 switch (pDoorSelection)
1041 {
1042 case "DoorsDriver":
1043 return 0;
1044 case "DoorsCoDriver":
1045 return 1;
1046 }
1047
1048 return -1;
1049 }
1050
1052 {
1053 super.SetActions();
1054
1056 }
1057
1059 {
1060 SpawnUniversalParts();
1061 SpawnAdditionalItems();
1062 FillUpCarFluids();
1063
1064 GetInventory().CreateInInventory("HatchbackWheel");
1065 GetInventory().CreateInInventory("HatchbackWheel");
1066 GetInventory().CreateInInventory("HatchbackWheel" );
1067 GetInventory().CreateInInventory("HatchbackWheel");
1068
1069 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1070 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1071 GetInventory().CreateInInventory("HatchbackHood");
1072 GetInventory().CreateInInventory("HatchbackTrunk");
1073
1074
1075 GetInventory().CreateInInventory("HatchbackWheel");
1076 GetInventory().CreateInInventory("HatchbackWheel");
1077 }
1078}
1079
1081{
1083 {
1084 SpawnUniversalParts();
1085 SpawnAdditionalItems();
1086 FillUpCarFluids();
1087
1088 GetInventory().CreateInInventory("HatchbackWheel");
1089 GetInventory().CreateInInventory("HatchbackWheel");
1090 GetInventory().CreateInInventory("HatchbackWheel");
1091 GetInventory().CreateInInventory("HatchbackWheel");
1092
1093 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1094 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1095 GetInventory().CreateInInventory("HatchbackHood_White");
1096 GetInventory().CreateInInventory("HatchbackTrunk_White");
1097
1098
1099 GetInventory().CreateInInventory("HatchbackWheel");
1100 GetInventory().CreateInInventory("HatchbackWheel");
1101 }
1102}
1103
1105{
1107 {
1108 SpawnUniversalParts();
1109 SpawnAdditionalItems();
1110 FillUpCarFluids();
1111
1112 GetInventory().CreateInInventory("HatchbackWheel");
1113 GetInventory().CreateInInventory("HatchbackWheel");
1114 GetInventory().CreateInInventory("HatchbackWheel");
1115 GetInventory().CreateInInventory("HatchbackWheel");
1116
1117 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1118 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1119 GetInventory().CreateInInventory("HatchbackHood_Blue");
1120 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1121
1122
1123 GetInventory().CreateInInventory("HatchbackWheel");
1124 GetInventory().CreateInInventory("HatchbackWheel");
1125 }
1126}
void AddAction(typename actionName)
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
ref UniversalTemperatureSourceSettings m_UTSSettings
ref UniversalTemperatureSource m_UTSource
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 void OnEngineStart()
override CarLightBase CreateFrontLight()
override int GetAnimInstance()
override bool CrewCanGetThrough(int posIdx)
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
bool CanManipulateSpareWheel(string slotSelectionName)
override bool IsVitalGlowPlug()
override CarRearLightBase CreateRearLight()
class OffroadHatchback extends CarScript OnDebugSpawn()
override int GetSeatIndexFromDoor(string pDoorSelection)
override bool IsVitalTruckBattery()
override string GetDoorSelectionNameFromSeatPos(int posIdx)
override int GetCarDoorsState(string slotType)
override int GetCrewIndex(string selection)
override bool CanDisplayAttachmentCategory(string category_name)
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
Super root of all classes in Enforce script.
override void OnDebugSpawn()
original Timer deletes m_params which is unwanted
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
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.