538{
542
544 {
545
546
547 m_EngineStartOK = "offroad_engine_start_SoundSet";
548 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
549 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
550 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
551 m_EngineStop = "offroad_engine_stop_SoundSet";
552 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
553
554 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
555 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
556 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
557 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
558
559 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
560 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
561
562 SetEnginePos("0 0.7 1.2");
563 }
564
566 {
567 super.EEInit();
568
570 {
577
580 }
581 }
582
584 {
585 super.OnEngineStart();
586
588 {
590 }
591 }
592
594 {
595 super.OnEngineStop();
596
598 {
600 }
601 }
602
604 {
606 {
608 {
610 }
611 }
612 }
613
615 {
617 }
618
620 {
621 return 3.5;
622 }
623
625 {
626 switch (posIdx)
627 {
628 case 0:
630 case 1:
632 case 2:
634 case 3:
636 }
637
638 return 0;
639
640 }
641
642
644 {
646 }
647
649 {
651 }
652
654 {
655 if (!super.CanReleaseAttachment(attachment))
656 {
657 return false;
658 }
659
661 {
662 string attType = attachment.GetType();
663 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
664 {
665 return false;
666 }
667 }
668
669 return true;
670 }
671
673 {
675 }
676
678 {
679 if (!super.CanDisplayAttachmentCategory(category_name))
680 {
681 return false;
682 }
683
685 if (category_name.
Contains(
"engine"))
686 {
688 {
689 return false;
690 }
691 }
692
693 return true;
694 }
695
697 {
698 if (!super.CanDisplayCargo())
699 {
700 return false;
701 }
702
704 {
705 return false;
706 }
707
708 return true;
709 }
710
712 {
714
715 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
716 if (!carDoor)
717 {
719 }
720
721 switch (slotType)
722 {
723 case "NivaDriverDoors":
724 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
725
726 case "NivaCoDriverDoors":
727 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
728
729 case "NivaHood":
730 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
731
732 case "NivaTrunk":
733 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
734 }
735
737 }
738
740 {
742 switch (posIdx)
743 {
744 case 0:
746 return false;
747 else if (GetAnimationPhase("SeatDriver") > 0.5)
748 return false;
749
750 return true;
751
752 case 1:
754 return false;
755 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
756 return false;
757
758 return true;
759
760 case 2:
762 return false;
763 else if (GetAnimationPhase("SeatDriver") <= 0.5)
764 return false;
765
766 return true;
767
768 case 3:
770 return false;
771 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
772 return false;
773
774 return true;
775 }
776
777 return false;
778 }
779
781 {
782 switch (posIdx)
783 {
784 case 0:
785 case 2:
786 return "doors_driver";
787 case 1:
788 case 3:
789 return "doors_codriver";
790 }
791
792 return super.GetDoorSelectionNameFromSeatPos(posIdx);
793 }
794
796 {
797 switch (posIdx)
798 {
799 case 0:
800 case 2:
801 return "NivaDriverDoors";
802 case 1:
803 case 3:
804 return "NivaCoDriverDoors";
805 }
806
807 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
808 }
809
810
811
813 {
814 float tempCap = 0.0;
815
816 switch (ctrl)
817 {
819 float newValue = 0;
821 {
822 newValue += 0.5;
823 }
824
826 {
827 newValue += 0.5;
828 }
829
831 {
832 newValue += 0.3;
833 }
834
836 {
837 newValue -= 0.6;
838 }
839
841 {
842 newValue -= 0.2;
843 }
844
846 {
847 newValue -= 0.2;
848 }
849
851 break;
852 }
853
854 return super.OnSound(ctrl, oldValue);
855 }
856
858 {
859 switch (selection)
860 {
861 case "doors_driver":
862 return "DoorsDriver";
863 case "doors_codriver":
864 return "DoorsCoDriver";
865 case "doors_hood":
866 return "DoorsHood";
867 case "doors_trunk":
868 return "DoorsTrunk";
869 case "seatback_driver":
870 return "SeatDriver";
871 case "seatback_codriver":
872 return "SeatCoDriver";
873 }
874
875 return "";
876 }
877
879 {
880 switch (selection)
881 {
882 case "seat_driver":
883 case "seatback_driver":
884 case "seat_cargo1":
885 return "seat_con_1_1";
886 case "seat_codriver":
887 case "seatback_codriver":
888 case "seat_cargo2":
889 return "seat_con_2_1";
890 }
891
892 return "";
893 }
894
896 {
897 switch (selection)
898 {
899 case "seatback_driver":
900 return 0;
901 case "seatback_codriver":
902 return 1;
903 }
904
905 return -1;
906 }
907
909 {
910 return false;
911 }
912
914 {
915 return false;
916 }
917
919 {
920 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
921 return false;
922
923 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
924 return false;
925
926 switch (currentSeat)
927 {
928 case 0:
929 return nextSeat == 1;
930
931 case 1:
932 return nextSeat == 0;
933
934 case 2:
935 return nextSeat == 3;
936
937 case 3:
938 return nextSeat == 2;
939 }
940
941 return false;
942 }
943
945 {
946 switch (pCurrentSeat)
947 {
948 case 0:
949 return pDoorsSelection == "DoorsDriver";
950
951 case 1:
952 return pDoorsSelection == "DoorsCoDriver";
953
954 case 2:
955 return pDoorsSelection == "DoorsDriver";
956
957 case 3:
958 return pDoorsSelection == "DoorsCoDriver";
959 }
960
961 return false;
962 }
963
965 {
966 switch (pDoorSelection)
967 {
968 case "DoorsDriver":
969 return 0;
970 case "DoorsCoDriver":
971 return 1;
972 }
973
974 return -1;
975 }
976
978 {
979 super.SetActions();
980
982 }
983
985 {
986 SpawnUniversalParts();
987 SpawnAdditionalItems();
988 FillUpCarFluids();
989
990 GetInventory().CreateInInventory("HatchbackWheel");
991 GetInventory().CreateInInventory("HatchbackWheel");
992 GetInventory().CreateInInventory("HatchbackWheel" );
993 GetInventory().CreateInInventory("HatchbackWheel");
994
995 GetInventory().CreateInInventory("HatchbackDoors_Driver");
996 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
997 GetInventory().CreateInInventory("HatchbackHood");
998 GetInventory().CreateInInventory("HatchbackTrunk");
999
1000
1001 GetInventory().CreateInInventory("HatchbackWheel");
1002 GetInventory().CreateInInventory("HatchbackWheel");
1003 }
1004}
1005
1007{
1009 {
1010 SpawnUniversalParts();
1011 SpawnAdditionalItems();
1012 FillUpCarFluids();
1013
1014 GetInventory().CreateInInventory("HatchbackWheel");
1015 GetInventory().CreateInInventory("HatchbackWheel");
1016 GetInventory().CreateInInventory("HatchbackWheel");
1017 GetInventory().CreateInInventory("HatchbackWheel");
1018
1019 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1020 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1021 GetInventory().CreateInInventory("HatchbackHood_White");
1022 GetInventory().CreateInInventory("HatchbackTrunk_White");
1023
1024
1025 GetInventory().CreateInInventory("HatchbackWheel");
1026 GetInventory().CreateInInventory("HatchbackWheel");
1027 }
1028}
1029
1031{
1033 {
1034 SpawnUniversalParts();
1035 SpawnAdditionalItems();
1036 FillUpCarFluids();
1037
1038 GetInventory().CreateInInventory("HatchbackWheel");
1039 GetInventory().CreateInInventory("HatchbackWheel");
1040 GetInventory().CreateInInventory("HatchbackWheel");
1041 GetInventory().CreateInInventory("HatchbackWheel");
1042
1043 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1044 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1045 GetInventory().CreateInInventory("HatchbackHood_Blue");
1046 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1047
1048
1049 GetInventory().CreateInInventory("HatchbackWheel");
1050 GetInventory().CreateInInventory("HatchbackWheel");
1051 }
1052}
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.