518{
522
524 {
525
526
527 m_EngineStartOK = "offroad_engine_start_SoundSet";
528 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
529 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
530 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
531 m_EngineStop = "offroad_engine_stop_SoundSet";
532 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
533
534 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
535 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
536 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
537 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
538
539 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
540 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
541
542 SetEnginePos("0 0.7 1.2");
543 }
544
546 {
547 super.EEInit();
548
550 {
557
560 }
561 }
562
564 {
565 super.OnEngineStart();
566
568 {
570 }
571 }
572
574 {
575 super.OnEngineStop();
576
578 {
580 }
581 }
582
584 {
586 {
588 {
590 }
591 }
592 }
593
595 {
597 }
598
600 {
601 return 3.5;
602 }
603
605 {
606 switch (posIdx)
607 {
608 case 0:
610 case 1:
612 case 2:
614 case 3:
616 }
617
618 return 0;
619
620 }
621
622
624 {
626 }
627
629 {
631 }
632
634 {
635 if (!super.CanReleaseAttachment(attachment))
636 {
637 return false;
638 }
639
641 {
642 string attType = attachment.GetType();
643 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
644 {
645 return false;
646 }
647 }
648
649 return true;
650 }
651
653 {
655 }
656
658 {
659 if (!super.CanDisplayAttachmentCategory(category_name))
660 {
661 return false;
662 }
663
665 if (category_name.
Contains(
"engine"))
666 {
668 {
669 return false;
670 }
671 }
672
673 return true;
674 }
675
677 {
678 if (!super.CanDisplayCargo())
679 {
680 return false;
681 }
682
684 {
685 return false;
686 }
687
688 return true;
689 }
690
692 {
694
695 Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
696 if (!carDoor)
697 {
699 }
700
701 switch (slotType)
702 {
703 case "NivaDriverDoors":
704 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
705
706 case "NivaCoDriverDoors":
707 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
708
709 case "NivaHood":
710 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
711
712 case "NivaTrunk":
713 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
714 }
715
717 }
718
720 {
722 switch (posIdx)
723 {
724 case 0:
726 return false;
727 else if (GetAnimationPhase("SeatDriver") > 0.5)
728 return false;
729
730 return true;
731
732 case 1:
734 return false;
735 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
736 return false;
737
738 return true;
739
740 case 2:
742 return false;
743 else if (GetAnimationPhase("SeatDriver") <= 0.5)
744 return false;
745
746 return true;
747
748 case 3:
750 return false;
751 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
752 return false;
753
754 return true;
755 }
756
757 return false;
758 }
759
761 {
762 switch (posIdx)
763 {
764 case 0:
765 case 2:
766 return "doors_driver";
767 case 1:
768 case 3:
769 return "doors_codriver";
770 }
771
772 return super.GetDoorSelectionNameFromSeatPos(posIdx);
773 }
774
776 {
777 switch (posIdx)
778 {
779 case 0:
780 case 2:
781 return "NivaDriverDoors";
782 case 1:
783 case 3:
784 return "NivaCoDriverDoors";
785 }
786
787 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
788 }
789
790
791
793 {
794 float tempCap = 0.0;
795
796 switch (ctrl)
797 {
799 float newValue = 0;
801 {
802 newValue += 0.5;
803 }
804
806 {
807 newValue += 0.5;
808 }
809
811 {
812 newValue += 0.3;
813 }
814
816 {
817 newValue -= 0.6;
818 }
819
821 {
822 newValue -= 0.2;
823 }
824
826 {
827 newValue -= 0.2;
828 }
829
831 break;
832 }
833
834 return super.OnSound(ctrl, oldValue);
835 }
836
838 {
839 switch (selection)
840 {
841 case "doors_driver":
842 return "DoorsDriver";
843 case "doors_codriver":
844 return "DoorsCoDriver";
845 case "doors_hood":
846 return "DoorsHood";
847 case "doors_trunk":
848 return "DoorsTrunk";
849 case "seatback_driver":
850 return "SeatDriver";
851 case "seatback_codriver":
852 return "SeatCoDriver";
853 }
854
855 return "";
856 }
857
859 {
860 switch (selection)
861 {
862 case "seat_driver":
863 case "seatback_driver":
864 case "seat_cargo1":
865 return "seat_con_1_1";
866 case "seat_codriver":
867 case "seatback_codriver":
868 case "seat_cargo2":
869 return "seat_con_2_1";
870 }
871
872 return "";
873 }
874
876 {
877 switch (selection)
878 {
879 case "seatback_driver":
880 return 0;
881 case "seatback_codriver":
882 return 1;
883 }
884
885 return -1;
886 }
887
889 {
890 return false;
891 }
892
894 {
895 return false;
896 }
897
899 {
900 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
901 return false;
902
903 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
904 return false;
905
906 switch (currentSeat)
907 {
908 case 0:
909 return nextSeat == 1;
910
911 case 1:
912 return nextSeat == 0;
913
914 case 2:
915 return nextSeat == 3;
916
917 case 3:
918 return nextSeat == 2;
919 }
920
921 return false;
922 }
923
925 {
926 switch (pCurrentSeat)
927 {
928 case 0:
929 return pDoorsSelection == "DoorsDriver";
930
931 case 1:
932 return pDoorsSelection == "DoorsCoDriver";
933
934 case 2:
935 return pDoorsSelection == "DoorsDriver";
936
937 case 3:
938 return pDoorsSelection == "DoorsCoDriver";
939 }
940
941 return false;
942 }
943
945 {
946 switch (pDoorSelection)
947 {
948 case "DoorsDriver":
949 return 0;
950 case "DoorsCoDriver":
951 return 1;
952 }
953
954 return -1;
955 }
956
958 {
959 super.SetActions();
960
962 }
963
965 {
966 SpawnUniversalParts();
967 SpawnAdditionalItems();
968 FillUpCarFluids();
969
970 GetInventory().CreateInInventory("HatchbackWheel");
971 GetInventory().CreateInInventory("HatchbackWheel");
972 GetInventory().CreateInInventory("HatchbackWheel" );
973 GetInventory().CreateInInventory("HatchbackWheel");
974
975 GetInventory().CreateInInventory("HatchbackDoors_Driver");
976 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
977 GetInventory().CreateInInventory("HatchbackHood");
978 GetInventory().CreateInInventory("HatchbackTrunk");
979
980
981 GetInventory().CreateInInventory("HatchbackWheel");
982 GetInventory().CreateInInventory("HatchbackWheel");
983 }
984}
985
987{
989 {
990 SpawnUniversalParts();
991 SpawnAdditionalItems();
992 FillUpCarFluids();
993
994 GetInventory().CreateInInventory("HatchbackWheel");
995 GetInventory().CreateInInventory("HatchbackWheel");
996 GetInventory().CreateInInventory("HatchbackWheel");
997 GetInventory().CreateInInventory("HatchbackWheel");
998
999 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1000 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1001 GetInventory().CreateInInventory("HatchbackHood_White");
1002 GetInventory().CreateInInventory("HatchbackTrunk_White");
1003
1004
1005 GetInventory().CreateInInventory("HatchbackWheel");
1006 GetInventory().CreateInInventory("HatchbackWheel");
1007 }
1008}
1009
1011{
1013 {
1014 SpawnUniversalParts();
1015 SpawnAdditionalItems();
1016 FillUpCarFluids();
1017
1018 GetInventory().CreateInInventory("HatchbackWheel");
1019 GetInventory().CreateInInventory("HatchbackWheel");
1020 GetInventory().CreateInInventory("HatchbackWheel");
1021 GetInventory().CreateInInventory("HatchbackWheel");
1022
1023 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1024 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1025 GetInventory().CreateInInventory("HatchbackHood_Blue");
1026 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1027
1028
1029 GetInventory().CreateInInventory("HatchbackWheel");
1030 GetInventory().CreateInInventory("HatchbackWheel");
1031 }
1032}
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.