554{
558
560 {
561
562
563 m_EngineStartOK = "offroad_engine_start_SoundSet";
564 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
565 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
566 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
567 m_EngineStop = "offroad_engine_stop_SoundSet";
568 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
569
570 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
571 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
572 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
573 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
574
575 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
576 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
577
578 SetEnginePos("0 0.7 1.2");
579 }
580
582 {
583 super.EEInit();
584
586 {
593
596 }
597 }
598
600 {
601 super.OnEngineStart();
602
604 {
606 }
607 }
608
610 {
611 super.OnEngineStop();
612
614 {
616 }
617 }
618
620 {
622 {
624 {
626 }
627 }
628 }
629
631 {
633 }
634
636 {
637 return 3.5;
638 }
639
641 {
642 switch (posIdx)
643 {
644 case 0:
646 case 1:
648 case 2:
650 case 3:
652 }
653
654 return 0;
655
656 }
657
658
660 {
662 }
663
665 {
667 }
668
670 {
671 if (!super.CanReleaseAttachment(attachment))
672 {
673 return false;
674 }
675
677 {
678 string attType = attachment.GetType();
679 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
680 {
681 return false;
682 }
683 }
684
685 return true;
686 }
687
689 {
691 }
692
694 {
695 if (!super.CanDisplayAttachmentCategory(category_name))
696 {
697 return false;
698 }
699
701 if (category_name.
Contains(
"engine"))
702 {
704 {
705 return false;
706 }
707 }
708
709 return true;
710 }
711
713 {
714 if (!super.CanDisplayCargo())
715 {
716 return false;
717 }
718
720 {
721 return false;
722 }
723
724 return true;
725 }
726
728 {
730
731 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
732 if (!carDoor)
733 {
735 }
736
737 switch (slotType)
738 {
739 case "NivaDriverDoors":
740 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
741
742 case "NivaCoDriverDoors":
743 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
744
745 case "NivaHood":
746 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
747
748 case "NivaTrunk":
749 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
750 }
751
753 }
754
756 {
758 switch (posIdx)
759 {
760 case 0:
762 return false;
763 else if (GetAnimationPhase("SeatDriver") > 0.5)
764 return false;
765
766 return true;
767
768 case 1:
770 return false;
771 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
772 return false;
773
774 return true;
775
776 case 2:
778 return false;
779 else if (GetAnimationPhase("SeatDriver") <= 0.5)
780 return false;
781
782 return true;
783
784 case 3:
786 return false;
787 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
788 return false;
789
790 return true;
791 }
792
793 return false;
794 }
795
797 {
798 switch (posIdx)
799 {
800 case 0:
801 case 2:
802 return "doors_driver";
803 case 1:
804 case 3:
805 return "doors_codriver";
806 }
807
808 return super.GetDoorSelectionNameFromSeatPos(posIdx);
809 }
810
812 {
813 switch (posIdx)
814 {
815 case 0:
816 case 2:
817 return "NivaDriverDoors";
818 case 1:
819 case 3:
820 return "NivaCoDriverDoors";
821 }
822
823 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
824 }
825
826
827
829 {
830 float tempCap = 0.0;
831
832 switch (ctrl)
833 {
835 float newValue = 0;
837 {
838 newValue += 0.5;
839 }
840
842 {
843 newValue += 0.5;
844 }
845
847 {
848 newValue += 0.3;
849 }
850
852 {
853 newValue -= 0.6;
854 }
855
857 {
858 newValue -= 0.2;
859 }
860
862 {
863 newValue -= 0.2;
864 }
865
867 break;
868 }
869
870 return super.OnSound(ctrl, oldValue);
871 }
872
874 {
875 switch (selection)
876 {
877 case "doors_driver":
878 return "DoorsDriver";
879 case "doors_codriver":
880 return "DoorsCoDriver";
881 case "doors_hood":
882 return "DoorsHood";
883 case "doors_trunk":
884 return "DoorsTrunk";
885 case "seatback_driver":
886 return "SeatDriver";
887 case "seatback_codriver":
888 return "SeatCoDriver";
889 }
890
891 return "";
892 }
893
895 {
896 switch (selection)
897 {
898 case "seat_driver":
899 case "seatback_driver":
900 case "seat_cargo1":
901 return "seat_con_1_1";
902 case "seat_codriver":
903 case "seatback_codriver":
904 case "seat_cargo2":
905 return "seat_con_2_1";
906 }
907
908 return "";
909 }
910
912 {
913 switch (selection)
914 {
915 case "seatback_driver":
916 return 0;
917 case "seatback_codriver":
918 return 1;
919 }
920
921 return -1;
922 }
923
925 {
926 return false;
927 }
928
930 {
931 return false;
932 }
933
935 {
936 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
937 return false;
938
939 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
940 return false;
941
942 switch (currentSeat)
943 {
944 case 0:
945 return nextSeat == 1;
946
947 case 1:
948 return nextSeat == 0;
949
950 case 2:
951 return nextSeat == 3;
952
953 case 3:
954 return nextSeat == 2;
955 }
956
957 return false;
958 }
959
961 {
962 switch (pCurrentSeat)
963 {
964 case 0:
965 return pDoorsSelection == "DoorsDriver";
966
967 case 1:
968 return pDoorsSelection == "DoorsCoDriver";
969
970 case 2:
971 return pDoorsSelection == "DoorsDriver";
972
973 case 3:
974 return pDoorsSelection == "DoorsCoDriver";
975 }
976
977 return false;
978 }
979
981 {
982 switch (pDoorSelection)
983 {
984 case "DoorsDriver":
985 return 0;
986 case "DoorsCoDriver":
987 return 1;
988 }
989
990 return -1;
991 }
992
994 {
995 super.SetActions();
996
998 }
999
1001 {
1002 SpawnUniversalParts();
1003 SpawnAdditionalItems();
1004 FillUpCarFluids();
1005
1006 GetInventory().CreateInInventory("HatchbackWheel");
1007 GetInventory().CreateInInventory("HatchbackWheel");
1008 GetInventory().CreateInInventory("HatchbackWheel" );
1009 GetInventory().CreateInInventory("HatchbackWheel");
1010
1011 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1012 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1013 GetInventory().CreateInInventory("HatchbackHood");
1014 GetInventory().CreateInInventory("HatchbackTrunk");
1015
1016
1017 GetInventory().CreateInInventory("HatchbackWheel");
1018 GetInventory().CreateInInventory("HatchbackWheel");
1019 }
1020}
1021
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_White");
1036 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1037 GetInventory().CreateInInventory("HatchbackHood_White");
1038 GetInventory().CreateInInventory("HatchbackTrunk_White");
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_Blue");
1060 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1061 GetInventory().CreateInInventory("HatchbackHood_Blue");
1062 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1063
1064
1065 GetInventory().CreateInInventory("HatchbackWheel");
1066 GetInventory().CreateInInventory("HatchbackWheel");
1067 }
1068}
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.