588{
592
594 {
595
596
597 m_EngineStartOK = "offroad_engine_start_SoundSet";
598 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
599 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
600 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
601 m_EngineStop = "offroad_engine_stop_SoundSet";
602 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
603
604 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
605 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
606 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
607 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
608
609 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
610 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
611
612 SetEnginePos("0 0.7 1.2");
613 }
614
616 {
617 super.EEInit();
618
620 {
627
630 }
631 }
632
634 {
635 super.OnEngineStart();
636
638 {
640 }
641 }
642
644 {
645 super.OnEngineStop();
646
648 {
650 }
651 }
652
654 {
656 {
658 {
660 }
661 }
662 }
663
665 {
667 }
668
670 {
671 return 3.5;
672 }
673
675 {
676 switch (posIdx)
677 {
678 case 0:
680 case 1:
682 case 2:
684 case 3:
686 }
687
688 return 0;
689
690 }
691
692
694 {
696 }
697
699 {
701 }
702
704 {
705 if (!super.CanReleaseAttachment(attachment))
706 {
707 return false;
708 }
709
711 {
712 string attType = attachment.GetType();
713 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
714 {
715 return false;
716 }
717 }
718
719 return true;
720 }
721
723 {
725 }
726
728 {
729 if (!super.CanDisplayAttachmentCategory(category_name))
730 {
731 return false;
732 }
733
735 if (category_name.
Contains(
"engine"))
736 {
738 {
739 return false;
740 }
741 }
742
743 return true;
744 }
745
747 {
748 if (!super.CanDisplayCargo())
749 {
750 return false;
751 }
752
754 {
755 return false;
756 }
757
758 return true;
759 }
760
762 {
764
765 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
766 if (!carDoor)
767 {
769 }
770
771 switch (slotType)
772 {
773 case "NivaDriverDoors":
774 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
775
776 case "NivaCoDriverDoors":
777 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
778
779 case "NivaHood":
780 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
781
782 case "NivaTrunk":
783 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
784 }
785
787 }
788
790 {
792 switch (posIdx)
793 {
794 case 0:
796 return false;
797 else if (GetAnimationPhase("SeatDriver") > 0.5)
798 return false;
799
800 return true;
801
802 case 1:
804 return false;
805 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
806 return false;
807
808 return true;
809
810 case 2:
812 return false;
813 else if (GetAnimationPhase("SeatDriver") <= 0.5)
814 return false;
815
816 return true;
817
818 case 3:
820 return false;
821 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
822 return false;
823
824 return true;
825 }
826
827 return false;
828 }
829
831 {
832 switch (posIdx)
833 {
834 case 0:
835 case 2:
836 return "doors_driver";
837 case 1:
838 case 3:
839 return "doors_codriver";
840 }
841
842 return super.GetDoorSelectionNameFromSeatPos(posIdx);
843 }
844
846 {
847 switch (posIdx)
848 {
849 case 0:
850 case 2:
851 return "NivaDriverDoors";
852 case 1:
853 case 3:
854 return "NivaCoDriverDoors";
855 }
856
857 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
858 }
859
860
861
863 {
864 float tempCap = 0.0;
865
866 switch (ctrl)
867 {
869 float newValue = 0;
871 {
872 newValue += 0.5;
873 }
874
876 {
877 newValue += 0.5;
878 }
879
881 {
882 newValue += 0.3;
883 }
884
886 {
887 newValue -= 0.6;
888 }
889
891 {
892 newValue -= 0.2;
893 }
894
896 {
897 newValue -= 0.2;
898 }
899
901 break;
902 }
903
904 return super.OnSound(ctrl, oldValue);
905 }
906
908 {
909 switch (selection)
910 {
911 case "doors_driver":
912 return "DoorsDriver";
913 case "doors_codriver":
914 return "DoorsCoDriver";
915 case "doors_hood":
916 return "DoorsHood";
917 case "doors_trunk":
918 return "DoorsTrunk";
919 case "seatback_driver":
920 return "SeatDriver";
921 case "seatback_codriver":
922 return "SeatCoDriver";
923 }
924
925 return "";
926 }
927
929 {
930 switch (selection)
931 {
932 case "seat_driver":
933 case "seatback_driver":
934 case "seat_cargo1":
935 return "seat_con_1_1";
936 case "seat_codriver":
937 case "seatback_codriver":
938 case "seat_cargo2":
939 return "seat_con_2_1";
940 }
941
942 return "";
943 }
944
946 {
947 switch (selection)
948 {
949 case "seatback_driver":
950 return 0;
951 case "seatback_codriver":
952 return 1;
953 }
954
955 return -1;
956 }
957
959 {
960 return false;
961 }
962
964 {
965 return false;
966 }
967
969 {
970 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
971 return false;
972
973 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
974 return false;
975
976 switch (currentSeat)
977 {
978 case 0:
979 return nextSeat == 1;
980
981 case 1:
982 return nextSeat == 0;
983
984 case 2:
985 return nextSeat == 3;
986
987 case 3:
988 return nextSeat == 2;
989 }
990
991 return false;
992 }
993
995 {
996 switch (pCurrentSeat)
997 {
998 case 0:
999 return pDoorsSelection == "DoorsDriver";
1000
1001 case 1:
1002 return pDoorsSelection == "DoorsCoDriver";
1003
1004 case 2:
1005 return pDoorsSelection == "DoorsDriver";
1006
1007 case 3:
1008 return pDoorsSelection == "DoorsCoDriver";
1009 }
1010
1011 return false;
1012 }
1013
1015 {
1016 switch (pDoorSelection)
1017 {
1018 case "DoorsDriver":
1019 return 0;
1020 case "DoorsCoDriver":
1021 return 1;
1022 }
1023
1024 return -1;
1025 }
1026
1028 {
1029 super.SetActions();
1030
1032 }
1033
1035 {
1036 SpawnUniversalParts();
1037 SpawnAdditionalItems();
1038 FillUpCarFluids();
1039
1040 GetInventory().CreateInInventory("HatchbackWheel");
1041 GetInventory().CreateInInventory("HatchbackWheel");
1042 GetInventory().CreateInInventory("HatchbackWheel" );
1043 GetInventory().CreateInInventory("HatchbackWheel");
1044
1045 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1046 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1047 GetInventory().CreateInInventory("HatchbackHood");
1048 GetInventory().CreateInInventory("HatchbackTrunk");
1049
1050
1051 GetInventory().CreateInInventory("HatchbackWheel");
1052 GetInventory().CreateInInventory("HatchbackWheel");
1053 }
1054}
1055
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_White");
1070 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1071 GetInventory().CreateInInventory("HatchbackHood_White");
1072 GetInventory().CreateInInventory("HatchbackTrunk_White");
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_Blue");
1094 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1095 GetInventory().CreateInInventory("HatchbackHood_Blue");
1096 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1097
1098
1099 GetInventory().CreateInInventory("HatchbackWheel");
1100 GetInventory().CreateInInventory("HatchbackWheel");
1101 }
1102}
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.