583{
587
589 {
590
591
592 m_EngineStartOK = "offroad_engine_start_SoundSet";
593 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
594 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
595 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
596 m_EngineStop = "offroad_engine_stop_SoundSet";
597 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
598
599 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
600 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
601 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
602 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
603
604 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
605 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
606
607 SetEnginePos("0 0.7 1.2");
608 }
609
611 {
612 super.EEInit();
613
615 {
622
625 }
626 }
627
629 {
630 super.OnEngineStart();
631
633 {
635 }
636 }
637
639 {
640 super.OnEngineStop();
641
643 {
645 }
646 }
647
649 {
651 {
653 {
655 }
656 }
657 }
658
660 {
662 }
663
665 {
666 return 3.5;
667 }
668
670 {
671 switch (posIdx)
672 {
673 case 0:
675 case 1:
677 case 2:
679 case 3:
681 }
682
683 return 0;
684
685 }
686
687
689 {
691 }
692
694 {
696 }
697
699 {
700 if (!super.CanReleaseAttachment(attachment))
701 {
702 return false;
703 }
704
706 {
707 string attType = attachment.GetType();
708 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
709 {
710 return false;
711 }
712 }
713
714 return true;
715 }
716
718 {
720 }
721
723 {
724 if (!super.CanDisplayAttachmentCategory(category_name))
725 {
726 return false;
727 }
728
730 if (category_name.
Contains(
"engine"))
731 {
733 {
734 return false;
735 }
736 }
737
738 return true;
739 }
740
742 {
743 if (!super.CanDisplayCargo())
744 {
745 return false;
746 }
747
749 {
750 return false;
751 }
752
753 return true;
754 }
755
757 {
759
760 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
761 if (!carDoor)
762 {
764 }
765
766 switch (slotType)
767 {
768 case "NivaDriverDoors":
769 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
770
771 case "NivaCoDriverDoors":
772 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
773
774 case "NivaHood":
775 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
776
777 case "NivaTrunk":
778 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
779 }
780
782 }
783
785 {
787 switch (posIdx)
788 {
789 case 0:
791 return false;
792 else if (GetAnimationPhase("SeatDriver") > 0.5)
793 return false;
794
795 return true;
796
797 case 1:
799 return false;
800 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
801 return false;
802
803 return true;
804
805 case 2:
807 return false;
808 else if (GetAnimationPhase("SeatDriver") <= 0.5)
809 return false;
810
811 return true;
812
813 case 3:
815 return false;
816 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
817 return false;
818
819 return true;
820 }
821
822 return false;
823 }
824
826 {
827 switch (posIdx)
828 {
829 case 0:
830 case 2:
831 return "doors_driver";
832 case 1:
833 case 3:
834 return "doors_codriver";
835 }
836
837 return super.GetDoorSelectionNameFromSeatPos(posIdx);
838 }
839
841 {
842 switch (posIdx)
843 {
844 case 0:
845 case 2:
846 return "NivaDriverDoors";
847 case 1:
848 case 3:
849 return "NivaCoDriverDoors";
850 }
851
852 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
853 }
854
855
856
858 {
859 float tempCap = 0.0;
860
861 switch (ctrl)
862 {
864 float newValue = 0;
866 {
867 newValue += 0.5;
868 }
869
871 {
872 newValue += 0.5;
873 }
874
876 {
877 newValue += 0.3;
878 }
879
881 {
882 newValue -= 0.6;
883 }
884
886 {
887 newValue -= 0.2;
888 }
889
891 {
892 newValue -= 0.2;
893 }
894
896 break;
897 }
898
899 return super.OnSound(ctrl, oldValue);
900 }
901
903 {
904 switch (selection)
905 {
906 case "doors_driver":
907 return "DoorsDriver";
908 case "doors_codriver":
909 return "DoorsCoDriver";
910 case "doors_hood":
911 return "DoorsHood";
912 case "doors_trunk":
913 return "DoorsTrunk";
914 case "seatback_driver":
915 return "SeatDriver";
916 case "seatback_codriver":
917 return "SeatCoDriver";
918 }
919
920 return "";
921 }
922
924 {
925 switch (selection)
926 {
927 case "seat_driver":
928 case "seatback_driver":
929 case "seat_cargo1":
930 return "seat_con_1_1";
931 case "seat_codriver":
932 case "seatback_codriver":
933 case "seat_cargo2":
934 return "seat_con_2_1";
935 }
936
937 return "";
938 }
939
941 {
942 switch (selection)
943 {
944 case "seatback_driver":
945 return 0;
946 case "seatback_codriver":
947 return 1;
948 }
949
950 return -1;
951 }
952
954 {
955 return false;
956 }
957
959 {
960 return false;
961 }
962
964 {
965 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
966 return false;
967
968 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
969 return false;
970
971 switch (currentSeat)
972 {
973 case 0:
974 return nextSeat == 1;
975
976 case 1:
977 return nextSeat == 0;
978
979 case 2:
980 return nextSeat == 3;
981
982 case 3:
983 return nextSeat == 2;
984 }
985
986 return false;
987 }
988
990 {
991 switch (pCurrentSeat)
992 {
993 case 0:
994 return pDoorsSelection == "DoorsDriver";
995
996 case 1:
997 return pDoorsSelection == "DoorsCoDriver";
998
999 case 2:
1000 return pDoorsSelection == "DoorsDriver";
1001
1002 case 3:
1003 return pDoorsSelection == "DoorsCoDriver";
1004 }
1005
1006 return false;
1007 }
1008
1010 {
1011 switch (pDoorSelection)
1012 {
1013 case "DoorsDriver":
1014 return 0;
1015 case "DoorsCoDriver":
1016 return 1;
1017 }
1018
1019 return -1;
1020 }
1021
1023 {
1024 super.SetActions();
1025
1027 }
1028
1030 {
1031 SpawnUniversalParts();
1032 SpawnAdditionalItems();
1033 FillUpCarFluids();
1034
1035 GetInventory().CreateInInventory("HatchbackWheel");
1036 GetInventory().CreateInInventory("HatchbackWheel");
1037 GetInventory().CreateInInventory("HatchbackWheel" );
1038 GetInventory().CreateInInventory("HatchbackWheel");
1039
1040 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1041 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1042 GetInventory().CreateInInventory("HatchbackHood");
1043 GetInventory().CreateInInventory("HatchbackTrunk");
1044
1045
1046 GetInventory().CreateInInventory("HatchbackWheel");
1047 GetInventory().CreateInInventory("HatchbackWheel");
1048 }
1049}
1050
1052{
1054 {
1055 SpawnUniversalParts();
1056 SpawnAdditionalItems();
1057 FillUpCarFluids();
1058
1059 GetInventory().CreateInInventory("HatchbackWheel");
1060 GetInventory().CreateInInventory("HatchbackWheel");
1061 GetInventory().CreateInInventory("HatchbackWheel");
1062 GetInventory().CreateInInventory("HatchbackWheel");
1063
1064 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1065 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1066 GetInventory().CreateInInventory("HatchbackHood_White");
1067 GetInventory().CreateInInventory("HatchbackTrunk_White");
1068
1069
1070 GetInventory().CreateInInventory("HatchbackWheel");
1071 GetInventory().CreateInInventory("HatchbackWheel");
1072 }
1073}
1074
1076{
1078 {
1079 SpawnUniversalParts();
1080 SpawnAdditionalItems();
1081 FillUpCarFluids();
1082
1083 GetInventory().CreateInInventory("HatchbackWheel");
1084 GetInventory().CreateInInventory("HatchbackWheel");
1085 GetInventory().CreateInInventory("HatchbackWheel");
1086 GetInventory().CreateInInventory("HatchbackWheel");
1087
1088 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1089 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1090 GetInventory().CreateInInventory("HatchbackHood_Blue");
1091 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1092
1093
1094 GetInventory().CreateInInventory("HatchbackWheel");
1095 GetInventory().CreateInInventory("HatchbackWheel");
1096 }
1097}
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.