605{
609
611 {
612
613
619
624
627
628 SetEnginePos("0 0.7 1.2");
629 }
630
632 {
633 super.EEInit();
634
636 {
643
646 }
647 }
648
650 {
651 super.OnEngineStart();
652
654 {
656 }
657 }
658
660 {
661 super.OnEngineStop();
662
664 {
666 }
667 }
668
670 {
672 {
674 {
676 }
677 }
678 }
679
681 {
683 }
684
686 {
687 return 3.5;
688 }
689
691 {
692 switch (posIdx)
693 {
694 case 0:
696 case 1:
698 case 2:
700 case 3:
702 }
703
704 return 0;
705
706 }
707
708
710 {
712 }
713
715 {
717 }
718
720 {
721 if (!super.CanReleaseAttachment(attachment))
722 {
723 return false;
724 }
725
727 {
728 string attType = attachment.GetType();
729 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
730 {
731 return false;
732 }
733 }
734
735 return true;
736 }
737
739 {
741 }
742
744 {
745 if (!super.CanDisplayAttachmentCategory(category_name))
746 {
747 return false;
748 }
749
751 if (category_name.
Contains(
"engine"))
752 {
754 {
755 return false;
756 }
757 }
758
759 return true;
760 }
761
763 {
764 if (!super.CanDisplayCargo())
765 {
766 return false;
767 }
768
770 {
771 return false;
772 }
773
774 return true;
775 }
776
778 {
780
781 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
782 if (!carDoor)
783 {
785 }
786
787 switch (slotType)
788 {
789 case "NivaDriverDoors":
791
792 case "NivaCoDriverDoors":
794
795 case "NivaHood":
797
798 case "NivaTrunk":
800 }
801
803 }
804
806 {
808 switch (posIdx)
809 {
810 case 0:
812 return false;
813 else if (GetAnimationPhase("SeatDriver") > 0.5)
814 return false;
815
816 return true;
817
818 case 1:
820 return false;
821 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
822 return false;
823
824 return true;
825
826 case 2:
828 return false;
829 else if (GetAnimationPhase("SeatDriver") <= 0.5)
830 return false;
831
832 return true;
833
834 case 3:
836 return false;
837 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
838 return false;
839
840 return true;
841 }
842
843 return false;
844 }
845
847 {
848 switch (posIdx)
849 {
850 case 0:
851 case 2:
852 return "doors_driver";
853 case 1:
854 case 3:
855 return "doors_codriver";
856 }
857
858 return super.GetDoorSelectionNameFromSeatPos(posIdx);
859 }
860
862 {
863 switch (posIdx)
864 {
865 case 0:
866 case 2:
867 return "NivaDriverDoors";
868 case 1:
869 case 3:
870 return "NivaCoDriverDoors";
871 }
872
873 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
874 }
875
876
877
879 {
880 float tempCap = 0.0;
881
882 switch (ctrl)
883 {
885 float newValue = 0;
887 {
888 newValue += 0.5;
889 }
890
892 {
893 newValue += 0.5;
894 }
895
897 {
898 newValue += 0.3;
899 }
900
902 {
903 newValue -= 0.6;
904 }
905
907 {
908 newValue -= 0.2;
909 }
910
912 {
913 newValue -= 0.2;
914 }
915
917 break;
918 }
919
920 return super.OnSound(ctrl, oldValue);
921 }
922
924 {
925 switch (selection)
926 {
927 case "doors_driver":
928 return "DoorsDriver";
929 case "doors_codriver":
930 return "DoorsCoDriver";
931 case "doors_hood":
932 return "DoorsHood";
933 case "doors_trunk":
934 return "DoorsTrunk";
935 case "seatback_driver":
936 return "SeatDriver";
937 case "seatback_codriver":
938 return "SeatCoDriver";
939 }
940
941 return "";
942 }
943
945 {
946 switch (selection)
947 {
948 case "seat_driver":
949 case "seatback_driver":
950 case "seat_cargo1":
951 return "seat_con_1_1";
952 case "seat_codriver":
953 case "seatback_codriver":
954 case "seat_cargo2":
955 return "seat_con_2_1";
956 }
957
958 return "";
959 }
960
962 {
963 switch (selection)
964 {
965 case "seatback_driver":
966 return 0;
967 case "seatback_codriver":
968 return 1;
969 }
970
971 return -1;
972 }
973
975 {
976 return false;
977 }
978
980 {
981 return false;
982 }
983
985 {
986 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
987 return false;
988
989 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
990 return false;
991
992 switch (currentSeat)
993 {
994 case 0:
995 return nextSeat == 1;
996
997 case 1:
998 return nextSeat == 0;
999
1000 case 2:
1001 return nextSeat == 3;
1002
1003 case 3:
1004 return nextSeat == 2;
1005 }
1006
1007 return false;
1008 }
1009
1011 {
1012 switch (pCurrentSeat)
1013 {
1014 case 0:
1015 return pDoorsSelection == "DoorsDriver";
1016
1017 case 1:
1018 return pDoorsSelection == "DoorsCoDriver";
1019
1020 case 2:
1021 return pDoorsSelection == "DoorsDriver";
1022
1023 case 3:
1024 return pDoorsSelection == "DoorsCoDriver";
1025 }
1026
1027 return false;
1028 }
1029
1031 {
1032 switch (pDoorSelection)
1033 {
1034 case "DoorsDriver":
1035 return 0;
1036 case "DoorsCoDriver":
1037 return 1;
1038 }
1039
1040 return -1;
1041 }
1042
1044 {
1045 super.SetActions();
1046
1048 }
1049
1051 {
1055
1056 GetInventory().CreateInInventory("HatchbackWheel");
1057 GetInventory().CreateInInventory("HatchbackWheel");
1058 GetInventory().CreateInInventory("HatchbackWheel" );
1059 GetInventory().CreateInInventory("HatchbackWheel");
1060
1061 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1062 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1063 GetInventory().CreateInInventory("HatchbackHood");
1064 GetInventory().CreateInInventory("HatchbackTrunk");
1065
1066
1067 GetInventory().CreateInInventory("HatchbackWheel");
1068 GetInventory().CreateInInventory("HatchbackWheel");
1069 }
1070}
1071
1073{
1075 {
1079
1080 GetInventory().CreateInInventory("HatchbackWheel");
1081 GetInventory().CreateInInventory("HatchbackWheel");
1082 GetInventory().CreateInInventory("HatchbackWheel");
1083 GetInventory().CreateInInventory("HatchbackWheel");
1084
1085 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1086 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1087 GetInventory().CreateInInventory("HatchbackHood_White");
1088 GetInventory().CreateInInventory("HatchbackTrunk_White");
1089
1090
1091 GetInventory().CreateInInventory("HatchbackWheel");
1092 GetInventory().CreateInInventory("HatchbackWheel");
1093 }
1094}
1095
1097{
1099 {
1103
1104 GetInventory().CreateInInventory("HatchbackWheel");
1105 GetInventory().CreateInInventory("HatchbackWheel");
1106 GetInventory().CreateInInventory("HatchbackWheel");
1107 GetInventory().CreateInInventory("HatchbackWheel");
1108
1109 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1110 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1111 GetInventory().CreateInInventory("HatchbackHood_Blue");
1112 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1113
1114
1115 GetInventory().CreateInInventory("HatchbackWheel");
1116 GetInventory().CreateInInventory("HatchbackWheel");
1117 }
1118}
void AddAction(typename actionName)
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
void SpawnUniversalParts()
string m_CarSeatShiftInSound
CarDoorState TranslateAnimationPhaseToCarDoorState(string animation)
void SpawnAdditionalItems()
string m_EngineStartOK
Sounds.
string m_CarDoorCloseSound
string m_EngineStartBattery
string m_CarHornShortSoundName
string m_CarHornLongSoundName
string m_CarSeatShiftOutSound
string m_CarDoorOpenSound
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.