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