DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл OffroadHatchback.c

См. исходные тексты.

Структуры данных

class  CarScript
 
class  OffroadHatchback
 

Функции

class OffroadHatchback extends CarScript OnDebugSpawn ()
 
void OffroadHatchback ()
 
override void EEInit ()
 
override void OnEngineStart ()
 
override void OnEngineStop ()
 
override void EOnPostSimulate (IEntity other, float timeSlice)
 
override int GetAnimInstance ()
 
override float GetTransportCameraDistance ()
 
override int GetSeatAnimationType (int posIdx)
 
override CarRearLightBase CreateRearLight ()
 
override CarLightBase CreateFrontLight ()
 
override bool CanReleaseAttachment (EntityAI attachment)
 
bool CanManipulateSpareWheel (string slotSelectionName)
 
override bool CanDisplayAttachmentCategory (string category_name)
 
override bool CanDisplayCargo ()
 
override int GetCarDoorsState (string slotType)
 
override bool CrewCanGetThrough (int posIdx)
 
override string GetDoorSelectionNameFromSeatPos (int posIdx)
 
override string GetDoorInvSlotNameFromSeatPos (int posIdx)
 
override float OnSound (CarSoundCtrl ctrl, float oldValue)
 
override string GetAnimSourceFromSelection (string selection)
 
override string GetDoorConditionPointFromSelection (string selection)
 
override int GetCrewIndex (string selection)
 
override bool IsVitalTruckBattery ()
 
override bool IsVitalGlowPlug ()
 
override bool CanReachSeatFromSeat (int currentSeat, int nextSeat)
 
override bool CanReachDoorsFromSeat (string pDoorsSelection, int pCurrentSeat)
 
override int GetSeatIndexFromDoor (string pDoorSelection)
 
override void SetActions ()
 

Переменные

ref UniversalTemperatureSource m_UTSource
 
ref UniversalTemperatureSourceSettings m_UTSSettings
 
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
 

Функции

◆ CanDisplayAttachmentCategory()

override bool CanDisplayAttachmentCategory ( string category_name)
protected

◆ CanDisplayCargo()

override bool CanDisplayCargo ( )
protected
633{
637
638 void OffroadHatchback()
639 {
640 //m_dmgContactCoef = 0.075;
641
642 m_EngineStartOK = "offroad_engine_start_SoundSet";
643 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
644 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
645 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
646 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
647
648 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
649 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
650 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
651 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
652
653 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
654 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
655
656 SetEnginePos("0 0.7 1.2");
657 }
658
659 override void EEInit()
660 {
661 super.EEInit();
662
663 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
664 {
666 m_UTSSettings.m_ManualUpdate = true;
667 m_UTSSettings.m_TemperatureMin = 0;
668 m_UTSSettings.m_TemperatureMax = 30;
670 m_UTSSettings.m_TemperatureCap = 0;
671 m_UTSSettings.m_RangeFull = 0.5;
672 m_UTSSettings.m_RangeMax = 2;
673
676 }
677 }
678
679 override void OnEngineStart()
680 {
681 super.OnEngineStart();
682
683 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
684 {
685 m_UTSource.SetDefferedActive(true, 20.0);
686 }
687 }
688
689 override void OnEngineStop()
690 {
691 super.OnEngineStop();
692
693 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
694 {
695 m_UTSource.SetDefferedActive(false, 10.0);
696 }
697 }
698
699 override void EOnPostSimulate(IEntity other, float timeSlice)
700 {
701 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
702 {
703 if (m_UTSource.IsActive())
704 {
706 }
707 }
708 }
709
710 override int GetAnimInstance()
711 {
712 return VehicleAnimInstances.HATCHBACK;
713 }
714
715 override float GetTransportCameraDistance()
716 {
717 return 3.5;
718 }
719
720 override int GetSeatAnimationType( int posIdx )
721 {
722 switch (posIdx)
723 {
724 case 0:
725 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
726 case 1:
727 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
728 case 2:
729 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
730 case 3:
731 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
732 }
733
734 return 0;
735
736 }
737
738
740 {
741 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
742 }
743
745 {
746 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
747 }
748
750 {
751 if (!super.CanReleaseAttachment(attachment))
752 {
753 return false;
754 }
755
756 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
757 {
758 string attType = attachment.GetType();
759 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
760 {
761 return false;
762 }
763 }
764
765 return true;
766 }
767
768 override protected bool CanManipulateSpareWheel(string slotSelectionName)
769 {
770 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
771 }
772
773 override bool CanDisplayAttachmentCategory( string category_name )
774 {
775 if (!super.CanDisplayAttachmentCategory(category_name))
776 {
777 return false;
778 }
779
780 category_name.ToLower();
781 if (category_name.Contains("engine"))
782 {
783 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
784 {
785 return false;
786 }
787 }
788
789 return true;
790 }
791
792 override bool CanDisplayCargo()
793 {
794 if (!super.CanDisplayCargo())
795 {
796 return false;
797 }
798
799 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
800 {
801 return false;
802 }
803
804 return true;
805 }
806
807 override int GetCarDoorsState(string slotType)
808 {
810
811 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
812 if (!carDoor)
813 {
814 return CarDoorState.DOORS_MISSING;
815 }
816
817 switch (slotType)
818 {
819 case "NivaDriverDoors":
820 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
821
822 case "NivaCoDriverDoors":
823 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
824
825 case "NivaHood":
826 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
827
828 case "NivaTrunk":
829 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
830 }
831
832 return CarDoorState.DOORS_MISSING;
833 }
834
835 override bool CrewCanGetThrough(int posIdx)
836 {
838 switch (posIdx)
839 {
840 case 0:
841 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
842 return false;
843 else if (GetAnimationPhase("SeatDriver") > 0.5)
844 return false;
845
846 return true;
847
848 case 1:
849 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
850 return false;
851 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
852 return false;
853
854 return true;
855
856 case 2:
857 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
858 return false;
859 else if (GetAnimationPhase("SeatDriver") <= 0.5)
860 return false;
861
862 return true;
863
864 case 3:
865 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
866 return false;
867 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
868 return false;
869
870 return true;
871 }
872
873 return false;
874 }
875
876 override string GetDoorSelectionNameFromSeatPos(int posIdx)
877 {
878 switch (posIdx)
879 {
880 case 0:
881 case 2:
882 return "doors_driver";
883 case 1:
884 case 3:
885 return "doors_codriver";
886 }
887
888 return super.GetDoorSelectionNameFromSeatPos(posIdx);
889 }
890
891 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
892 {
893 switch (posIdx)
894 {
895 case 0:
896 case 2:
897 return "NivaDriverDoors";
898 case 1:
899 case 3:
900 return "NivaCoDriverDoors";
901 }
902
903 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
904 }
905
906 // 0 full ambient and engine sound
907 // 1 zero ambient and engine sound
908 override float OnSound(CarSoundCtrl ctrl, float oldValue)
909 {
910 float tempCap = 0.0;
911
912 switch (ctrl)
913 {
914 case CarSoundCtrl.DOORS:
915 float newValue = 0;
916 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
917 {
918 newValue += 0.5;
919 }
920
921 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
922 {
923 newValue += 0.5;
924 }
925
926 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
927 {
928 newValue += 0.3;
929 }
930
931 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
932 {
933 newValue -= 0.6;
934 }
935
936 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
937 {
938 newValue -= 0.2;
939 }
940
941 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
942 {
943 newValue -= 0.2;
944 }
945
946 return Math.Clamp(newValue, 0, 1);
947 break;
948 }
949
950 return super.OnSound(ctrl, oldValue);
951 }
952
953 override string GetAnimSourceFromSelection( string selection )
954 {
955 switch (selection)
956 {
957 case "doors_driver":
958 return "DoorsDriver";
959 case "doors_codriver":
960 return "DoorsCoDriver";
961 case "doors_hood":
962 return "DoorsHood";
963 case "doors_trunk":
964 return "DoorsTrunk";
965 case "seatback_driver":
966 return "SeatDriver";
967 case "seatback_codriver":
968 return "SeatCoDriver";
969 }
970
971 return "";
972 }
973
974 override string GetDoorConditionPointFromSelection(string selection)
975 {
976 switch (selection)
977 {
978 case "seat_driver":
979 case "seatback_driver":
980 case "seat_cargo1":
981 return "seat_con_1_1";
982 case "seat_codriver":
983 case "seatback_codriver":
984 case "seat_cargo2":
985 return "seat_con_2_1";
986 }
987
988 return "";
989 }
990
991 override int GetCrewIndex(string selection)
992 {
993 switch (selection)
994 {
995 case "seatback_driver":
996 return 0;
997 case "seatback_codriver":
998 return 1;
999 }
1000
1001 return -1;
1002 }
1003
1004 override bool IsVitalTruckBattery()
1005 {
1006 return false;
1007 }
1008
1009 override bool IsVitalGlowPlug()
1010 {
1011 return false;
1012 }
1013
1014 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1015 {
1016 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1017 return false;
1018
1019 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1020 return false;
1021
1022 switch (currentSeat)
1023 {
1024 case 0:
1025 return nextSeat == 1;
1026
1027 case 1:
1028 return nextSeat == 0;
1029
1030 case 2:
1031 return nextSeat == 3;
1032
1033 case 3:
1034 return nextSeat == 2;
1035 }
1036
1037 return false;
1038 }
1039
1040 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1041 {
1042 switch (pCurrentSeat)
1043 {
1044 case 0:
1045 return pDoorsSelection == "DoorsDriver";
1046
1047 case 1:
1048 return pDoorsSelection == "DoorsCoDriver";
1049
1050 case 2:
1051 return pDoorsSelection == "DoorsDriver";
1052
1053 case 3:
1054 return pDoorsSelection == "DoorsCoDriver";
1055 }
1056
1057 return false;
1058 }
1059
1060 override int GetSeatIndexFromDoor( string pDoorSelection )
1061 {
1062 switch (pDoorSelection)
1063 {
1064 case "DoorsDriver":
1065 return 0;
1066 case "DoorsCoDriver":
1067 return 1;
1068 }
1069
1070 return -1;
1071 }
1072
1073 override void SetActions()
1074 {
1075 super.SetActions();
1076
1078 }
1079
1080 override void OnDebugSpawn()
1081 {
1085
1086 GetInventory().CreateInInventory("HatchbackWheel");
1087 GetInventory().CreateInInventory("HatchbackWheel");
1088 GetInventory().CreateInInventory("HatchbackWheel" );
1089 GetInventory().CreateInInventory("HatchbackWheel");
1090
1091 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1092 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1093 GetInventory().CreateInInventory("HatchbackHood");
1094 GetInventory().CreateInInventory("HatchbackTrunk");
1095
1096 //-----IN CAR CARGO
1097 GetInventory().CreateInInventory("HatchbackWheel");
1098 GetInventory().CreateInInventory("HatchbackWheel");
1099 }
1100}
1101
1103{
1104 override void OnDebugSpawn()
1105 {
1109
1110 GetInventory().CreateInInventory("HatchbackWheel");
1111 GetInventory().CreateInInventory("HatchbackWheel");
1112 GetInventory().CreateInInventory("HatchbackWheel");
1113 GetInventory().CreateInInventory("HatchbackWheel");
1114
1115 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1116 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1117 GetInventory().CreateInInventory("HatchbackHood_White");
1118 GetInventory().CreateInInventory("HatchbackTrunk_White");
1119
1120 //-----IN CAR CARGO
1121 GetInventory().CreateInInventory("HatchbackWheel");
1122 GetInventory().CreateInInventory("HatchbackWheel");
1123 }
1124}
1125
1127{
1128 override void OnDebugSpawn()
1129 {
1133
1134 GetInventory().CreateInInventory("HatchbackWheel");
1135 GetInventory().CreateInInventory("HatchbackWheel");
1136 GetInventory().CreateInInventory("HatchbackWheel");
1137 GetInventory().CreateInInventory("HatchbackWheel");
1138
1139 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1140 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1141 GetInventory().CreateInInventory("HatchbackHood_Blue");
1142 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1143
1144 //-----IN CAR CARGO
1145 GetInventory().CreateInInventory("HatchbackWheel");
1146 GetInventory().CreateInInventory("HatchbackWheel");
1147 }
1148}
void AddAction(typename actionName)
Definition AdvancedCommunication.c:220
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
Definition Car.c:4
void SpawnUniversalParts()
Definition CarScript.c:2761
string m_CarSeatShiftInSound
Definition CarScript.c:215
CarDoorState TranslateAnimationPhaseToCarDoorState(string animation)
Definition CarScript.c:2474
CarDoorState
Definition CarScript.c:2
void SpawnAdditionalItems()
Definition CarScript.c:2799
string m_EngineStartOK
Sounds.
Definition CarScript.c:207
string m_CarDoorCloseSound
Definition CarScript.c:214
string m_EngineStartBattery
Definition CarScript.c:208
string m_EngineStartPlug
Definition CarScript.c:209
string m_EngineStartFuel
Definition CarScript.c:210
string m_CarHornShortSoundName
Definition CarScript.c:218
void FillUpCarFluids()
Definition CarScript.c:2829
string m_CarHornLongSoundName
Definition CarScript.c:219
string m_EngineStopFuel
Definition CarScript.c:211
string m_CarSeatShiftOutSound
Definition CarScript.c:216
string m_CarDoorOpenSound
Definition CarScript.c:213
class Hatchback_02_Blue extends Hatchback_02 OnDebugSpawn
Definition Hatchback_02.c:405
override int GetCarDoorsState(string slotType)
Definition OffroadHatchback.c:647
override bool CanDisplayAttachmentCategory(string category_name)
Definition OffroadHatchback.c:613
override void EOnPostSimulate(IEntity other, float timeSlice)
Definition OffroadHatchback.c:539
ref UniversalTemperatureSourceSettings m_UTSSettings
Definition OffroadHatchback.c:475
override float GetTransportCameraDistance()
Definition OffroadHatchback.c:555
override bool IsVitalGlowPlug()
Definition OffroadHatchback.c:849
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
Definition OffroadHatchback.c:880
override bool CanDisplayCargo()
Definition OffroadHatchback.c:632
override int GetAnimInstance()
Definition OffroadHatchback.c:550
override bool CrewCanGetThrough(int posIdx)
Definition OffroadHatchback.c:675
override CarLightBase CreateFrontLight()
Definition OffroadHatchback.c:584
override int GetSeatIndexFromDoor(string pDoorSelection)
Definition OffroadHatchback.c:900
override CarRearLightBase CreateRearLight()
Definition OffroadHatchback.c:579
override void EEInit()
Definition OffroadHatchback.c:499
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
Definition OffroadHatchback.c:476
override float OnSound(CarSoundCtrl ctrl, float oldValue)
Definition OffroadHatchback.c:748
override bool IsVitalTruckBattery()
Definition OffroadHatchback.c:844
override int GetCrewIndex(string selection)
Definition OffroadHatchback.c:831
override bool CanReleaseAttachment(EntityAI attachment)
Definition OffroadHatchback.c:589
override void OnEngineStart()
Definition OffroadHatchback.c:519
override string GetAnimSourceFromSelection(string selection)
Definition OffroadHatchback.c:793
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
Definition OffroadHatchback.c:854
override string GetDoorConditionPointFromSelection(string selection)
Definition OffroadHatchback.c:814
override string GetDoorSelectionNameFromSeatPos(int posIdx)
Definition OffroadHatchback.c:716
override int GetSeatAnimationType(int posIdx)
Definition OffroadHatchback.c:560
ref UniversalTemperatureSource m_UTSource
Definition OffroadHatchback.c:474
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
Definition OffroadHatchback.c:731
class OffroadHatchback extends CarScript OnDebugSpawn()
Definition OffroadHatchback.c:473
bool CanManipulateSpareWheel(string slotSelectionName)
Definition OffroadHatchback.c:608
override void SetActions()
Definition OffroadHatchback.c:913
void OffroadHatchback()
Definition OffroadHatchback.c:478
override void OnEngineStop()
Definition OffroadHatchback.c:529
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
Definition UniversalTemperatureSourceLambdaBaseImpl.c:175
VehicleAnimInstances
Definition VehicleAnimInstances.c:2
Definition ActionAnimateSeats.c:2
Definition InventoryItem.c:496
Definition CarRearLightBase.c:2
Definition CivilianSedanRearLight.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Building.c:6
Definition constants.c:638
Definition EnEntity.c:165
Definition EnMath.c:7
Definition OffroadHatchback.c:496
Definition EntityAI.c:95
Definition PointLightBase.c:2
original Timer deletes m_params which is unwanted
Definition UniversalTemperatureSource.c:28
Definition UniversalTemperatureSource.c:2
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
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
Definition constants.c:777
const int STATE_RUINED
Definition constants.c:807
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'.

◆ CanManipulateSpareWheel()

bool CanManipulateSpareWheel ( string slotSelectionName)
protected
609{
613
614 void OffroadHatchback()
615 {
616 //m_dmgContactCoef = 0.075;
617
618 m_EngineStartOK = "offroad_engine_start_SoundSet";
619 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
620 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
621 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
622 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
623
624 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
625 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
626 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
627 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
628
629 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
630 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
631
632 SetEnginePos("0 0.7 1.2");
633 }
634
635 override void EEInit()
636 {
637 super.EEInit();
638
639 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
640 {
642 m_UTSSettings.m_ManualUpdate = true;
643 m_UTSSettings.m_TemperatureMin = 0;
644 m_UTSSettings.m_TemperatureMax = 30;
646 m_UTSSettings.m_TemperatureCap = 0;
647 m_UTSSettings.m_RangeFull = 0.5;
648 m_UTSSettings.m_RangeMax = 2;
649
652 }
653 }
654
655 override void OnEngineStart()
656 {
657 super.OnEngineStart();
658
659 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
660 {
661 m_UTSource.SetDefferedActive(true, 20.0);
662 }
663 }
664
665 override void OnEngineStop()
666 {
667 super.OnEngineStop();
668
669 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
670 {
671 m_UTSource.SetDefferedActive(false, 10.0);
672 }
673 }
674
675 override void EOnPostSimulate(IEntity other, float timeSlice)
676 {
677 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
678 {
679 if (m_UTSource.IsActive())
680 {
682 }
683 }
684 }
685
686 override int GetAnimInstance()
687 {
688 return VehicleAnimInstances.HATCHBACK;
689 }
690
691 override float GetTransportCameraDistance()
692 {
693 return 3.5;
694 }
695
696 override int GetSeatAnimationType( int posIdx )
697 {
698 switch (posIdx)
699 {
700 case 0:
701 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
702 case 1:
703 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
704 case 2:
705 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
706 case 3:
707 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
708 }
709
710 return 0;
711
712 }
713
714
716 {
717 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
718 }
719
721 {
722 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
723 }
724
726 {
727 if (!super.CanReleaseAttachment(attachment))
728 {
729 return false;
730 }
731
732 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
733 {
734 string attType = attachment.GetType();
735 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
736 {
737 return false;
738 }
739 }
740
741 return true;
742 }
743
744 override protected bool CanManipulateSpareWheel(string slotSelectionName)
745 {
746 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
747 }
748
749 override bool CanDisplayAttachmentCategory( string category_name )
750 {
751 if (!super.CanDisplayAttachmentCategory(category_name))
752 {
753 return false;
754 }
755
756 category_name.ToLower();
757 if (category_name.Contains("engine"))
758 {
759 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
760 {
761 return false;
762 }
763 }
764
765 return true;
766 }
767
768 override bool CanDisplayCargo()
769 {
770 if (!super.CanDisplayCargo())
771 {
772 return false;
773 }
774
775 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
776 {
777 return false;
778 }
779
780 return true;
781 }
782
783 override int GetCarDoorsState(string slotType)
784 {
786
787 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
788 if (!carDoor)
789 {
790 return CarDoorState.DOORS_MISSING;
791 }
792
793 switch (slotType)
794 {
795 case "NivaDriverDoors":
796 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
797
798 case "NivaCoDriverDoors":
799 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
800
801 case "NivaHood":
802 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
803
804 case "NivaTrunk":
805 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
806 }
807
808 return CarDoorState.DOORS_MISSING;
809 }
810
811 override bool CrewCanGetThrough(int posIdx)
812 {
814 switch (posIdx)
815 {
816 case 0:
817 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
818 return false;
819 else if (GetAnimationPhase("SeatDriver") > 0.5)
820 return false;
821
822 return true;
823
824 case 1:
825 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
826 return false;
827 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
828 return false;
829
830 return true;
831
832 case 2:
833 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
834 return false;
835 else if (GetAnimationPhase("SeatDriver") <= 0.5)
836 return false;
837
838 return true;
839
840 case 3:
841 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
842 return false;
843 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
844 return false;
845
846 return true;
847 }
848
849 return false;
850 }
851
852 override string GetDoorSelectionNameFromSeatPos(int posIdx)
853 {
854 switch (posIdx)
855 {
856 case 0:
857 case 2:
858 return "doors_driver";
859 case 1:
860 case 3:
861 return "doors_codriver";
862 }
863
864 return super.GetDoorSelectionNameFromSeatPos(posIdx);
865 }
866
867 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
868 {
869 switch (posIdx)
870 {
871 case 0:
872 case 2:
873 return "NivaDriverDoors";
874 case 1:
875 case 3:
876 return "NivaCoDriverDoors";
877 }
878
879 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
880 }
881
882 // 0 full ambient and engine sound
883 // 1 zero ambient and engine sound
884 override float OnSound(CarSoundCtrl ctrl, float oldValue)
885 {
886 float tempCap = 0.0;
887
888 switch (ctrl)
889 {
890 case CarSoundCtrl.DOORS:
891 float newValue = 0;
892 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
893 {
894 newValue += 0.5;
895 }
896
897 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
898 {
899 newValue += 0.5;
900 }
901
902 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
903 {
904 newValue += 0.3;
905 }
906
907 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
908 {
909 newValue -= 0.6;
910 }
911
912 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
913 {
914 newValue -= 0.2;
915 }
916
917 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
918 {
919 newValue -= 0.2;
920 }
921
922 return Math.Clamp(newValue, 0, 1);
923 break;
924 }
925
926 return super.OnSound(ctrl, oldValue);
927 }
928
929 override string GetAnimSourceFromSelection( string selection )
930 {
931 switch (selection)
932 {
933 case "doors_driver":
934 return "DoorsDriver";
935 case "doors_codriver":
936 return "DoorsCoDriver";
937 case "doors_hood":
938 return "DoorsHood";
939 case "doors_trunk":
940 return "DoorsTrunk";
941 case "seatback_driver":
942 return "SeatDriver";
943 case "seatback_codriver":
944 return "SeatCoDriver";
945 }
946
947 return "";
948 }
949
950 override string GetDoorConditionPointFromSelection(string selection)
951 {
952 switch (selection)
953 {
954 case "seat_driver":
955 case "seatback_driver":
956 case "seat_cargo1":
957 return "seat_con_1_1";
958 case "seat_codriver":
959 case "seatback_codriver":
960 case "seat_cargo2":
961 return "seat_con_2_1";
962 }
963
964 return "";
965 }
966
967 override int GetCrewIndex(string selection)
968 {
969 switch (selection)
970 {
971 case "seatback_driver":
972 return 0;
973 case "seatback_codriver":
974 return 1;
975 }
976
977 return -1;
978 }
979
980 override bool IsVitalTruckBattery()
981 {
982 return false;
983 }
984
985 override bool IsVitalGlowPlug()
986 {
987 return false;
988 }
989
990 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
991 {
992 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
993 return false;
994
995 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
996 return false;
997
998 switch (currentSeat)
999 {
1000 case 0:
1001 return nextSeat == 1;
1002
1003 case 1:
1004 return nextSeat == 0;
1005
1006 case 2:
1007 return nextSeat == 3;
1008
1009 case 3:
1010 return nextSeat == 2;
1011 }
1012
1013 return false;
1014 }
1015
1016 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1017 {
1018 switch (pCurrentSeat)
1019 {
1020 case 0:
1021 return pDoorsSelection == "DoorsDriver";
1022
1023 case 1:
1024 return pDoorsSelection == "DoorsCoDriver";
1025
1026 case 2:
1027 return pDoorsSelection == "DoorsDriver";
1028
1029 case 3:
1030 return pDoorsSelection == "DoorsCoDriver";
1031 }
1032
1033 return false;
1034 }
1035
1036 override int GetSeatIndexFromDoor( string pDoorSelection )
1037 {
1038 switch (pDoorSelection)
1039 {
1040 case "DoorsDriver":
1041 return 0;
1042 case "DoorsCoDriver":
1043 return 1;
1044 }
1045
1046 return -1;
1047 }
1048
1049 override void SetActions()
1050 {
1051 super.SetActions();
1052
1054 }
1055
1056 override void OnDebugSpawn()
1057 {
1061
1062 GetInventory().CreateInInventory("HatchbackWheel");
1063 GetInventory().CreateInInventory("HatchbackWheel");
1064 GetInventory().CreateInInventory("HatchbackWheel" );
1065 GetInventory().CreateInInventory("HatchbackWheel");
1066
1067 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1068 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1069 GetInventory().CreateInInventory("HatchbackHood");
1070 GetInventory().CreateInInventory("HatchbackTrunk");
1071
1072 //-----IN CAR CARGO
1073 GetInventory().CreateInInventory("HatchbackWheel");
1074 GetInventory().CreateInInventory("HatchbackWheel");
1075 }
1076}
1077
1079{
1080 override void OnDebugSpawn()
1081 {
1085
1086 GetInventory().CreateInInventory("HatchbackWheel");
1087 GetInventory().CreateInInventory("HatchbackWheel");
1088 GetInventory().CreateInInventory("HatchbackWheel");
1089 GetInventory().CreateInInventory("HatchbackWheel");
1090
1091 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1092 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1093 GetInventory().CreateInInventory("HatchbackHood_White");
1094 GetInventory().CreateInInventory("HatchbackTrunk_White");
1095
1096 //-----IN CAR CARGO
1097 GetInventory().CreateInInventory("HatchbackWheel");
1098 GetInventory().CreateInInventory("HatchbackWheel");
1099 }
1100}
1101
1103{
1104 override void OnDebugSpawn()
1105 {
1109
1110 GetInventory().CreateInInventory("HatchbackWheel");
1111 GetInventory().CreateInInventory("HatchbackWheel");
1112 GetInventory().CreateInInventory("HatchbackWheel");
1113 GetInventory().CreateInInventory("HatchbackWheel");
1114
1115 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1116 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1117 GetInventory().CreateInInventory("HatchbackHood_Blue");
1118 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1119
1120 //-----IN CAR CARGO
1121 GetInventory().CreateInInventory("HatchbackWheel");
1122 GetInventory().CreateInInventory("HatchbackWheel");
1123 }
1124}

◆ CanReachDoorsFromSeat()

override bool CanReachDoorsFromSeat ( string pDoorsSelection,
int pCurrentSeat )
protected
881{
885
886 void OffroadHatchback()
887 {
888 //m_dmgContactCoef = 0.075;
889
890 m_EngineStartOK = "offroad_engine_start_SoundSet";
891 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
892 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
893 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
894 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
895
896 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
897 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
898 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
899 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
900
901 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
902 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
903
904 SetEnginePos("0 0.7 1.2");
905 }
906
907 override void EEInit()
908 {
909 super.EEInit();
910
911 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
912 {
914 m_UTSSettings.m_ManualUpdate = true;
915 m_UTSSettings.m_TemperatureMin = 0;
916 m_UTSSettings.m_TemperatureMax = 30;
918 m_UTSSettings.m_TemperatureCap = 0;
919 m_UTSSettings.m_RangeFull = 0.5;
920 m_UTSSettings.m_RangeMax = 2;
921
924 }
925 }
926
927 override void OnEngineStart()
928 {
929 super.OnEngineStart();
930
931 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
932 {
933 m_UTSource.SetDefferedActive(true, 20.0);
934 }
935 }
936
937 override void OnEngineStop()
938 {
939 super.OnEngineStop();
940
941 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
942 {
943 m_UTSource.SetDefferedActive(false, 10.0);
944 }
945 }
946
947 override void EOnPostSimulate(IEntity other, float timeSlice)
948 {
949 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
950 {
951 if (m_UTSource.IsActive())
952 {
954 }
955 }
956 }
957
958 override int GetAnimInstance()
959 {
960 return VehicleAnimInstances.HATCHBACK;
961 }
962
963 override float GetTransportCameraDistance()
964 {
965 return 3.5;
966 }
967
968 override int GetSeatAnimationType( int posIdx )
969 {
970 switch (posIdx)
971 {
972 case 0:
973 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
974 case 1:
975 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
976 case 2:
977 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
978 case 3:
979 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
980 }
981
982 return 0;
983
984 }
985
986
988 {
989 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
990 }
991
993 {
994 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
995 }
996
998 {
999 if (!super.CanReleaseAttachment(attachment))
1000 {
1001 return false;
1002 }
1003
1004 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
1005 {
1006 string attType = attachment.GetType();
1007 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1008 {
1009 return false;
1010 }
1011 }
1012
1013 return true;
1014 }
1015
1016 override protected bool CanManipulateSpareWheel(string slotSelectionName)
1017 {
1018 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
1019 }
1020
1021 override bool CanDisplayAttachmentCategory( string category_name )
1022 {
1023 if (!super.CanDisplayAttachmentCategory(category_name))
1024 {
1025 return false;
1026 }
1027
1028 category_name.ToLower();
1029 if (category_name.Contains("engine"))
1030 {
1031 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
1032 {
1033 return false;
1034 }
1035 }
1036
1037 return true;
1038 }
1039
1040 override bool CanDisplayCargo()
1041 {
1042 if (!super.CanDisplayCargo())
1043 {
1044 return false;
1045 }
1046
1047 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1048 {
1049 return false;
1050 }
1051
1052 return true;
1053 }
1054
1055 override int GetCarDoorsState(string slotType)
1056 {
1058
1059 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
1060 if (!carDoor)
1061 {
1062 return CarDoorState.DOORS_MISSING;
1063 }
1064
1065 switch (slotType)
1066 {
1067 case "NivaDriverDoors":
1068 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1069
1070 case "NivaCoDriverDoors":
1071 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1072
1073 case "NivaHood":
1074 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1075
1076 case "NivaTrunk":
1077 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1078 }
1079
1080 return CarDoorState.DOORS_MISSING;
1081 }
1082
1083 override bool CrewCanGetThrough(int posIdx)
1084 {
1086 switch (posIdx)
1087 {
1088 case 0:
1089 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1090 return false;
1091 else if (GetAnimationPhase("SeatDriver") > 0.5)
1092 return false;
1093
1094 return true;
1095
1096 case 1:
1097 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1098 return false;
1099 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1100 return false;
1101
1102 return true;
1103
1104 case 2:
1105 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1106 return false;
1107 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1108 return false;
1109
1110 return true;
1111
1112 case 3:
1113 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1114 return false;
1115 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1116 return false;
1117
1118 return true;
1119 }
1120
1121 return false;
1122 }
1123
1124 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1125 {
1126 switch (posIdx)
1127 {
1128 case 0:
1129 case 2:
1130 return "doors_driver";
1131 case 1:
1132 case 3:
1133 return "doors_codriver";
1134 }
1135
1136 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1137 }
1138
1139 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1140 {
1141 switch (posIdx)
1142 {
1143 case 0:
1144 case 2:
1145 return "NivaDriverDoors";
1146 case 1:
1147 case 3:
1148 return "NivaCoDriverDoors";
1149 }
1150
1151 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1152 }
1153
1154 // 0 full ambient and engine sound
1155 // 1 zero ambient and engine sound
1156 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1157 {
1158 float tempCap = 0.0;
1159
1160 switch (ctrl)
1161 {
1162 case CarSoundCtrl.DOORS:
1163 float newValue = 0;
1164 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1165 {
1166 newValue += 0.5;
1167 }
1168
1169 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1170 {
1171 newValue += 0.5;
1172 }
1173
1174 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1175 {
1176 newValue += 0.3;
1177 }
1178
1179 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1180 {
1181 newValue -= 0.6;
1182 }
1183
1184 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1185 {
1186 newValue -= 0.2;
1187 }
1188
1189 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1190 {
1191 newValue -= 0.2;
1192 }
1193
1194 return Math.Clamp(newValue, 0, 1);
1195 break;
1196 }
1197
1198 return super.OnSound(ctrl, oldValue);
1199 }
1200
1201 override string GetAnimSourceFromSelection( string selection )
1202 {
1203 switch (selection)
1204 {
1205 case "doors_driver":
1206 return "DoorsDriver";
1207 case "doors_codriver":
1208 return "DoorsCoDriver";
1209 case "doors_hood":
1210 return "DoorsHood";
1211 case "doors_trunk":
1212 return "DoorsTrunk";
1213 case "seatback_driver":
1214 return "SeatDriver";
1215 case "seatback_codriver":
1216 return "SeatCoDriver";
1217 }
1218
1219 return "";
1220 }
1221
1222 override string GetDoorConditionPointFromSelection(string selection)
1223 {
1224 switch (selection)
1225 {
1226 case "seat_driver":
1227 case "seatback_driver":
1228 case "seat_cargo1":
1229 return "seat_con_1_1";
1230 case "seat_codriver":
1231 case "seatback_codriver":
1232 case "seat_cargo2":
1233 return "seat_con_2_1";
1234 }
1235
1236 return "";
1237 }
1238
1239 override int GetCrewIndex(string selection)
1240 {
1241 switch (selection)
1242 {
1243 case "seatback_driver":
1244 return 0;
1245 case "seatback_codriver":
1246 return 1;
1247 }
1248
1249 return -1;
1250 }
1251
1252 override bool IsVitalTruckBattery()
1253 {
1254 return false;
1255 }
1256
1257 override bool IsVitalGlowPlug()
1258 {
1259 return false;
1260 }
1261
1262 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1263 {
1264 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1265 return false;
1266
1267 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1268 return false;
1269
1270 switch (currentSeat)
1271 {
1272 case 0:
1273 return nextSeat == 1;
1274
1275 case 1:
1276 return nextSeat == 0;
1277
1278 case 2:
1279 return nextSeat == 3;
1280
1281 case 3:
1282 return nextSeat == 2;
1283 }
1284
1285 return false;
1286 }
1287
1288 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1289 {
1290 switch (pCurrentSeat)
1291 {
1292 case 0:
1293 return pDoorsSelection == "DoorsDriver";
1294
1295 case 1:
1296 return pDoorsSelection == "DoorsCoDriver";
1297
1298 case 2:
1299 return pDoorsSelection == "DoorsDriver";
1300
1301 case 3:
1302 return pDoorsSelection == "DoorsCoDriver";
1303 }
1304
1305 return false;
1306 }
1307
1308 override int GetSeatIndexFromDoor( string pDoorSelection )
1309 {
1310 switch (pDoorSelection)
1311 {
1312 case "DoorsDriver":
1313 return 0;
1314 case "DoorsCoDriver":
1315 return 1;
1316 }
1317
1318 return -1;
1319 }
1320
1321 override void SetActions()
1322 {
1323 super.SetActions();
1324
1326 }
1327
1328 override void OnDebugSpawn()
1329 {
1333
1334 GetInventory().CreateInInventory("HatchbackWheel");
1335 GetInventory().CreateInInventory("HatchbackWheel");
1336 GetInventory().CreateInInventory("HatchbackWheel" );
1337 GetInventory().CreateInInventory("HatchbackWheel");
1338
1339 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1340 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1341 GetInventory().CreateInInventory("HatchbackHood");
1342 GetInventory().CreateInInventory("HatchbackTrunk");
1343
1344 //-----IN CAR CARGO
1345 GetInventory().CreateInInventory("HatchbackWheel");
1346 GetInventory().CreateInInventory("HatchbackWheel");
1347 }
1348}
1349
1351{
1352 override void OnDebugSpawn()
1353 {
1357
1358 GetInventory().CreateInInventory("HatchbackWheel");
1359 GetInventory().CreateInInventory("HatchbackWheel");
1360 GetInventory().CreateInInventory("HatchbackWheel");
1361 GetInventory().CreateInInventory("HatchbackWheel");
1362
1363 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1364 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1365 GetInventory().CreateInInventory("HatchbackHood_White");
1366 GetInventory().CreateInInventory("HatchbackTrunk_White");
1367
1368 //-----IN CAR CARGO
1369 GetInventory().CreateInInventory("HatchbackWheel");
1370 GetInventory().CreateInInventory("HatchbackWheel");
1371 }
1372}
1373
1375{
1376 override void OnDebugSpawn()
1377 {
1381
1382 GetInventory().CreateInInventory("HatchbackWheel");
1383 GetInventory().CreateInInventory("HatchbackWheel");
1384 GetInventory().CreateInInventory("HatchbackWheel");
1385 GetInventory().CreateInInventory("HatchbackWheel");
1386
1387 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1388 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1389 GetInventory().CreateInInventory("HatchbackHood_Blue");
1390 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1391
1392 //-----IN CAR CARGO
1393 GetInventory().CreateInInventory("HatchbackWheel");
1394 GetInventory().CreateInInventory("HatchbackWheel");
1395 }
1396}

◆ CanReachSeatFromSeat()

override bool CanReachSeatFromSeat ( int currentSeat,
int nextSeat )
protected
855{
859
860 void OffroadHatchback()
861 {
862 //m_dmgContactCoef = 0.075;
863
864 m_EngineStartOK = "offroad_engine_start_SoundSet";
865 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
866 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
867 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
868 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
869
870 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
871 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
872 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
873 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
874
875 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
876 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
877
878 SetEnginePos("0 0.7 1.2");
879 }
880
881 override void EEInit()
882 {
883 super.EEInit();
884
885 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
886 {
888 m_UTSSettings.m_ManualUpdate = true;
889 m_UTSSettings.m_TemperatureMin = 0;
890 m_UTSSettings.m_TemperatureMax = 30;
892 m_UTSSettings.m_TemperatureCap = 0;
893 m_UTSSettings.m_RangeFull = 0.5;
894 m_UTSSettings.m_RangeMax = 2;
895
898 }
899 }
900
901 override void OnEngineStart()
902 {
903 super.OnEngineStart();
904
905 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
906 {
907 m_UTSource.SetDefferedActive(true, 20.0);
908 }
909 }
910
911 override void OnEngineStop()
912 {
913 super.OnEngineStop();
914
915 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
916 {
917 m_UTSource.SetDefferedActive(false, 10.0);
918 }
919 }
920
921 override void EOnPostSimulate(IEntity other, float timeSlice)
922 {
923 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
924 {
925 if (m_UTSource.IsActive())
926 {
928 }
929 }
930 }
931
932 override int GetAnimInstance()
933 {
934 return VehicleAnimInstances.HATCHBACK;
935 }
936
937 override float GetTransportCameraDistance()
938 {
939 return 3.5;
940 }
941
942 override int GetSeatAnimationType( int posIdx )
943 {
944 switch (posIdx)
945 {
946 case 0:
947 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
948 case 1:
949 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
950 case 2:
951 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
952 case 3:
953 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
954 }
955
956 return 0;
957
958 }
959
960
962 {
963 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
964 }
965
967 {
968 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
969 }
970
972 {
973 if (!super.CanReleaseAttachment(attachment))
974 {
975 return false;
976 }
977
978 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
979 {
980 string attType = attachment.GetType();
981 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
982 {
983 return false;
984 }
985 }
986
987 return true;
988 }
989
990 override protected bool CanManipulateSpareWheel(string slotSelectionName)
991 {
992 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
993 }
994
995 override bool CanDisplayAttachmentCategory( string category_name )
996 {
997 if (!super.CanDisplayAttachmentCategory(category_name))
998 {
999 return false;
1000 }
1001
1002 category_name.ToLower();
1003 if (category_name.Contains("engine"))
1004 {
1005 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
1006 {
1007 return false;
1008 }
1009 }
1010
1011 return true;
1012 }
1013
1014 override bool CanDisplayCargo()
1015 {
1016 if (!super.CanDisplayCargo())
1017 {
1018 return false;
1019 }
1020
1021 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1022 {
1023 return false;
1024 }
1025
1026 return true;
1027 }
1028
1029 override int GetCarDoorsState(string slotType)
1030 {
1032
1033 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
1034 if (!carDoor)
1035 {
1036 return CarDoorState.DOORS_MISSING;
1037 }
1038
1039 switch (slotType)
1040 {
1041 case "NivaDriverDoors":
1042 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1043
1044 case "NivaCoDriverDoors":
1045 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1046
1047 case "NivaHood":
1048 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1049
1050 case "NivaTrunk":
1051 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1052 }
1053
1054 return CarDoorState.DOORS_MISSING;
1055 }
1056
1057 override bool CrewCanGetThrough(int posIdx)
1058 {
1060 switch (posIdx)
1061 {
1062 case 0:
1063 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1064 return false;
1065 else if (GetAnimationPhase("SeatDriver") > 0.5)
1066 return false;
1067
1068 return true;
1069
1070 case 1:
1071 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1072 return false;
1073 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1074 return false;
1075
1076 return true;
1077
1078 case 2:
1079 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1080 return false;
1081 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1082 return false;
1083
1084 return true;
1085
1086 case 3:
1087 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1088 return false;
1089 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1090 return false;
1091
1092 return true;
1093 }
1094
1095 return false;
1096 }
1097
1098 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1099 {
1100 switch (posIdx)
1101 {
1102 case 0:
1103 case 2:
1104 return "doors_driver";
1105 case 1:
1106 case 3:
1107 return "doors_codriver";
1108 }
1109
1110 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1111 }
1112
1113 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1114 {
1115 switch (posIdx)
1116 {
1117 case 0:
1118 case 2:
1119 return "NivaDriverDoors";
1120 case 1:
1121 case 3:
1122 return "NivaCoDriverDoors";
1123 }
1124
1125 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1126 }
1127
1128 // 0 full ambient and engine sound
1129 // 1 zero ambient and engine sound
1130 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1131 {
1132 float tempCap = 0.0;
1133
1134 switch (ctrl)
1135 {
1136 case CarSoundCtrl.DOORS:
1137 float newValue = 0;
1138 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1139 {
1140 newValue += 0.5;
1141 }
1142
1143 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1144 {
1145 newValue += 0.5;
1146 }
1147
1148 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1149 {
1150 newValue += 0.3;
1151 }
1152
1153 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1154 {
1155 newValue -= 0.6;
1156 }
1157
1158 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1159 {
1160 newValue -= 0.2;
1161 }
1162
1163 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1164 {
1165 newValue -= 0.2;
1166 }
1167
1168 return Math.Clamp(newValue, 0, 1);
1169 break;
1170 }
1171
1172 return super.OnSound(ctrl, oldValue);
1173 }
1174
1175 override string GetAnimSourceFromSelection( string selection )
1176 {
1177 switch (selection)
1178 {
1179 case "doors_driver":
1180 return "DoorsDriver";
1181 case "doors_codriver":
1182 return "DoorsCoDriver";
1183 case "doors_hood":
1184 return "DoorsHood";
1185 case "doors_trunk":
1186 return "DoorsTrunk";
1187 case "seatback_driver":
1188 return "SeatDriver";
1189 case "seatback_codriver":
1190 return "SeatCoDriver";
1191 }
1192
1193 return "";
1194 }
1195
1196 override string GetDoorConditionPointFromSelection(string selection)
1197 {
1198 switch (selection)
1199 {
1200 case "seat_driver":
1201 case "seatback_driver":
1202 case "seat_cargo1":
1203 return "seat_con_1_1";
1204 case "seat_codriver":
1205 case "seatback_codriver":
1206 case "seat_cargo2":
1207 return "seat_con_2_1";
1208 }
1209
1210 return "";
1211 }
1212
1213 override int GetCrewIndex(string selection)
1214 {
1215 switch (selection)
1216 {
1217 case "seatback_driver":
1218 return 0;
1219 case "seatback_codriver":
1220 return 1;
1221 }
1222
1223 return -1;
1224 }
1225
1226 override bool IsVitalTruckBattery()
1227 {
1228 return false;
1229 }
1230
1231 override bool IsVitalGlowPlug()
1232 {
1233 return false;
1234 }
1235
1236 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1237 {
1238 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1239 return false;
1240
1241 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1242 return false;
1243
1244 switch (currentSeat)
1245 {
1246 case 0:
1247 return nextSeat == 1;
1248
1249 case 1:
1250 return nextSeat == 0;
1251
1252 case 2:
1253 return nextSeat == 3;
1254
1255 case 3:
1256 return nextSeat == 2;
1257 }
1258
1259 return false;
1260 }
1261
1262 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1263 {
1264 switch (pCurrentSeat)
1265 {
1266 case 0:
1267 return pDoorsSelection == "DoorsDriver";
1268
1269 case 1:
1270 return pDoorsSelection == "DoorsCoDriver";
1271
1272 case 2:
1273 return pDoorsSelection == "DoorsDriver";
1274
1275 case 3:
1276 return pDoorsSelection == "DoorsCoDriver";
1277 }
1278
1279 return false;
1280 }
1281
1282 override int GetSeatIndexFromDoor( string pDoorSelection )
1283 {
1284 switch (pDoorSelection)
1285 {
1286 case "DoorsDriver":
1287 return 0;
1288 case "DoorsCoDriver":
1289 return 1;
1290 }
1291
1292 return -1;
1293 }
1294
1295 override void SetActions()
1296 {
1297 super.SetActions();
1298
1300 }
1301
1302 override void OnDebugSpawn()
1303 {
1307
1308 GetInventory().CreateInInventory("HatchbackWheel");
1309 GetInventory().CreateInInventory("HatchbackWheel");
1310 GetInventory().CreateInInventory("HatchbackWheel" );
1311 GetInventory().CreateInInventory("HatchbackWheel");
1312
1313 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1314 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1315 GetInventory().CreateInInventory("HatchbackHood");
1316 GetInventory().CreateInInventory("HatchbackTrunk");
1317
1318 //-----IN CAR CARGO
1319 GetInventory().CreateInInventory("HatchbackWheel");
1320 GetInventory().CreateInInventory("HatchbackWheel");
1321 }
1322}
1323
1325{
1326 override void OnDebugSpawn()
1327 {
1331
1332 GetInventory().CreateInInventory("HatchbackWheel");
1333 GetInventory().CreateInInventory("HatchbackWheel");
1334 GetInventory().CreateInInventory("HatchbackWheel");
1335 GetInventory().CreateInInventory("HatchbackWheel");
1336
1337 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1338 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1339 GetInventory().CreateInInventory("HatchbackHood_White");
1340 GetInventory().CreateInInventory("HatchbackTrunk_White");
1341
1342 //-----IN CAR CARGO
1343 GetInventory().CreateInInventory("HatchbackWheel");
1344 GetInventory().CreateInInventory("HatchbackWheel");
1345 }
1346}
1347
1349{
1350 override void OnDebugSpawn()
1351 {
1355
1356 GetInventory().CreateInInventory("HatchbackWheel");
1357 GetInventory().CreateInInventory("HatchbackWheel");
1358 GetInventory().CreateInInventory("HatchbackWheel");
1359 GetInventory().CreateInInventory("HatchbackWheel");
1360
1361 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1362 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1363 GetInventory().CreateInInventory("HatchbackHood_Blue");
1364 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1365
1366 //-----IN CAR CARGO
1367 GetInventory().CreateInInventory("HatchbackWheel");
1368 GetInventory().CreateInInventory("HatchbackWheel");
1369 }
1370}

◆ CanReleaseAttachment()

override bool CanReleaseAttachment ( EntityAI attachment)
protected
590{
594
595 void OffroadHatchback()
596 {
597 //m_dmgContactCoef = 0.075;
598
599 m_EngineStartOK = "offroad_engine_start_SoundSet";
600 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
601 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
602 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
603 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
604
605 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
606 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
607 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
608 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
609
610 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
611 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
612
613 SetEnginePos("0 0.7 1.2");
614 }
615
616 override void EEInit()
617 {
618 super.EEInit();
619
620 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
621 {
623 m_UTSSettings.m_ManualUpdate = true;
624 m_UTSSettings.m_TemperatureMin = 0;
625 m_UTSSettings.m_TemperatureMax = 30;
627 m_UTSSettings.m_TemperatureCap = 0;
628 m_UTSSettings.m_RangeFull = 0.5;
629 m_UTSSettings.m_RangeMax = 2;
630
633 }
634 }
635
636 override void OnEngineStart()
637 {
638 super.OnEngineStart();
639
640 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
641 {
642 m_UTSource.SetDefferedActive(true, 20.0);
643 }
644 }
645
646 override void OnEngineStop()
647 {
648 super.OnEngineStop();
649
650 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
651 {
652 m_UTSource.SetDefferedActive(false, 10.0);
653 }
654 }
655
656 override void EOnPostSimulate(IEntity other, float timeSlice)
657 {
658 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
659 {
660 if (m_UTSource.IsActive())
661 {
663 }
664 }
665 }
666
667 override int GetAnimInstance()
668 {
669 return VehicleAnimInstances.HATCHBACK;
670 }
671
672 override float GetTransportCameraDistance()
673 {
674 return 3.5;
675 }
676
677 override int GetSeatAnimationType( int posIdx )
678 {
679 switch (posIdx)
680 {
681 case 0:
682 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
683 case 1:
684 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
685 case 2:
686 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
687 case 3:
688 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
689 }
690
691 return 0;
692
693 }
694
695
697 {
698 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
699 }
700
702 {
703 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
704 }
705
707 {
708 if (!super.CanReleaseAttachment(attachment))
709 {
710 return false;
711 }
712
713 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
714 {
715 string attType = attachment.GetType();
716 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
717 {
718 return false;
719 }
720 }
721
722 return true;
723 }
724
725 override protected bool CanManipulateSpareWheel(string slotSelectionName)
726 {
727 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
728 }
729
730 override bool CanDisplayAttachmentCategory( string category_name )
731 {
732 if (!super.CanDisplayAttachmentCategory(category_name))
733 {
734 return false;
735 }
736
737 category_name.ToLower();
738 if (category_name.Contains("engine"))
739 {
740 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
741 {
742 return false;
743 }
744 }
745
746 return true;
747 }
748
749 override bool CanDisplayCargo()
750 {
751 if (!super.CanDisplayCargo())
752 {
753 return false;
754 }
755
756 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
757 {
758 return false;
759 }
760
761 return true;
762 }
763
764 override int GetCarDoorsState(string slotType)
765 {
767
768 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
769 if (!carDoor)
770 {
771 return CarDoorState.DOORS_MISSING;
772 }
773
774 switch (slotType)
775 {
776 case "NivaDriverDoors":
777 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
778
779 case "NivaCoDriverDoors":
780 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
781
782 case "NivaHood":
783 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
784
785 case "NivaTrunk":
786 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
787 }
788
789 return CarDoorState.DOORS_MISSING;
790 }
791
792 override bool CrewCanGetThrough(int posIdx)
793 {
795 switch (posIdx)
796 {
797 case 0:
798 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
799 return false;
800 else if (GetAnimationPhase("SeatDriver") > 0.5)
801 return false;
802
803 return true;
804
805 case 1:
806 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
807 return false;
808 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
809 return false;
810
811 return true;
812
813 case 2:
814 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
815 return false;
816 else if (GetAnimationPhase("SeatDriver") <= 0.5)
817 return false;
818
819 return true;
820
821 case 3:
822 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
823 return false;
824 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
825 return false;
826
827 return true;
828 }
829
830 return false;
831 }
832
833 override string GetDoorSelectionNameFromSeatPos(int posIdx)
834 {
835 switch (posIdx)
836 {
837 case 0:
838 case 2:
839 return "doors_driver";
840 case 1:
841 case 3:
842 return "doors_codriver";
843 }
844
845 return super.GetDoorSelectionNameFromSeatPos(posIdx);
846 }
847
848 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
849 {
850 switch (posIdx)
851 {
852 case 0:
853 case 2:
854 return "NivaDriverDoors";
855 case 1:
856 case 3:
857 return "NivaCoDriverDoors";
858 }
859
860 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
861 }
862
863 // 0 full ambient and engine sound
864 // 1 zero ambient and engine sound
865 override float OnSound(CarSoundCtrl ctrl, float oldValue)
866 {
867 float tempCap = 0.0;
868
869 switch (ctrl)
870 {
871 case CarSoundCtrl.DOORS:
872 float newValue = 0;
873 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
874 {
875 newValue += 0.5;
876 }
877
878 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
879 {
880 newValue += 0.5;
881 }
882
883 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
884 {
885 newValue += 0.3;
886 }
887
888 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
889 {
890 newValue -= 0.6;
891 }
892
893 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
894 {
895 newValue -= 0.2;
896 }
897
898 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
899 {
900 newValue -= 0.2;
901 }
902
903 return Math.Clamp(newValue, 0, 1);
904 break;
905 }
906
907 return super.OnSound(ctrl, oldValue);
908 }
909
910 override string GetAnimSourceFromSelection( string selection )
911 {
912 switch (selection)
913 {
914 case "doors_driver":
915 return "DoorsDriver";
916 case "doors_codriver":
917 return "DoorsCoDriver";
918 case "doors_hood":
919 return "DoorsHood";
920 case "doors_trunk":
921 return "DoorsTrunk";
922 case "seatback_driver":
923 return "SeatDriver";
924 case "seatback_codriver":
925 return "SeatCoDriver";
926 }
927
928 return "";
929 }
930
931 override string GetDoorConditionPointFromSelection(string selection)
932 {
933 switch (selection)
934 {
935 case "seat_driver":
936 case "seatback_driver":
937 case "seat_cargo1":
938 return "seat_con_1_1";
939 case "seat_codriver":
940 case "seatback_codriver":
941 case "seat_cargo2":
942 return "seat_con_2_1";
943 }
944
945 return "";
946 }
947
948 override int GetCrewIndex(string selection)
949 {
950 switch (selection)
951 {
952 case "seatback_driver":
953 return 0;
954 case "seatback_codriver":
955 return 1;
956 }
957
958 return -1;
959 }
960
961 override bool IsVitalTruckBattery()
962 {
963 return false;
964 }
965
966 override bool IsVitalGlowPlug()
967 {
968 return false;
969 }
970
971 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
972 {
973 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
974 return false;
975
976 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
977 return false;
978
979 switch (currentSeat)
980 {
981 case 0:
982 return nextSeat == 1;
983
984 case 1:
985 return nextSeat == 0;
986
987 case 2:
988 return nextSeat == 3;
989
990 case 3:
991 return nextSeat == 2;
992 }
993
994 return false;
995 }
996
997 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
998 {
999 switch (pCurrentSeat)
1000 {
1001 case 0:
1002 return pDoorsSelection == "DoorsDriver";
1003
1004 case 1:
1005 return pDoorsSelection == "DoorsCoDriver";
1006
1007 case 2:
1008 return pDoorsSelection == "DoorsDriver";
1009
1010 case 3:
1011 return pDoorsSelection == "DoorsCoDriver";
1012 }
1013
1014 return false;
1015 }
1016
1017 override int GetSeatIndexFromDoor( string pDoorSelection )
1018 {
1019 switch (pDoorSelection)
1020 {
1021 case "DoorsDriver":
1022 return 0;
1023 case "DoorsCoDriver":
1024 return 1;
1025 }
1026
1027 return -1;
1028 }
1029
1030 override void SetActions()
1031 {
1032 super.SetActions();
1033
1035 }
1036
1037 override void OnDebugSpawn()
1038 {
1042
1043 GetInventory().CreateInInventory("HatchbackWheel");
1044 GetInventory().CreateInInventory("HatchbackWheel");
1045 GetInventory().CreateInInventory("HatchbackWheel" );
1046 GetInventory().CreateInInventory("HatchbackWheel");
1047
1048 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1049 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1050 GetInventory().CreateInInventory("HatchbackHood");
1051 GetInventory().CreateInInventory("HatchbackTrunk");
1052
1053 //-----IN CAR CARGO
1054 GetInventory().CreateInInventory("HatchbackWheel");
1055 GetInventory().CreateInInventory("HatchbackWheel");
1056 }
1057}
1058
1060{
1061 override void OnDebugSpawn()
1062 {
1066
1067 GetInventory().CreateInInventory("HatchbackWheel");
1068 GetInventory().CreateInInventory("HatchbackWheel");
1069 GetInventory().CreateInInventory("HatchbackWheel");
1070 GetInventory().CreateInInventory("HatchbackWheel");
1071
1072 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1073 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1074 GetInventory().CreateInInventory("HatchbackHood_White");
1075 GetInventory().CreateInInventory("HatchbackTrunk_White");
1076
1077 //-----IN CAR CARGO
1078 GetInventory().CreateInInventory("HatchbackWheel");
1079 GetInventory().CreateInInventory("HatchbackWheel");
1080 }
1081}
1082
1084{
1085 override void OnDebugSpawn()
1086 {
1090
1091 GetInventory().CreateInInventory("HatchbackWheel");
1092 GetInventory().CreateInInventory("HatchbackWheel");
1093 GetInventory().CreateInInventory("HatchbackWheel");
1094 GetInventory().CreateInInventory("HatchbackWheel");
1095
1096 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1097 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1098 GetInventory().CreateInInventory("HatchbackHood_Blue");
1099 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1100
1101 //-----IN CAR CARGO
1102 GetInventory().CreateInInventory("HatchbackWheel");
1103 GetInventory().CreateInInventory("HatchbackWheel");
1104 }
1105}

◆ CreateFrontLight()

override CarLightBase CreateFrontLight ( )
protected
585{
589
590 void OffroadHatchback()
591 {
592 //m_dmgContactCoef = 0.075;
593
594 m_EngineStartOK = "offroad_engine_start_SoundSet";
595 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
596 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
597 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
598 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
599
600 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
601 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
602 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
603 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
604
605 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
606 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
607
608 SetEnginePos("0 0.7 1.2");
609 }
610
611 override void EEInit()
612 {
613 super.EEInit();
614
615 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
616 {
618 m_UTSSettings.m_ManualUpdate = true;
619 m_UTSSettings.m_TemperatureMin = 0;
620 m_UTSSettings.m_TemperatureMax = 30;
622 m_UTSSettings.m_TemperatureCap = 0;
623 m_UTSSettings.m_RangeFull = 0.5;
624 m_UTSSettings.m_RangeMax = 2;
625
628 }
629 }
630
631 override void OnEngineStart()
632 {
633 super.OnEngineStart();
634
635 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
636 {
637 m_UTSource.SetDefferedActive(true, 20.0);
638 }
639 }
640
641 override void OnEngineStop()
642 {
643 super.OnEngineStop();
644
645 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
646 {
647 m_UTSource.SetDefferedActive(false, 10.0);
648 }
649 }
650
651 override void EOnPostSimulate(IEntity other, float timeSlice)
652 {
653 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
654 {
655 if (m_UTSource.IsActive())
656 {
658 }
659 }
660 }
661
662 override int GetAnimInstance()
663 {
664 return VehicleAnimInstances.HATCHBACK;
665 }
666
667 override float GetTransportCameraDistance()
668 {
669 return 3.5;
670 }
671
672 override int GetSeatAnimationType( int posIdx )
673 {
674 switch (posIdx)
675 {
676 case 0:
677 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
678 case 1:
679 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
680 case 2:
681 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
682 case 3:
683 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
684 }
685
686 return 0;
687
688 }
689
690
692 {
693 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
694 }
695
697 {
698 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
699 }
700
702 {
703 if (!super.CanReleaseAttachment(attachment))
704 {
705 return false;
706 }
707
708 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
709 {
710 string attType = attachment.GetType();
711 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
712 {
713 return false;
714 }
715 }
716
717 return true;
718 }
719
720 override protected bool CanManipulateSpareWheel(string slotSelectionName)
721 {
722 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
723 }
724
725 override bool CanDisplayAttachmentCategory( string category_name )
726 {
727 if (!super.CanDisplayAttachmentCategory(category_name))
728 {
729 return false;
730 }
731
732 category_name.ToLower();
733 if (category_name.Contains("engine"))
734 {
735 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
736 {
737 return false;
738 }
739 }
740
741 return true;
742 }
743
744 override bool CanDisplayCargo()
745 {
746 if (!super.CanDisplayCargo())
747 {
748 return false;
749 }
750
751 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
752 {
753 return false;
754 }
755
756 return true;
757 }
758
759 override int GetCarDoorsState(string slotType)
760 {
762
763 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
764 if (!carDoor)
765 {
766 return CarDoorState.DOORS_MISSING;
767 }
768
769 switch (slotType)
770 {
771 case "NivaDriverDoors":
772 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
773
774 case "NivaCoDriverDoors":
775 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
776
777 case "NivaHood":
778 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
779
780 case "NivaTrunk":
781 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
782 }
783
784 return CarDoorState.DOORS_MISSING;
785 }
786
787 override bool CrewCanGetThrough(int posIdx)
788 {
790 switch (posIdx)
791 {
792 case 0:
793 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
794 return false;
795 else if (GetAnimationPhase("SeatDriver") > 0.5)
796 return false;
797
798 return true;
799
800 case 1:
801 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
802 return false;
803 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
804 return false;
805
806 return true;
807
808 case 2:
809 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
810 return false;
811 else if (GetAnimationPhase("SeatDriver") <= 0.5)
812 return false;
813
814 return true;
815
816 case 3:
817 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
818 return false;
819 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
820 return false;
821
822 return true;
823 }
824
825 return false;
826 }
827
828 override string GetDoorSelectionNameFromSeatPos(int posIdx)
829 {
830 switch (posIdx)
831 {
832 case 0:
833 case 2:
834 return "doors_driver";
835 case 1:
836 case 3:
837 return "doors_codriver";
838 }
839
840 return super.GetDoorSelectionNameFromSeatPos(posIdx);
841 }
842
843 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
844 {
845 switch (posIdx)
846 {
847 case 0:
848 case 2:
849 return "NivaDriverDoors";
850 case 1:
851 case 3:
852 return "NivaCoDriverDoors";
853 }
854
855 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
856 }
857
858 // 0 full ambient and engine sound
859 // 1 zero ambient and engine sound
860 override float OnSound(CarSoundCtrl ctrl, float oldValue)
861 {
862 float tempCap = 0.0;
863
864 switch (ctrl)
865 {
866 case CarSoundCtrl.DOORS:
867 float newValue = 0;
868 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
869 {
870 newValue += 0.5;
871 }
872
873 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
874 {
875 newValue += 0.5;
876 }
877
878 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
879 {
880 newValue += 0.3;
881 }
882
883 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
884 {
885 newValue -= 0.6;
886 }
887
888 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
889 {
890 newValue -= 0.2;
891 }
892
893 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
894 {
895 newValue -= 0.2;
896 }
897
898 return Math.Clamp(newValue, 0, 1);
899 break;
900 }
901
902 return super.OnSound(ctrl, oldValue);
903 }
904
905 override string GetAnimSourceFromSelection( string selection )
906 {
907 switch (selection)
908 {
909 case "doors_driver":
910 return "DoorsDriver";
911 case "doors_codriver":
912 return "DoorsCoDriver";
913 case "doors_hood":
914 return "DoorsHood";
915 case "doors_trunk":
916 return "DoorsTrunk";
917 case "seatback_driver":
918 return "SeatDriver";
919 case "seatback_codriver":
920 return "SeatCoDriver";
921 }
922
923 return "";
924 }
925
926 override string GetDoorConditionPointFromSelection(string selection)
927 {
928 switch (selection)
929 {
930 case "seat_driver":
931 case "seatback_driver":
932 case "seat_cargo1":
933 return "seat_con_1_1";
934 case "seat_codriver":
935 case "seatback_codriver":
936 case "seat_cargo2":
937 return "seat_con_2_1";
938 }
939
940 return "";
941 }
942
943 override int GetCrewIndex(string selection)
944 {
945 switch (selection)
946 {
947 case "seatback_driver":
948 return 0;
949 case "seatback_codriver":
950 return 1;
951 }
952
953 return -1;
954 }
955
956 override bool IsVitalTruckBattery()
957 {
958 return false;
959 }
960
961 override bool IsVitalGlowPlug()
962 {
963 return false;
964 }
965
966 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
967 {
968 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
969 return false;
970
971 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
972 return false;
973
974 switch (currentSeat)
975 {
976 case 0:
977 return nextSeat == 1;
978
979 case 1:
980 return nextSeat == 0;
981
982 case 2:
983 return nextSeat == 3;
984
985 case 3:
986 return nextSeat == 2;
987 }
988
989 return false;
990 }
991
992 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
993 {
994 switch (pCurrentSeat)
995 {
996 case 0:
997 return pDoorsSelection == "DoorsDriver";
998
999 case 1:
1000 return pDoorsSelection == "DoorsCoDriver";
1001
1002 case 2:
1003 return pDoorsSelection == "DoorsDriver";
1004
1005 case 3:
1006 return pDoorsSelection == "DoorsCoDriver";
1007 }
1008
1009 return false;
1010 }
1011
1012 override int GetSeatIndexFromDoor( string pDoorSelection )
1013 {
1014 switch (pDoorSelection)
1015 {
1016 case "DoorsDriver":
1017 return 0;
1018 case "DoorsCoDriver":
1019 return 1;
1020 }
1021
1022 return -1;
1023 }
1024
1025 override void SetActions()
1026 {
1027 super.SetActions();
1028
1030 }
1031
1032 override void OnDebugSpawn()
1033 {
1037
1038 GetInventory().CreateInInventory("HatchbackWheel");
1039 GetInventory().CreateInInventory("HatchbackWheel");
1040 GetInventory().CreateInInventory("HatchbackWheel" );
1041 GetInventory().CreateInInventory("HatchbackWheel");
1042
1043 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1044 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1045 GetInventory().CreateInInventory("HatchbackHood");
1046 GetInventory().CreateInInventory("HatchbackTrunk");
1047
1048 //-----IN CAR CARGO
1049 GetInventory().CreateInInventory("HatchbackWheel");
1050 GetInventory().CreateInInventory("HatchbackWheel");
1051 }
1052}
1053
1055{
1056 override void OnDebugSpawn()
1057 {
1061
1062 GetInventory().CreateInInventory("HatchbackWheel");
1063 GetInventory().CreateInInventory("HatchbackWheel");
1064 GetInventory().CreateInInventory("HatchbackWheel");
1065 GetInventory().CreateInInventory("HatchbackWheel");
1066
1067 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1068 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1069 GetInventory().CreateInInventory("HatchbackHood_White");
1070 GetInventory().CreateInInventory("HatchbackTrunk_White");
1071
1072 //-----IN CAR CARGO
1073 GetInventory().CreateInInventory("HatchbackWheel");
1074 GetInventory().CreateInInventory("HatchbackWheel");
1075 }
1076}
1077
1079{
1080 override void OnDebugSpawn()
1081 {
1085
1086 GetInventory().CreateInInventory("HatchbackWheel");
1087 GetInventory().CreateInInventory("HatchbackWheel");
1088 GetInventory().CreateInInventory("HatchbackWheel");
1089 GetInventory().CreateInInventory("HatchbackWheel");
1090
1091 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1092 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1093 GetInventory().CreateInInventory("HatchbackHood_Blue");
1094 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1095
1096 //-----IN CAR CARGO
1097 GetInventory().CreateInInventory("HatchbackWheel");
1098 GetInventory().CreateInInventory("HatchbackWheel");
1099 }
1100}

◆ CreateRearLight()

override CarRearLightBase CreateRearLight ( )
protected
580{
584
585 void OffroadHatchback()
586 {
587 //m_dmgContactCoef = 0.075;
588
589 m_EngineStartOK = "offroad_engine_start_SoundSet";
590 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
591 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
592 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
593 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
594
595 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
596 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
597 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
598 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
599
600 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
601 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
602
603 SetEnginePos("0 0.7 1.2");
604 }
605
606 override void EEInit()
607 {
608 super.EEInit();
609
610 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
611 {
613 m_UTSSettings.m_ManualUpdate = true;
614 m_UTSSettings.m_TemperatureMin = 0;
615 m_UTSSettings.m_TemperatureMax = 30;
617 m_UTSSettings.m_TemperatureCap = 0;
618 m_UTSSettings.m_RangeFull = 0.5;
619 m_UTSSettings.m_RangeMax = 2;
620
623 }
624 }
625
626 override void OnEngineStart()
627 {
628 super.OnEngineStart();
629
630 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
631 {
632 m_UTSource.SetDefferedActive(true, 20.0);
633 }
634 }
635
636 override void OnEngineStop()
637 {
638 super.OnEngineStop();
639
640 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
641 {
642 m_UTSource.SetDefferedActive(false, 10.0);
643 }
644 }
645
646 override void EOnPostSimulate(IEntity other, float timeSlice)
647 {
648 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
649 {
650 if (m_UTSource.IsActive())
651 {
653 }
654 }
655 }
656
657 override int GetAnimInstance()
658 {
659 return VehicleAnimInstances.HATCHBACK;
660 }
661
662 override float GetTransportCameraDistance()
663 {
664 return 3.5;
665 }
666
667 override int GetSeatAnimationType( int posIdx )
668 {
669 switch (posIdx)
670 {
671 case 0:
672 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
673 case 1:
674 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
675 case 2:
676 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
677 case 3:
678 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
679 }
680
681 return 0;
682
683 }
684
685
687 {
688 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
689 }
690
692 {
693 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
694 }
695
697 {
698 if (!super.CanReleaseAttachment(attachment))
699 {
700 return false;
701 }
702
703 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
704 {
705 string attType = attachment.GetType();
706 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
707 {
708 return false;
709 }
710 }
711
712 return true;
713 }
714
715 override protected bool CanManipulateSpareWheel(string slotSelectionName)
716 {
717 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
718 }
719
720 override bool CanDisplayAttachmentCategory( string category_name )
721 {
722 if (!super.CanDisplayAttachmentCategory(category_name))
723 {
724 return false;
725 }
726
727 category_name.ToLower();
728 if (category_name.Contains("engine"))
729 {
730 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
731 {
732 return false;
733 }
734 }
735
736 return true;
737 }
738
739 override bool CanDisplayCargo()
740 {
741 if (!super.CanDisplayCargo())
742 {
743 return false;
744 }
745
746 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
747 {
748 return false;
749 }
750
751 return true;
752 }
753
754 override int GetCarDoorsState(string slotType)
755 {
757
758 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
759 if (!carDoor)
760 {
761 return CarDoorState.DOORS_MISSING;
762 }
763
764 switch (slotType)
765 {
766 case "NivaDriverDoors":
767 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
768
769 case "NivaCoDriverDoors":
770 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
771
772 case "NivaHood":
773 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
774
775 case "NivaTrunk":
776 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
777 }
778
779 return CarDoorState.DOORS_MISSING;
780 }
781
782 override bool CrewCanGetThrough(int posIdx)
783 {
785 switch (posIdx)
786 {
787 case 0:
788 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
789 return false;
790 else if (GetAnimationPhase("SeatDriver") > 0.5)
791 return false;
792
793 return true;
794
795 case 1:
796 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
797 return false;
798 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
799 return false;
800
801 return true;
802
803 case 2:
804 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
805 return false;
806 else if (GetAnimationPhase("SeatDriver") <= 0.5)
807 return false;
808
809 return true;
810
811 case 3:
812 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
813 return false;
814 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
815 return false;
816
817 return true;
818 }
819
820 return false;
821 }
822
823 override string GetDoorSelectionNameFromSeatPos(int posIdx)
824 {
825 switch (posIdx)
826 {
827 case 0:
828 case 2:
829 return "doors_driver";
830 case 1:
831 case 3:
832 return "doors_codriver";
833 }
834
835 return super.GetDoorSelectionNameFromSeatPos(posIdx);
836 }
837
838 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
839 {
840 switch (posIdx)
841 {
842 case 0:
843 case 2:
844 return "NivaDriverDoors";
845 case 1:
846 case 3:
847 return "NivaCoDriverDoors";
848 }
849
850 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
851 }
852
853 // 0 full ambient and engine sound
854 // 1 zero ambient and engine sound
855 override float OnSound(CarSoundCtrl ctrl, float oldValue)
856 {
857 float tempCap = 0.0;
858
859 switch (ctrl)
860 {
861 case CarSoundCtrl.DOORS:
862 float newValue = 0;
863 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
864 {
865 newValue += 0.5;
866 }
867
868 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
869 {
870 newValue += 0.5;
871 }
872
873 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
874 {
875 newValue += 0.3;
876 }
877
878 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
879 {
880 newValue -= 0.6;
881 }
882
883 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
884 {
885 newValue -= 0.2;
886 }
887
888 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
889 {
890 newValue -= 0.2;
891 }
892
893 return Math.Clamp(newValue, 0, 1);
894 break;
895 }
896
897 return super.OnSound(ctrl, oldValue);
898 }
899
900 override string GetAnimSourceFromSelection( string selection )
901 {
902 switch (selection)
903 {
904 case "doors_driver":
905 return "DoorsDriver";
906 case "doors_codriver":
907 return "DoorsCoDriver";
908 case "doors_hood":
909 return "DoorsHood";
910 case "doors_trunk":
911 return "DoorsTrunk";
912 case "seatback_driver":
913 return "SeatDriver";
914 case "seatback_codriver":
915 return "SeatCoDriver";
916 }
917
918 return "";
919 }
920
921 override string GetDoorConditionPointFromSelection(string selection)
922 {
923 switch (selection)
924 {
925 case "seat_driver":
926 case "seatback_driver":
927 case "seat_cargo1":
928 return "seat_con_1_1";
929 case "seat_codriver":
930 case "seatback_codriver":
931 case "seat_cargo2":
932 return "seat_con_2_1";
933 }
934
935 return "";
936 }
937
938 override int GetCrewIndex(string selection)
939 {
940 switch (selection)
941 {
942 case "seatback_driver":
943 return 0;
944 case "seatback_codriver":
945 return 1;
946 }
947
948 return -1;
949 }
950
951 override bool IsVitalTruckBattery()
952 {
953 return false;
954 }
955
956 override bool IsVitalGlowPlug()
957 {
958 return false;
959 }
960
961 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
962 {
963 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
964 return false;
965
966 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
967 return false;
968
969 switch (currentSeat)
970 {
971 case 0:
972 return nextSeat == 1;
973
974 case 1:
975 return nextSeat == 0;
976
977 case 2:
978 return nextSeat == 3;
979
980 case 3:
981 return nextSeat == 2;
982 }
983
984 return false;
985 }
986
987 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
988 {
989 switch (pCurrentSeat)
990 {
991 case 0:
992 return pDoorsSelection == "DoorsDriver";
993
994 case 1:
995 return pDoorsSelection == "DoorsCoDriver";
996
997 case 2:
998 return pDoorsSelection == "DoorsDriver";
999
1000 case 3:
1001 return pDoorsSelection == "DoorsCoDriver";
1002 }
1003
1004 return false;
1005 }
1006
1007 override int GetSeatIndexFromDoor( string pDoorSelection )
1008 {
1009 switch (pDoorSelection)
1010 {
1011 case "DoorsDriver":
1012 return 0;
1013 case "DoorsCoDriver":
1014 return 1;
1015 }
1016
1017 return -1;
1018 }
1019
1020 override void SetActions()
1021 {
1022 super.SetActions();
1023
1025 }
1026
1027 override void OnDebugSpawn()
1028 {
1032
1033 GetInventory().CreateInInventory("HatchbackWheel");
1034 GetInventory().CreateInInventory("HatchbackWheel");
1035 GetInventory().CreateInInventory("HatchbackWheel" );
1036 GetInventory().CreateInInventory("HatchbackWheel");
1037
1038 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1039 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1040 GetInventory().CreateInInventory("HatchbackHood");
1041 GetInventory().CreateInInventory("HatchbackTrunk");
1042
1043 //-----IN CAR CARGO
1044 GetInventory().CreateInInventory("HatchbackWheel");
1045 GetInventory().CreateInInventory("HatchbackWheel");
1046 }
1047}
1048
1050{
1051 override void OnDebugSpawn()
1052 {
1056
1057 GetInventory().CreateInInventory("HatchbackWheel");
1058 GetInventory().CreateInInventory("HatchbackWheel");
1059 GetInventory().CreateInInventory("HatchbackWheel");
1060 GetInventory().CreateInInventory("HatchbackWheel");
1061
1062 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1063 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1064 GetInventory().CreateInInventory("HatchbackHood_White");
1065 GetInventory().CreateInInventory("HatchbackTrunk_White");
1066
1067 //-----IN CAR CARGO
1068 GetInventory().CreateInInventory("HatchbackWheel");
1069 GetInventory().CreateInInventory("HatchbackWheel");
1070 }
1071}
1072
1074{
1075 override void OnDebugSpawn()
1076 {
1080
1081 GetInventory().CreateInInventory("HatchbackWheel");
1082 GetInventory().CreateInInventory("HatchbackWheel");
1083 GetInventory().CreateInInventory("HatchbackWheel");
1084 GetInventory().CreateInInventory("HatchbackWheel");
1085
1086 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1087 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1088 GetInventory().CreateInInventory("HatchbackHood_Blue");
1089 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1090
1091 //-----IN CAR CARGO
1092 GetInventory().CreateInInventory("HatchbackWheel");
1093 GetInventory().CreateInInventory("HatchbackWheel");
1094 }
1095}

◆ CrewCanGetThrough()

override bool CrewCanGetThrough ( int posIdx)
protected
676{
680
681 void OffroadHatchback()
682 {
683 //m_dmgContactCoef = 0.075;
684
685 m_EngineStartOK = "offroad_engine_start_SoundSet";
686 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
687 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
688 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
689 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
690
691 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
692 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
693 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
694 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
695
696 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
697 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
698
699 SetEnginePos("0 0.7 1.2");
700 }
701
702 override void EEInit()
703 {
704 super.EEInit();
705
706 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
707 {
709 m_UTSSettings.m_ManualUpdate = true;
710 m_UTSSettings.m_TemperatureMin = 0;
711 m_UTSSettings.m_TemperatureMax = 30;
713 m_UTSSettings.m_TemperatureCap = 0;
714 m_UTSSettings.m_RangeFull = 0.5;
715 m_UTSSettings.m_RangeMax = 2;
716
719 }
720 }
721
722 override void OnEngineStart()
723 {
724 super.OnEngineStart();
725
726 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
727 {
728 m_UTSource.SetDefferedActive(true, 20.0);
729 }
730 }
731
732 override void OnEngineStop()
733 {
734 super.OnEngineStop();
735
736 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
737 {
738 m_UTSource.SetDefferedActive(false, 10.0);
739 }
740 }
741
742 override void EOnPostSimulate(IEntity other, float timeSlice)
743 {
744 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
745 {
746 if (m_UTSource.IsActive())
747 {
749 }
750 }
751 }
752
753 override int GetAnimInstance()
754 {
755 return VehicleAnimInstances.HATCHBACK;
756 }
757
758 override float GetTransportCameraDistance()
759 {
760 return 3.5;
761 }
762
763 override int GetSeatAnimationType( int posIdx )
764 {
765 switch (posIdx)
766 {
767 case 0:
768 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
769 case 1:
770 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
771 case 2:
772 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
773 case 3:
774 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
775 }
776
777 return 0;
778
779 }
780
781
783 {
784 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
785 }
786
788 {
789 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
790 }
791
793 {
794 if (!super.CanReleaseAttachment(attachment))
795 {
796 return false;
797 }
798
799 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
800 {
801 string attType = attachment.GetType();
802 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
803 {
804 return false;
805 }
806 }
807
808 return true;
809 }
810
811 override protected bool CanManipulateSpareWheel(string slotSelectionName)
812 {
813 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
814 }
815
816 override bool CanDisplayAttachmentCategory( string category_name )
817 {
818 if (!super.CanDisplayAttachmentCategory(category_name))
819 {
820 return false;
821 }
822
823 category_name.ToLower();
824 if (category_name.Contains("engine"))
825 {
826 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
827 {
828 return false;
829 }
830 }
831
832 return true;
833 }
834
835 override bool CanDisplayCargo()
836 {
837 if (!super.CanDisplayCargo())
838 {
839 return false;
840 }
841
842 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
843 {
844 return false;
845 }
846
847 return true;
848 }
849
850 override int GetCarDoorsState(string slotType)
851 {
853
854 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
855 if (!carDoor)
856 {
857 return CarDoorState.DOORS_MISSING;
858 }
859
860 switch (slotType)
861 {
862 case "NivaDriverDoors":
863 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
864
865 case "NivaCoDriverDoors":
866 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
867
868 case "NivaHood":
869 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
870
871 case "NivaTrunk":
872 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
873 }
874
875 return CarDoorState.DOORS_MISSING;
876 }
877
878 override bool CrewCanGetThrough(int posIdx)
879 {
881 switch (posIdx)
882 {
883 case 0:
884 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
885 return false;
886 else if (GetAnimationPhase("SeatDriver") > 0.5)
887 return false;
888
889 return true;
890
891 case 1:
892 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
893 return false;
894 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
895 return false;
896
897 return true;
898
899 case 2:
900 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
901 return false;
902 else if (GetAnimationPhase("SeatDriver") <= 0.5)
903 return false;
904
905 return true;
906
907 case 3:
908 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
909 return false;
910 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
911 return false;
912
913 return true;
914 }
915
916 return false;
917 }
918
919 override string GetDoorSelectionNameFromSeatPos(int posIdx)
920 {
921 switch (posIdx)
922 {
923 case 0:
924 case 2:
925 return "doors_driver";
926 case 1:
927 case 3:
928 return "doors_codriver";
929 }
930
931 return super.GetDoorSelectionNameFromSeatPos(posIdx);
932 }
933
934 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
935 {
936 switch (posIdx)
937 {
938 case 0:
939 case 2:
940 return "NivaDriverDoors";
941 case 1:
942 case 3:
943 return "NivaCoDriverDoors";
944 }
945
946 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
947 }
948
949 // 0 full ambient and engine sound
950 // 1 zero ambient and engine sound
951 override float OnSound(CarSoundCtrl ctrl, float oldValue)
952 {
953 float tempCap = 0.0;
954
955 switch (ctrl)
956 {
957 case CarSoundCtrl.DOORS:
958 float newValue = 0;
959 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
960 {
961 newValue += 0.5;
962 }
963
964 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
965 {
966 newValue += 0.5;
967 }
968
969 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
970 {
971 newValue += 0.3;
972 }
973
974 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
975 {
976 newValue -= 0.6;
977 }
978
979 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
980 {
981 newValue -= 0.2;
982 }
983
984 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
985 {
986 newValue -= 0.2;
987 }
988
989 return Math.Clamp(newValue, 0, 1);
990 break;
991 }
992
993 return super.OnSound(ctrl, oldValue);
994 }
995
996 override string GetAnimSourceFromSelection( string selection )
997 {
998 switch (selection)
999 {
1000 case "doors_driver":
1001 return "DoorsDriver";
1002 case "doors_codriver":
1003 return "DoorsCoDriver";
1004 case "doors_hood":
1005 return "DoorsHood";
1006 case "doors_trunk":
1007 return "DoorsTrunk";
1008 case "seatback_driver":
1009 return "SeatDriver";
1010 case "seatback_codriver":
1011 return "SeatCoDriver";
1012 }
1013
1014 return "";
1015 }
1016
1017 override string GetDoorConditionPointFromSelection(string selection)
1018 {
1019 switch (selection)
1020 {
1021 case "seat_driver":
1022 case "seatback_driver":
1023 case "seat_cargo1":
1024 return "seat_con_1_1";
1025 case "seat_codriver":
1026 case "seatback_codriver":
1027 case "seat_cargo2":
1028 return "seat_con_2_1";
1029 }
1030
1031 return "";
1032 }
1033
1034 override int GetCrewIndex(string selection)
1035 {
1036 switch (selection)
1037 {
1038 case "seatback_driver":
1039 return 0;
1040 case "seatback_codriver":
1041 return 1;
1042 }
1043
1044 return -1;
1045 }
1046
1047 override bool IsVitalTruckBattery()
1048 {
1049 return false;
1050 }
1051
1052 override bool IsVitalGlowPlug()
1053 {
1054 return false;
1055 }
1056
1057 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1058 {
1059 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1060 return false;
1061
1062 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1063 return false;
1064
1065 switch (currentSeat)
1066 {
1067 case 0:
1068 return nextSeat == 1;
1069
1070 case 1:
1071 return nextSeat == 0;
1072
1073 case 2:
1074 return nextSeat == 3;
1075
1076 case 3:
1077 return nextSeat == 2;
1078 }
1079
1080 return false;
1081 }
1082
1083 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1084 {
1085 switch (pCurrentSeat)
1086 {
1087 case 0:
1088 return pDoorsSelection == "DoorsDriver";
1089
1090 case 1:
1091 return pDoorsSelection == "DoorsCoDriver";
1092
1093 case 2:
1094 return pDoorsSelection == "DoorsDriver";
1095
1096 case 3:
1097 return pDoorsSelection == "DoorsCoDriver";
1098 }
1099
1100 return false;
1101 }
1102
1103 override int GetSeatIndexFromDoor( string pDoorSelection )
1104 {
1105 switch (pDoorSelection)
1106 {
1107 case "DoorsDriver":
1108 return 0;
1109 case "DoorsCoDriver":
1110 return 1;
1111 }
1112
1113 return -1;
1114 }
1115
1116 override void SetActions()
1117 {
1118 super.SetActions();
1119
1121 }
1122
1123 override void OnDebugSpawn()
1124 {
1128
1129 GetInventory().CreateInInventory("HatchbackWheel");
1130 GetInventory().CreateInInventory("HatchbackWheel");
1131 GetInventory().CreateInInventory("HatchbackWheel" );
1132 GetInventory().CreateInInventory("HatchbackWheel");
1133
1134 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1135 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1136 GetInventory().CreateInInventory("HatchbackHood");
1137 GetInventory().CreateInInventory("HatchbackTrunk");
1138
1139 //-----IN CAR CARGO
1140 GetInventory().CreateInInventory("HatchbackWheel");
1141 GetInventory().CreateInInventory("HatchbackWheel");
1142 }
1143}
1144
1146{
1147 override void OnDebugSpawn()
1148 {
1152
1153 GetInventory().CreateInInventory("HatchbackWheel");
1154 GetInventory().CreateInInventory("HatchbackWheel");
1155 GetInventory().CreateInInventory("HatchbackWheel");
1156 GetInventory().CreateInInventory("HatchbackWheel");
1157
1158 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1159 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1160 GetInventory().CreateInInventory("HatchbackHood_White");
1161 GetInventory().CreateInInventory("HatchbackTrunk_White");
1162
1163 //-----IN CAR CARGO
1164 GetInventory().CreateInInventory("HatchbackWheel");
1165 GetInventory().CreateInInventory("HatchbackWheel");
1166 }
1167}
1168
1170{
1171 override void OnDebugSpawn()
1172 {
1176
1177 GetInventory().CreateInInventory("HatchbackWheel");
1178 GetInventory().CreateInInventory("HatchbackWheel");
1179 GetInventory().CreateInInventory("HatchbackWheel");
1180 GetInventory().CreateInInventory("HatchbackWheel");
1181
1182 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1183 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1184 GetInventory().CreateInInventory("HatchbackHood_Blue");
1185 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1186
1187 //-----IN CAR CARGO
1188 GetInventory().CreateInInventory("HatchbackWheel");
1189 GetInventory().CreateInInventory("HatchbackWheel");
1190 }
1191}

◆ EEInit()

override void EEInit ( )
protected

◆ EOnPostSimulate()

override void EOnPostSimulate ( IEntity other,
float timeSlice )
protected
540{
544
545 void OffroadHatchback()
546 {
547 //m_dmgContactCoef = 0.075;
548
549 m_EngineStartOK = "offroad_engine_start_SoundSet";
550 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
551 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
552 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
553 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
554
555 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
556 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
557 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
558 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
559
560 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
561 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
562
563 SetEnginePos("0 0.7 1.2");
564 }
565
566 override void EEInit()
567 {
568 super.EEInit();
569
570 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
571 {
573 m_UTSSettings.m_ManualUpdate = true;
574 m_UTSSettings.m_TemperatureMin = 0;
575 m_UTSSettings.m_TemperatureMax = 30;
577 m_UTSSettings.m_TemperatureCap = 0;
578 m_UTSSettings.m_RangeFull = 0.5;
579 m_UTSSettings.m_RangeMax = 2;
580
583 }
584 }
585
586 override void OnEngineStart()
587 {
588 super.OnEngineStart();
589
590 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
591 {
592 m_UTSource.SetDefferedActive(true, 20.0);
593 }
594 }
595
596 override void OnEngineStop()
597 {
598 super.OnEngineStop();
599
600 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
601 {
602 m_UTSource.SetDefferedActive(false, 10.0);
603 }
604 }
605
606 override void EOnPostSimulate(IEntity other, float timeSlice)
607 {
608 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
609 {
610 if (m_UTSource.IsActive())
611 {
613 }
614 }
615 }
616
617 override int GetAnimInstance()
618 {
619 return VehicleAnimInstances.HATCHBACK;
620 }
621
622 override float GetTransportCameraDistance()
623 {
624 return 3.5;
625 }
626
627 override int GetSeatAnimationType( int posIdx )
628 {
629 switch (posIdx)
630 {
631 case 0:
632 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
633 case 1:
634 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
635 case 2:
636 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
637 case 3:
638 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
639 }
640
641 return 0;
642
643 }
644
645
647 {
648 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
649 }
650
652 {
653 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
654 }
655
657 {
658 if (!super.CanReleaseAttachment(attachment))
659 {
660 return false;
661 }
662
663 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
664 {
665 string attType = attachment.GetType();
666 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
667 {
668 return false;
669 }
670 }
671
672 return true;
673 }
674
675 override protected bool CanManipulateSpareWheel(string slotSelectionName)
676 {
677 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
678 }
679
680 override bool CanDisplayAttachmentCategory( string category_name )
681 {
682 if (!super.CanDisplayAttachmentCategory(category_name))
683 {
684 return false;
685 }
686
687 category_name.ToLower();
688 if (category_name.Contains("engine"))
689 {
690 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
691 {
692 return false;
693 }
694 }
695
696 return true;
697 }
698
699 override bool CanDisplayCargo()
700 {
701 if (!super.CanDisplayCargo())
702 {
703 return false;
704 }
705
706 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
707 {
708 return false;
709 }
710
711 return true;
712 }
713
714 override int GetCarDoorsState(string slotType)
715 {
717
718 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
719 if (!carDoor)
720 {
721 return CarDoorState.DOORS_MISSING;
722 }
723
724 switch (slotType)
725 {
726 case "NivaDriverDoors":
727 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
728
729 case "NivaCoDriverDoors":
730 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
731
732 case "NivaHood":
733 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
734
735 case "NivaTrunk":
736 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
737 }
738
739 return CarDoorState.DOORS_MISSING;
740 }
741
742 override bool CrewCanGetThrough(int posIdx)
743 {
745 switch (posIdx)
746 {
747 case 0:
748 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
749 return false;
750 else if (GetAnimationPhase("SeatDriver") > 0.5)
751 return false;
752
753 return true;
754
755 case 1:
756 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
757 return false;
758 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
759 return false;
760
761 return true;
762
763 case 2:
764 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
765 return false;
766 else if (GetAnimationPhase("SeatDriver") <= 0.5)
767 return false;
768
769 return true;
770
771 case 3:
772 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
773 return false;
774 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
775 return false;
776
777 return true;
778 }
779
780 return false;
781 }
782
783 override string GetDoorSelectionNameFromSeatPos(int posIdx)
784 {
785 switch (posIdx)
786 {
787 case 0:
788 case 2:
789 return "doors_driver";
790 case 1:
791 case 3:
792 return "doors_codriver";
793 }
794
795 return super.GetDoorSelectionNameFromSeatPos(posIdx);
796 }
797
798 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
799 {
800 switch (posIdx)
801 {
802 case 0:
803 case 2:
804 return "NivaDriverDoors";
805 case 1:
806 case 3:
807 return "NivaCoDriverDoors";
808 }
809
810 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
811 }
812
813 // 0 full ambient and engine sound
814 // 1 zero ambient and engine sound
815 override float OnSound(CarSoundCtrl ctrl, float oldValue)
816 {
817 float tempCap = 0.0;
818
819 switch (ctrl)
820 {
821 case CarSoundCtrl.DOORS:
822 float newValue = 0;
823 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
824 {
825 newValue += 0.5;
826 }
827
828 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
829 {
830 newValue += 0.5;
831 }
832
833 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
834 {
835 newValue += 0.3;
836 }
837
838 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
839 {
840 newValue -= 0.6;
841 }
842
843 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
844 {
845 newValue -= 0.2;
846 }
847
848 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
849 {
850 newValue -= 0.2;
851 }
852
853 return Math.Clamp(newValue, 0, 1);
854 break;
855 }
856
857 return super.OnSound(ctrl, oldValue);
858 }
859
860 override string GetAnimSourceFromSelection( string selection )
861 {
862 switch (selection)
863 {
864 case "doors_driver":
865 return "DoorsDriver";
866 case "doors_codriver":
867 return "DoorsCoDriver";
868 case "doors_hood":
869 return "DoorsHood";
870 case "doors_trunk":
871 return "DoorsTrunk";
872 case "seatback_driver":
873 return "SeatDriver";
874 case "seatback_codriver":
875 return "SeatCoDriver";
876 }
877
878 return "";
879 }
880
881 override string GetDoorConditionPointFromSelection(string selection)
882 {
883 switch (selection)
884 {
885 case "seat_driver":
886 case "seatback_driver":
887 case "seat_cargo1":
888 return "seat_con_1_1";
889 case "seat_codriver":
890 case "seatback_codriver":
891 case "seat_cargo2":
892 return "seat_con_2_1";
893 }
894
895 return "";
896 }
897
898 override int GetCrewIndex(string selection)
899 {
900 switch (selection)
901 {
902 case "seatback_driver":
903 return 0;
904 case "seatback_codriver":
905 return 1;
906 }
907
908 return -1;
909 }
910
911 override bool IsVitalTruckBattery()
912 {
913 return false;
914 }
915
916 override bool IsVitalGlowPlug()
917 {
918 return false;
919 }
920
921 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
922 {
923 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
924 return false;
925
926 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
927 return false;
928
929 switch (currentSeat)
930 {
931 case 0:
932 return nextSeat == 1;
933
934 case 1:
935 return nextSeat == 0;
936
937 case 2:
938 return nextSeat == 3;
939
940 case 3:
941 return nextSeat == 2;
942 }
943
944 return false;
945 }
946
947 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
948 {
949 switch (pCurrentSeat)
950 {
951 case 0:
952 return pDoorsSelection == "DoorsDriver";
953
954 case 1:
955 return pDoorsSelection == "DoorsCoDriver";
956
957 case 2:
958 return pDoorsSelection == "DoorsDriver";
959
960 case 3:
961 return pDoorsSelection == "DoorsCoDriver";
962 }
963
964 return false;
965 }
966
967 override int GetSeatIndexFromDoor( string pDoorSelection )
968 {
969 switch (pDoorSelection)
970 {
971 case "DoorsDriver":
972 return 0;
973 case "DoorsCoDriver":
974 return 1;
975 }
976
977 return -1;
978 }
979
980 override void SetActions()
981 {
982 super.SetActions();
983
985 }
986
987 override void OnDebugSpawn()
988 {
992
993 GetInventory().CreateInInventory("HatchbackWheel");
994 GetInventory().CreateInInventory("HatchbackWheel");
995 GetInventory().CreateInInventory("HatchbackWheel" );
996 GetInventory().CreateInInventory("HatchbackWheel");
997
998 GetInventory().CreateInInventory("HatchbackDoors_Driver");
999 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1000 GetInventory().CreateInInventory("HatchbackHood");
1001 GetInventory().CreateInInventory("HatchbackTrunk");
1002
1003 //-----IN CAR CARGO
1004 GetInventory().CreateInInventory("HatchbackWheel");
1005 GetInventory().CreateInInventory("HatchbackWheel");
1006 }
1007}
1008
1010{
1011 override void OnDebugSpawn()
1012 {
1016
1017 GetInventory().CreateInInventory("HatchbackWheel");
1018 GetInventory().CreateInInventory("HatchbackWheel");
1019 GetInventory().CreateInInventory("HatchbackWheel");
1020 GetInventory().CreateInInventory("HatchbackWheel");
1021
1022 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1023 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1024 GetInventory().CreateInInventory("HatchbackHood_White");
1025 GetInventory().CreateInInventory("HatchbackTrunk_White");
1026
1027 //-----IN CAR CARGO
1028 GetInventory().CreateInInventory("HatchbackWheel");
1029 GetInventory().CreateInInventory("HatchbackWheel");
1030 }
1031}
1032
1034{
1035 override void OnDebugSpawn()
1036 {
1040
1041 GetInventory().CreateInInventory("HatchbackWheel");
1042 GetInventory().CreateInInventory("HatchbackWheel");
1043 GetInventory().CreateInInventory("HatchbackWheel");
1044 GetInventory().CreateInInventory("HatchbackWheel");
1045
1046 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1047 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1048 GetInventory().CreateInInventory("HatchbackHood_Blue");
1049 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1050
1051 //-----IN CAR CARGO
1052 GetInventory().CreateInInventory("HatchbackWheel");
1053 GetInventory().CreateInInventory("HatchbackWheel");
1054 }
1055}

◆ GetAnimInstance()

override int GetAnimInstance ( )
protected
551{
555
556 void OffroadHatchback()
557 {
558 //m_dmgContactCoef = 0.075;
559
560 m_EngineStartOK = "offroad_engine_start_SoundSet";
561 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
562 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
563 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
564 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
565
566 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
567 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
568 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
569 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
570
571 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
572 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
573
574 SetEnginePos("0 0.7 1.2");
575 }
576
577 override void EEInit()
578 {
579 super.EEInit();
580
581 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
582 {
584 m_UTSSettings.m_ManualUpdate = true;
585 m_UTSSettings.m_TemperatureMin = 0;
586 m_UTSSettings.m_TemperatureMax = 30;
588 m_UTSSettings.m_TemperatureCap = 0;
589 m_UTSSettings.m_RangeFull = 0.5;
590 m_UTSSettings.m_RangeMax = 2;
591
594 }
595 }
596
597 override void OnEngineStart()
598 {
599 super.OnEngineStart();
600
601 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
602 {
603 m_UTSource.SetDefferedActive(true, 20.0);
604 }
605 }
606
607 override void OnEngineStop()
608 {
609 super.OnEngineStop();
610
611 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
612 {
613 m_UTSource.SetDefferedActive(false, 10.0);
614 }
615 }
616
617 override void EOnPostSimulate(IEntity other, float timeSlice)
618 {
619 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
620 {
621 if (m_UTSource.IsActive())
622 {
624 }
625 }
626 }
627
628 override int GetAnimInstance()
629 {
630 return VehicleAnimInstances.HATCHBACK;
631 }
632
633 override float GetTransportCameraDistance()
634 {
635 return 3.5;
636 }
637
638 override int GetSeatAnimationType( int posIdx )
639 {
640 switch (posIdx)
641 {
642 case 0:
643 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
644 case 1:
645 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
646 case 2:
647 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
648 case 3:
649 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
650 }
651
652 return 0;
653
654 }
655
656
658 {
659 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
660 }
661
663 {
664 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
665 }
666
668 {
669 if (!super.CanReleaseAttachment(attachment))
670 {
671 return false;
672 }
673
674 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
675 {
676 string attType = attachment.GetType();
677 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
678 {
679 return false;
680 }
681 }
682
683 return true;
684 }
685
686 override protected bool CanManipulateSpareWheel(string slotSelectionName)
687 {
688 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
689 }
690
691 override bool CanDisplayAttachmentCategory( string category_name )
692 {
693 if (!super.CanDisplayAttachmentCategory(category_name))
694 {
695 return false;
696 }
697
698 category_name.ToLower();
699 if (category_name.Contains("engine"))
700 {
701 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
702 {
703 return false;
704 }
705 }
706
707 return true;
708 }
709
710 override bool CanDisplayCargo()
711 {
712 if (!super.CanDisplayCargo())
713 {
714 return false;
715 }
716
717 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
718 {
719 return false;
720 }
721
722 return true;
723 }
724
725 override int GetCarDoorsState(string slotType)
726 {
728
729 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
730 if (!carDoor)
731 {
732 return CarDoorState.DOORS_MISSING;
733 }
734
735 switch (slotType)
736 {
737 case "NivaDriverDoors":
738 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
739
740 case "NivaCoDriverDoors":
741 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
742
743 case "NivaHood":
744 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
745
746 case "NivaTrunk":
747 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
748 }
749
750 return CarDoorState.DOORS_MISSING;
751 }
752
753 override bool CrewCanGetThrough(int posIdx)
754 {
756 switch (posIdx)
757 {
758 case 0:
759 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
760 return false;
761 else if (GetAnimationPhase("SeatDriver") > 0.5)
762 return false;
763
764 return true;
765
766 case 1:
767 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
768 return false;
769 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
770 return false;
771
772 return true;
773
774 case 2:
775 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
776 return false;
777 else if (GetAnimationPhase("SeatDriver") <= 0.5)
778 return false;
779
780 return true;
781
782 case 3:
783 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
784 return false;
785 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
786 return false;
787
788 return true;
789 }
790
791 return false;
792 }
793
794 override string GetDoorSelectionNameFromSeatPos(int posIdx)
795 {
796 switch (posIdx)
797 {
798 case 0:
799 case 2:
800 return "doors_driver";
801 case 1:
802 case 3:
803 return "doors_codriver";
804 }
805
806 return super.GetDoorSelectionNameFromSeatPos(posIdx);
807 }
808
809 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
810 {
811 switch (posIdx)
812 {
813 case 0:
814 case 2:
815 return "NivaDriverDoors";
816 case 1:
817 case 3:
818 return "NivaCoDriverDoors";
819 }
820
821 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
822 }
823
824 // 0 full ambient and engine sound
825 // 1 zero ambient and engine sound
826 override float OnSound(CarSoundCtrl ctrl, float oldValue)
827 {
828 float tempCap = 0.0;
829
830 switch (ctrl)
831 {
832 case CarSoundCtrl.DOORS:
833 float newValue = 0;
834 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
835 {
836 newValue += 0.5;
837 }
838
839 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
840 {
841 newValue += 0.5;
842 }
843
844 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
845 {
846 newValue += 0.3;
847 }
848
849 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
850 {
851 newValue -= 0.6;
852 }
853
854 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
855 {
856 newValue -= 0.2;
857 }
858
859 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
860 {
861 newValue -= 0.2;
862 }
863
864 return Math.Clamp(newValue, 0, 1);
865 break;
866 }
867
868 return super.OnSound(ctrl, oldValue);
869 }
870
871 override string GetAnimSourceFromSelection( string selection )
872 {
873 switch (selection)
874 {
875 case "doors_driver":
876 return "DoorsDriver";
877 case "doors_codriver":
878 return "DoorsCoDriver";
879 case "doors_hood":
880 return "DoorsHood";
881 case "doors_trunk":
882 return "DoorsTrunk";
883 case "seatback_driver":
884 return "SeatDriver";
885 case "seatback_codriver":
886 return "SeatCoDriver";
887 }
888
889 return "";
890 }
891
892 override string GetDoorConditionPointFromSelection(string selection)
893 {
894 switch (selection)
895 {
896 case "seat_driver":
897 case "seatback_driver":
898 case "seat_cargo1":
899 return "seat_con_1_1";
900 case "seat_codriver":
901 case "seatback_codriver":
902 case "seat_cargo2":
903 return "seat_con_2_1";
904 }
905
906 return "";
907 }
908
909 override int GetCrewIndex(string selection)
910 {
911 switch (selection)
912 {
913 case "seatback_driver":
914 return 0;
915 case "seatback_codriver":
916 return 1;
917 }
918
919 return -1;
920 }
921
922 override bool IsVitalTruckBattery()
923 {
924 return false;
925 }
926
927 override bool IsVitalGlowPlug()
928 {
929 return false;
930 }
931
932 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
933 {
934 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
935 return false;
936
937 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
938 return false;
939
940 switch (currentSeat)
941 {
942 case 0:
943 return nextSeat == 1;
944
945 case 1:
946 return nextSeat == 0;
947
948 case 2:
949 return nextSeat == 3;
950
951 case 3:
952 return nextSeat == 2;
953 }
954
955 return false;
956 }
957
958 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
959 {
960 switch (pCurrentSeat)
961 {
962 case 0:
963 return pDoorsSelection == "DoorsDriver";
964
965 case 1:
966 return pDoorsSelection == "DoorsCoDriver";
967
968 case 2:
969 return pDoorsSelection == "DoorsDriver";
970
971 case 3:
972 return pDoorsSelection == "DoorsCoDriver";
973 }
974
975 return false;
976 }
977
978 override int GetSeatIndexFromDoor( string pDoorSelection )
979 {
980 switch (pDoorSelection)
981 {
982 case "DoorsDriver":
983 return 0;
984 case "DoorsCoDriver":
985 return 1;
986 }
987
988 return -1;
989 }
990
991 override void SetActions()
992 {
993 super.SetActions();
994
996 }
997
998 override void OnDebugSpawn()
999 {
1003
1004 GetInventory().CreateInInventory("HatchbackWheel");
1005 GetInventory().CreateInInventory("HatchbackWheel");
1006 GetInventory().CreateInInventory("HatchbackWheel" );
1007 GetInventory().CreateInInventory("HatchbackWheel");
1008
1009 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1010 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1011 GetInventory().CreateInInventory("HatchbackHood");
1012 GetInventory().CreateInInventory("HatchbackTrunk");
1013
1014 //-----IN CAR CARGO
1015 GetInventory().CreateInInventory("HatchbackWheel");
1016 GetInventory().CreateInInventory("HatchbackWheel");
1017 }
1018}
1019
1021{
1022 override void OnDebugSpawn()
1023 {
1027
1028 GetInventory().CreateInInventory("HatchbackWheel");
1029 GetInventory().CreateInInventory("HatchbackWheel");
1030 GetInventory().CreateInInventory("HatchbackWheel");
1031 GetInventory().CreateInInventory("HatchbackWheel");
1032
1033 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1034 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1035 GetInventory().CreateInInventory("HatchbackHood_White");
1036 GetInventory().CreateInInventory("HatchbackTrunk_White");
1037
1038 //-----IN CAR CARGO
1039 GetInventory().CreateInInventory("HatchbackWheel");
1040 GetInventory().CreateInInventory("HatchbackWheel");
1041 }
1042}
1043
1045{
1046 override void OnDebugSpawn()
1047 {
1051
1052 GetInventory().CreateInInventory("HatchbackWheel");
1053 GetInventory().CreateInInventory("HatchbackWheel");
1054 GetInventory().CreateInInventory("HatchbackWheel");
1055 GetInventory().CreateInInventory("HatchbackWheel");
1056
1057 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1058 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1059 GetInventory().CreateInInventory("HatchbackHood_Blue");
1060 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1061
1062 //-----IN CAR CARGO
1063 GetInventory().CreateInInventory("HatchbackWheel");
1064 GetInventory().CreateInInventory("HatchbackWheel");
1065 }
1066}

◆ GetAnimSourceFromSelection()

override string GetAnimSourceFromSelection ( string selection)
protected
794{
798
799 void OffroadHatchback()
800 {
801 //m_dmgContactCoef = 0.075;
802
803 m_EngineStartOK = "offroad_engine_start_SoundSet";
804 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
805 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
806 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
807 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
808
809 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
810 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
811 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
812 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
813
814 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
815 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
816
817 SetEnginePos("0 0.7 1.2");
818 }
819
820 override void EEInit()
821 {
822 super.EEInit();
823
824 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
825 {
827 m_UTSSettings.m_ManualUpdate = true;
828 m_UTSSettings.m_TemperatureMin = 0;
829 m_UTSSettings.m_TemperatureMax = 30;
831 m_UTSSettings.m_TemperatureCap = 0;
832 m_UTSSettings.m_RangeFull = 0.5;
833 m_UTSSettings.m_RangeMax = 2;
834
837 }
838 }
839
840 override void OnEngineStart()
841 {
842 super.OnEngineStart();
843
844 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
845 {
846 m_UTSource.SetDefferedActive(true, 20.0);
847 }
848 }
849
850 override void OnEngineStop()
851 {
852 super.OnEngineStop();
853
854 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
855 {
856 m_UTSource.SetDefferedActive(false, 10.0);
857 }
858 }
859
860 override void EOnPostSimulate(IEntity other, float timeSlice)
861 {
862 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
863 {
864 if (m_UTSource.IsActive())
865 {
867 }
868 }
869 }
870
871 override int GetAnimInstance()
872 {
873 return VehicleAnimInstances.HATCHBACK;
874 }
875
876 override float GetTransportCameraDistance()
877 {
878 return 3.5;
879 }
880
881 override int GetSeatAnimationType( int posIdx )
882 {
883 switch (posIdx)
884 {
885 case 0:
886 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
887 case 1:
888 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
889 case 2:
890 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
891 case 3:
892 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
893 }
894
895 return 0;
896
897 }
898
899
901 {
902 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
903 }
904
906 {
907 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
908 }
909
911 {
912 if (!super.CanReleaseAttachment(attachment))
913 {
914 return false;
915 }
916
917 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
918 {
919 string attType = attachment.GetType();
920 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
921 {
922 return false;
923 }
924 }
925
926 return true;
927 }
928
929 override protected bool CanManipulateSpareWheel(string slotSelectionName)
930 {
931 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
932 }
933
934 override bool CanDisplayAttachmentCategory( string category_name )
935 {
936 if (!super.CanDisplayAttachmentCategory(category_name))
937 {
938 return false;
939 }
940
941 category_name.ToLower();
942 if (category_name.Contains("engine"))
943 {
944 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
945 {
946 return false;
947 }
948 }
949
950 return true;
951 }
952
953 override bool CanDisplayCargo()
954 {
955 if (!super.CanDisplayCargo())
956 {
957 return false;
958 }
959
960 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
961 {
962 return false;
963 }
964
965 return true;
966 }
967
968 override int GetCarDoorsState(string slotType)
969 {
971
972 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
973 if (!carDoor)
974 {
975 return CarDoorState.DOORS_MISSING;
976 }
977
978 switch (slotType)
979 {
980 case "NivaDriverDoors":
981 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
982
983 case "NivaCoDriverDoors":
984 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
985
986 case "NivaHood":
987 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
988
989 case "NivaTrunk":
990 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
991 }
992
993 return CarDoorState.DOORS_MISSING;
994 }
995
996 override bool CrewCanGetThrough(int posIdx)
997 {
999 switch (posIdx)
1000 {
1001 case 0:
1002 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1003 return false;
1004 else if (GetAnimationPhase("SeatDriver") > 0.5)
1005 return false;
1006
1007 return true;
1008
1009 case 1:
1010 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1011 return false;
1012 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1013 return false;
1014
1015 return true;
1016
1017 case 2:
1018 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1019 return false;
1020 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1021 return false;
1022
1023 return true;
1024
1025 case 3:
1026 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1027 return false;
1028 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1029 return false;
1030
1031 return true;
1032 }
1033
1034 return false;
1035 }
1036
1037 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1038 {
1039 switch (posIdx)
1040 {
1041 case 0:
1042 case 2:
1043 return "doors_driver";
1044 case 1:
1045 case 3:
1046 return "doors_codriver";
1047 }
1048
1049 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1050 }
1051
1052 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1053 {
1054 switch (posIdx)
1055 {
1056 case 0:
1057 case 2:
1058 return "NivaDriverDoors";
1059 case 1:
1060 case 3:
1061 return "NivaCoDriverDoors";
1062 }
1063
1064 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1065 }
1066
1067 // 0 full ambient and engine sound
1068 // 1 zero ambient and engine sound
1069 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1070 {
1071 float tempCap = 0.0;
1072
1073 switch (ctrl)
1074 {
1075 case CarSoundCtrl.DOORS:
1076 float newValue = 0;
1077 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1078 {
1079 newValue += 0.5;
1080 }
1081
1082 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1083 {
1084 newValue += 0.5;
1085 }
1086
1087 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1088 {
1089 newValue += 0.3;
1090 }
1091
1092 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1093 {
1094 newValue -= 0.6;
1095 }
1096
1097 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1098 {
1099 newValue -= 0.2;
1100 }
1101
1102 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1103 {
1104 newValue -= 0.2;
1105 }
1106
1107 return Math.Clamp(newValue, 0, 1);
1108 break;
1109 }
1110
1111 return super.OnSound(ctrl, oldValue);
1112 }
1113
1114 override string GetAnimSourceFromSelection( string selection )
1115 {
1116 switch (selection)
1117 {
1118 case "doors_driver":
1119 return "DoorsDriver";
1120 case "doors_codriver":
1121 return "DoorsCoDriver";
1122 case "doors_hood":
1123 return "DoorsHood";
1124 case "doors_trunk":
1125 return "DoorsTrunk";
1126 case "seatback_driver":
1127 return "SeatDriver";
1128 case "seatback_codriver":
1129 return "SeatCoDriver";
1130 }
1131
1132 return "";
1133 }
1134
1135 override string GetDoorConditionPointFromSelection(string selection)
1136 {
1137 switch (selection)
1138 {
1139 case "seat_driver":
1140 case "seatback_driver":
1141 case "seat_cargo1":
1142 return "seat_con_1_1";
1143 case "seat_codriver":
1144 case "seatback_codriver":
1145 case "seat_cargo2":
1146 return "seat_con_2_1";
1147 }
1148
1149 return "";
1150 }
1151
1152 override int GetCrewIndex(string selection)
1153 {
1154 switch (selection)
1155 {
1156 case "seatback_driver":
1157 return 0;
1158 case "seatback_codriver":
1159 return 1;
1160 }
1161
1162 return -1;
1163 }
1164
1165 override bool IsVitalTruckBattery()
1166 {
1167 return false;
1168 }
1169
1170 override bool IsVitalGlowPlug()
1171 {
1172 return false;
1173 }
1174
1175 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1176 {
1177 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1178 return false;
1179
1180 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1181 return false;
1182
1183 switch (currentSeat)
1184 {
1185 case 0:
1186 return nextSeat == 1;
1187
1188 case 1:
1189 return nextSeat == 0;
1190
1191 case 2:
1192 return nextSeat == 3;
1193
1194 case 3:
1195 return nextSeat == 2;
1196 }
1197
1198 return false;
1199 }
1200
1201 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1202 {
1203 switch (pCurrentSeat)
1204 {
1205 case 0:
1206 return pDoorsSelection == "DoorsDriver";
1207
1208 case 1:
1209 return pDoorsSelection == "DoorsCoDriver";
1210
1211 case 2:
1212 return pDoorsSelection == "DoorsDriver";
1213
1214 case 3:
1215 return pDoorsSelection == "DoorsCoDriver";
1216 }
1217
1218 return false;
1219 }
1220
1221 override int GetSeatIndexFromDoor( string pDoorSelection )
1222 {
1223 switch (pDoorSelection)
1224 {
1225 case "DoorsDriver":
1226 return 0;
1227 case "DoorsCoDriver":
1228 return 1;
1229 }
1230
1231 return -1;
1232 }
1233
1234 override void SetActions()
1235 {
1236 super.SetActions();
1237
1239 }
1240
1241 override void OnDebugSpawn()
1242 {
1246
1247 GetInventory().CreateInInventory("HatchbackWheel");
1248 GetInventory().CreateInInventory("HatchbackWheel");
1249 GetInventory().CreateInInventory("HatchbackWheel" );
1250 GetInventory().CreateInInventory("HatchbackWheel");
1251
1252 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1253 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1254 GetInventory().CreateInInventory("HatchbackHood");
1255 GetInventory().CreateInInventory("HatchbackTrunk");
1256
1257 //-----IN CAR CARGO
1258 GetInventory().CreateInInventory("HatchbackWheel");
1259 GetInventory().CreateInInventory("HatchbackWheel");
1260 }
1261}
1262
1264{
1265 override void OnDebugSpawn()
1266 {
1270
1271 GetInventory().CreateInInventory("HatchbackWheel");
1272 GetInventory().CreateInInventory("HatchbackWheel");
1273 GetInventory().CreateInInventory("HatchbackWheel");
1274 GetInventory().CreateInInventory("HatchbackWheel");
1275
1276 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1277 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1278 GetInventory().CreateInInventory("HatchbackHood_White");
1279 GetInventory().CreateInInventory("HatchbackTrunk_White");
1280
1281 //-----IN CAR CARGO
1282 GetInventory().CreateInInventory("HatchbackWheel");
1283 GetInventory().CreateInInventory("HatchbackWheel");
1284 }
1285}
1286
1288{
1289 override void OnDebugSpawn()
1290 {
1294
1295 GetInventory().CreateInInventory("HatchbackWheel");
1296 GetInventory().CreateInInventory("HatchbackWheel");
1297 GetInventory().CreateInInventory("HatchbackWheel");
1298 GetInventory().CreateInInventory("HatchbackWheel");
1299
1300 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1301 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1302 GetInventory().CreateInInventory("HatchbackHood_Blue");
1303 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1304
1305 //-----IN CAR CARGO
1306 GetInventory().CreateInInventory("HatchbackWheel");
1307 GetInventory().CreateInInventory("HatchbackWheel");
1308 }
1309}

◆ GetCarDoorsState()

override int GetCarDoorsState ( string slotType)
protected
648{
652
653 void OffroadHatchback()
654 {
655 //m_dmgContactCoef = 0.075;
656
657 m_EngineStartOK = "offroad_engine_start_SoundSet";
658 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
659 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
660 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
661 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
662
663 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
664 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
665 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
666 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
667
668 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
669 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
670
671 SetEnginePos("0 0.7 1.2");
672 }
673
674 override void EEInit()
675 {
676 super.EEInit();
677
678 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
679 {
681 m_UTSSettings.m_ManualUpdate = true;
682 m_UTSSettings.m_TemperatureMin = 0;
683 m_UTSSettings.m_TemperatureMax = 30;
685 m_UTSSettings.m_TemperatureCap = 0;
686 m_UTSSettings.m_RangeFull = 0.5;
687 m_UTSSettings.m_RangeMax = 2;
688
691 }
692 }
693
694 override void OnEngineStart()
695 {
696 super.OnEngineStart();
697
698 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
699 {
700 m_UTSource.SetDefferedActive(true, 20.0);
701 }
702 }
703
704 override void OnEngineStop()
705 {
706 super.OnEngineStop();
707
708 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
709 {
710 m_UTSource.SetDefferedActive(false, 10.0);
711 }
712 }
713
714 override void EOnPostSimulate(IEntity other, float timeSlice)
715 {
716 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
717 {
718 if (m_UTSource.IsActive())
719 {
721 }
722 }
723 }
724
725 override int GetAnimInstance()
726 {
727 return VehicleAnimInstances.HATCHBACK;
728 }
729
730 override float GetTransportCameraDistance()
731 {
732 return 3.5;
733 }
734
735 override int GetSeatAnimationType( int posIdx )
736 {
737 switch (posIdx)
738 {
739 case 0:
740 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
741 case 1:
742 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
743 case 2:
744 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
745 case 3:
746 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
747 }
748
749 return 0;
750
751 }
752
753
755 {
756 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
757 }
758
760 {
761 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
762 }
763
765 {
766 if (!super.CanReleaseAttachment(attachment))
767 {
768 return false;
769 }
770
771 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
772 {
773 string attType = attachment.GetType();
774 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
775 {
776 return false;
777 }
778 }
779
780 return true;
781 }
782
783 override protected bool CanManipulateSpareWheel(string slotSelectionName)
784 {
785 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
786 }
787
788 override bool CanDisplayAttachmentCategory( string category_name )
789 {
790 if (!super.CanDisplayAttachmentCategory(category_name))
791 {
792 return false;
793 }
794
795 category_name.ToLower();
796 if (category_name.Contains("engine"))
797 {
798 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
799 {
800 return false;
801 }
802 }
803
804 return true;
805 }
806
807 override bool CanDisplayCargo()
808 {
809 if (!super.CanDisplayCargo())
810 {
811 return false;
812 }
813
814 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
815 {
816 return false;
817 }
818
819 return true;
820 }
821
822 override int GetCarDoorsState(string slotType)
823 {
825
826 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
827 if (!carDoor)
828 {
829 return CarDoorState.DOORS_MISSING;
830 }
831
832 switch (slotType)
833 {
834 case "NivaDriverDoors":
835 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
836
837 case "NivaCoDriverDoors":
838 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
839
840 case "NivaHood":
841 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
842
843 case "NivaTrunk":
844 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
845 }
846
847 return CarDoorState.DOORS_MISSING;
848 }
849
850 override bool CrewCanGetThrough(int posIdx)
851 {
853 switch (posIdx)
854 {
855 case 0:
856 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
857 return false;
858 else if (GetAnimationPhase("SeatDriver") > 0.5)
859 return false;
860
861 return true;
862
863 case 1:
864 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
865 return false;
866 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
867 return false;
868
869 return true;
870
871 case 2:
872 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
873 return false;
874 else if (GetAnimationPhase("SeatDriver") <= 0.5)
875 return false;
876
877 return true;
878
879 case 3:
880 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
881 return false;
882 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
883 return false;
884
885 return true;
886 }
887
888 return false;
889 }
890
891 override string GetDoorSelectionNameFromSeatPos(int posIdx)
892 {
893 switch (posIdx)
894 {
895 case 0:
896 case 2:
897 return "doors_driver";
898 case 1:
899 case 3:
900 return "doors_codriver";
901 }
902
903 return super.GetDoorSelectionNameFromSeatPos(posIdx);
904 }
905
906 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
907 {
908 switch (posIdx)
909 {
910 case 0:
911 case 2:
912 return "NivaDriverDoors";
913 case 1:
914 case 3:
915 return "NivaCoDriverDoors";
916 }
917
918 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
919 }
920
921 // 0 full ambient and engine sound
922 // 1 zero ambient and engine sound
923 override float OnSound(CarSoundCtrl ctrl, float oldValue)
924 {
925 float tempCap = 0.0;
926
927 switch (ctrl)
928 {
929 case CarSoundCtrl.DOORS:
930 float newValue = 0;
931 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
932 {
933 newValue += 0.5;
934 }
935
936 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
937 {
938 newValue += 0.5;
939 }
940
941 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
942 {
943 newValue += 0.3;
944 }
945
946 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
947 {
948 newValue -= 0.6;
949 }
950
951 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
952 {
953 newValue -= 0.2;
954 }
955
956 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
957 {
958 newValue -= 0.2;
959 }
960
961 return Math.Clamp(newValue, 0, 1);
962 break;
963 }
964
965 return super.OnSound(ctrl, oldValue);
966 }
967
968 override string GetAnimSourceFromSelection( string selection )
969 {
970 switch (selection)
971 {
972 case "doors_driver":
973 return "DoorsDriver";
974 case "doors_codriver":
975 return "DoorsCoDriver";
976 case "doors_hood":
977 return "DoorsHood";
978 case "doors_trunk":
979 return "DoorsTrunk";
980 case "seatback_driver":
981 return "SeatDriver";
982 case "seatback_codriver":
983 return "SeatCoDriver";
984 }
985
986 return "";
987 }
988
989 override string GetDoorConditionPointFromSelection(string selection)
990 {
991 switch (selection)
992 {
993 case "seat_driver":
994 case "seatback_driver":
995 case "seat_cargo1":
996 return "seat_con_1_1";
997 case "seat_codriver":
998 case "seatback_codriver":
999 case "seat_cargo2":
1000 return "seat_con_2_1";
1001 }
1002
1003 return "";
1004 }
1005
1006 override int GetCrewIndex(string selection)
1007 {
1008 switch (selection)
1009 {
1010 case "seatback_driver":
1011 return 0;
1012 case "seatback_codriver":
1013 return 1;
1014 }
1015
1016 return -1;
1017 }
1018
1019 override bool IsVitalTruckBattery()
1020 {
1021 return false;
1022 }
1023
1024 override bool IsVitalGlowPlug()
1025 {
1026 return false;
1027 }
1028
1029 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1030 {
1031 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1032 return false;
1033
1034 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1035 return false;
1036
1037 switch (currentSeat)
1038 {
1039 case 0:
1040 return nextSeat == 1;
1041
1042 case 1:
1043 return nextSeat == 0;
1044
1045 case 2:
1046 return nextSeat == 3;
1047
1048 case 3:
1049 return nextSeat == 2;
1050 }
1051
1052 return false;
1053 }
1054
1055 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1056 {
1057 switch (pCurrentSeat)
1058 {
1059 case 0:
1060 return pDoorsSelection == "DoorsDriver";
1061
1062 case 1:
1063 return pDoorsSelection == "DoorsCoDriver";
1064
1065 case 2:
1066 return pDoorsSelection == "DoorsDriver";
1067
1068 case 3:
1069 return pDoorsSelection == "DoorsCoDriver";
1070 }
1071
1072 return false;
1073 }
1074
1075 override int GetSeatIndexFromDoor( string pDoorSelection )
1076 {
1077 switch (pDoorSelection)
1078 {
1079 case "DoorsDriver":
1080 return 0;
1081 case "DoorsCoDriver":
1082 return 1;
1083 }
1084
1085 return -1;
1086 }
1087
1088 override void SetActions()
1089 {
1090 super.SetActions();
1091
1093 }
1094
1095 override void OnDebugSpawn()
1096 {
1100
1101 GetInventory().CreateInInventory("HatchbackWheel");
1102 GetInventory().CreateInInventory("HatchbackWheel");
1103 GetInventory().CreateInInventory("HatchbackWheel" );
1104 GetInventory().CreateInInventory("HatchbackWheel");
1105
1106 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1107 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1108 GetInventory().CreateInInventory("HatchbackHood");
1109 GetInventory().CreateInInventory("HatchbackTrunk");
1110
1111 //-----IN CAR CARGO
1112 GetInventory().CreateInInventory("HatchbackWheel");
1113 GetInventory().CreateInInventory("HatchbackWheel");
1114 }
1115}
1116
1118{
1119 override void OnDebugSpawn()
1120 {
1124
1125 GetInventory().CreateInInventory("HatchbackWheel");
1126 GetInventory().CreateInInventory("HatchbackWheel");
1127 GetInventory().CreateInInventory("HatchbackWheel");
1128 GetInventory().CreateInInventory("HatchbackWheel");
1129
1130 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1131 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1132 GetInventory().CreateInInventory("HatchbackHood_White");
1133 GetInventory().CreateInInventory("HatchbackTrunk_White");
1134
1135 //-----IN CAR CARGO
1136 GetInventory().CreateInInventory("HatchbackWheel");
1137 GetInventory().CreateInInventory("HatchbackWheel");
1138 }
1139}
1140
1142{
1143 override void OnDebugSpawn()
1144 {
1148
1149 GetInventory().CreateInInventory("HatchbackWheel");
1150 GetInventory().CreateInInventory("HatchbackWheel");
1151 GetInventory().CreateInInventory("HatchbackWheel");
1152 GetInventory().CreateInInventory("HatchbackWheel");
1153
1154 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1155 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1156 GetInventory().CreateInInventory("HatchbackHood_Blue");
1157 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1158
1159 //-----IN CAR CARGO
1160 GetInventory().CreateInInventory("HatchbackWheel");
1161 GetInventory().CreateInInventory("HatchbackWheel");
1162 }
1163}

Используется в CarScript::CanDisplayAttachmentCategory(), CarScript::CanDisplayCargo(), CarScript::CanManipulateSpareWheel(), CarScript::CanReleaseAttachment(), CarScript::CrewCanGetThrough() и CarScript::OnSound().

◆ GetCrewIndex()

override int GetCrewIndex ( string selection)
protected
832{
836
837 void OffroadHatchback()
838 {
839 //m_dmgContactCoef = 0.075;
840
841 m_EngineStartOK = "offroad_engine_start_SoundSet";
842 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
843 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
844 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
845 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
846
847 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
848 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
849 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
850 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
851
852 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
853 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
854
855 SetEnginePos("0 0.7 1.2");
856 }
857
858 override void EEInit()
859 {
860 super.EEInit();
861
862 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
863 {
865 m_UTSSettings.m_ManualUpdate = true;
866 m_UTSSettings.m_TemperatureMin = 0;
867 m_UTSSettings.m_TemperatureMax = 30;
869 m_UTSSettings.m_TemperatureCap = 0;
870 m_UTSSettings.m_RangeFull = 0.5;
871 m_UTSSettings.m_RangeMax = 2;
872
875 }
876 }
877
878 override void OnEngineStart()
879 {
880 super.OnEngineStart();
881
882 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
883 {
884 m_UTSource.SetDefferedActive(true, 20.0);
885 }
886 }
887
888 override void OnEngineStop()
889 {
890 super.OnEngineStop();
891
892 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
893 {
894 m_UTSource.SetDefferedActive(false, 10.0);
895 }
896 }
897
898 override void EOnPostSimulate(IEntity other, float timeSlice)
899 {
900 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
901 {
902 if (m_UTSource.IsActive())
903 {
905 }
906 }
907 }
908
909 override int GetAnimInstance()
910 {
911 return VehicleAnimInstances.HATCHBACK;
912 }
913
914 override float GetTransportCameraDistance()
915 {
916 return 3.5;
917 }
918
919 override int GetSeatAnimationType( int posIdx )
920 {
921 switch (posIdx)
922 {
923 case 0:
924 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
925 case 1:
926 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
927 case 2:
928 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
929 case 3:
930 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
931 }
932
933 return 0;
934
935 }
936
937
939 {
940 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
941 }
942
944 {
945 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
946 }
947
949 {
950 if (!super.CanReleaseAttachment(attachment))
951 {
952 return false;
953 }
954
955 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
956 {
957 string attType = attachment.GetType();
958 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
959 {
960 return false;
961 }
962 }
963
964 return true;
965 }
966
967 override protected bool CanManipulateSpareWheel(string slotSelectionName)
968 {
969 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
970 }
971
972 override bool CanDisplayAttachmentCategory( string category_name )
973 {
974 if (!super.CanDisplayAttachmentCategory(category_name))
975 {
976 return false;
977 }
978
979 category_name.ToLower();
980 if (category_name.Contains("engine"))
981 {
982 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
983 {
984 return false;
985 }
986 }
987
988 return true;
989 }
990
991 override bool CanDisplayCargo()
992 {
993 if (!super.CanDisplayCargo())
994 {
995 return false;
996 }
997
998 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
999 {
1000 return false;
1001 }
1002
1003 return true;
1004 }
1005
1006 override int GetCarDoorsState(string slotType)
1007 {
1009
1010 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
1011 if (!carDoor)
1012 {
1013 return CarDoorState.DOORS_MISSING;
1014 }
1015
1016 switch (slotType)
1017 {
1018 case "NivaDriverDoors":
1019 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1020
1021 case "NivaCoDriverDoors":
1022 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1023
1024 case "NivaHood":
1025 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1026
1027 case "NivaTrunk":
1028 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1029 }
1030
1031 return CarDoorState.DOORS_MISSING;
1032 }
1033
1034 override bool CrewCanGetThrough(int posIdx)
1035 {
1037 switch (posIdx)
1038 {
1039 case 0:
1040 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1041 return false;
1042 else if (GetAnimationPhase("SeatDriver") > 0.5)
1043 return false;
1044
1045 return true;
1046
1047 case 1:
1048 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1049 return false;
1050 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1051 return false;
1052
1053 return true;
1054
1055 case 2:
1056 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1057 return false;
1058 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1059 return false;
1060
1061 return true;
1062
1063 case 3:
1064 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1065 return false;
1066 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1067 return false;
1068
1069 return true;
1070 }
1071
1072 return false;
1073 }
1074
1075 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1076 {
1077 switch (posIdx)
1078 {
1079 case 0:
1080 case 2:
1081 return "doors_driver";
1082 case 1:
1083 case 3:
1084 return "doors_codriver";
1085 }
1086
1087 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1088 }
1089
1090 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1091 {
1092 switch (posIdx)
1093 {
1094 case 0:
1095 case 2:
1096 return "NivaDriverDoors";
1097 case 1:
1098 case 3:
1099 return "NivaCoDriverDoors";
1100 }
1101
1102 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1103 }
1104
1105 // 0 full ambient and engine sound
1106 // 1 zero ambient and engine sound
1107 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1108 {
1109 float tempCap = 0.0;
1110
1111 switch (ctrl)
1112 {
1113 case CarSoundCtrl.DOORS:
1114 float newValue = 0;
1115 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1116 {
1117 newValue += 0.5;
1118 }
1119
1120 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1121 {
1122 newValue += 0.5;
1123 }
1124
1125 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1126 {
1127 newValue += 0.3;
1128 }
1129
1130 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1131 {
1132 newValue -= 0.6;
1133 }
1134
1135 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1136 {
1137 newValue -= 0.2;
1138 }
1139
1140 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1141 {
1142 newValue -= 0.2;
1143 }
1144
1145 return Math.Clamp(newValue, 0, 1);
1146 break;
1147 }
1148
1149 return super.OnSound(ctrl, oldValue);
1150 }
1151
1152 override string GetAnimSourceFromSelection( string selection )
1153 {
1154 switch (selection)
1155 {
1156 case "doors_driver":
1157 return "DoorsDriver";
1158 case "doors_codriver":
1159 return "DoorsCoDriver";
1160 case "doors_hood":
1161 return "DoorsHood";
1162 case "doors_trunk":
1163 return "DoorsTrunk";
1164 case "seatback_driver":
1165 return "SeatDriver";
1166 case "seatback_codriver":
1167 return "SeatCoDriver";
1168 }
1169
1170 return "";
1171 }
1172
1173 override string GetDoorConditionPointFromSelection(string selection)
1174 {
1175 switch (selection)
1176 {
1177 case "seat_driver":
1178 case "seatback_driver":
1179 case "seat_cargo1":
1180 return "seat_con_1_1";
1181 case "seat_codriver":
1182 case "seatback_codriver":
1183 case "seat_cargo2":
1184 return "seat_con_2_1";
1185 }
1186
1187 return "";
1188 }
1189
1190 override int GetCrewIndex(string selection)
1191 {
1192 switch (selection)
1193 {
1194 case "seatback_driver":
1195 return 0;
1196 case "seatback_codriver":
1197 return 1;
1198 }
1199
1200 return -1;
1201 }
1202
1203 override bool IsVitalTruckBattery()
1204 {
1205 return false;
1206 }
1207
1208 override bool IsVitalGlowPlug()
1209 {
1210 return false;
1211 }
1212
1213 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1214 {
1215 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1216 return false;
1217
1218 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1219 return false;
1220
1221 switch (currentSeat)
1222 {
1223 case 0:
1224 return nextSeat == 1;
1225
1226 case 1:
1227 return nextSeat == 0;
1228
1229 case 2:
1230 return nextSeat == 3;
1231
1232 case 3:
1233 return nextSeat == 2;
1234 }
1235
1236 return false;
1237 }
1238
1239 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1240 {
1241 switch (pCurrentSeat)
1242 {
1243 case 0:
1244 return pDoorsSelection == "DoorsDriver";
1245
1246 case 1:
1247 return pDoorsSelection == "DoorsCoDriver";
1248
1249 case 2:
1250 return pDoorsSelection == "DoorsDriver";
1251
1252 case 3:
1253 return pDoorsSelection == "DoorsCoDriver";
1254 }
1255
1256 return false;
1257 }
1258
1259 override int GetSeatIndexFromDoor( string pDoorSelection )
1260 {
1261 switch (pDoorSelection)
1262 {
1263 case "DoorsDriver":
1264 return 0;
1265 case "DoorsCoDriver":
1266 return 1;
1267 }
1268
1269 return -1;
1270 }
1271
1272 override void SetActions()
1273 {
1274 super.SetActions();
1275
1277 }
1278
1279 override void OnDebugSpawn()
1280 {
1284
1285 GetInventory().CreateInInventory("HatchbackWheel");
1286 GetInventory().CreateInInventory("HatchbackWheel");
1287 GetInventory().CreateInInventory("HatchbackWheel" );
1288 GetInventory().CreateInInventory("HatchbackWheel");
1289
1290 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1291 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1292 GetInventory().CreateInInventory("HatchbackHood");
1293 GetInventory().CreateInInventory("HatchbackTrunk");
1294
1295 //-----IN CAR CARGO
1296 GetInventory().CreateInInventory("HatchbackWheel");
1297 GetInventory().CreateInInventory("HatchbackWheel");
1298 }
1299}
1300
1302{
1303 override void OnDebugSpawn()
1304 {
1308
1309 GetInventory().CreateInInventory("HatchbackWheel");
1310 GetInventory().CreateInInventory("HatchbackWheel");
1311 GetInventory().CreateInInventory("HatchbackWheel");
1312 GetInventory().CreateInInventory("HatchbackWheel");
1313
1314 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1315 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1316 GetInventory().CreateInInventory("HatchbackHood_White");
1317 GetInventory().CreateInInventory("HatchbackTrunk_White");
1318
1319 //-----IN CAR CARGO
1320 GetInventory().CreateInInventory("HatchbackWheel");
1321 GetInventory().CreateInInventory("HatchbackWheel");
1322 }
1323}
1324
1326{
1327 override void OnDebugSpawn()
1328 {
1332
1333 GetInventory().CreateInInventory("HatchbackWheel");
1334 GetInventory().CreateInInventory("HatchbackWheel");
1335 GetInventory().CreateInInventory("HatchbackWheel");
1336 GetInventory().CreateInInventory("HatchbackWheel");
1337
1338 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1339 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1340 GetInventory().CreateInInventory("HatchbackHood_Blue");
1341 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1342
1343 //-----IN CAR CARGO
1344 GetInventory().CreateInInventory("HatchbackWheel");
1345 GetInventory().CreateInInventory("HatchbackWheel");
1346 }
1347}

◆ GetDoorConditionPointFromSelection()

override string GetDoorConditionPointFromSelection ( string selection)
protected
815{
819
820 void OffroadHatchback()
821 {
822 //m_dmgContactCoef = 0.075;
823
824 m_EngineStartOK = "offroad_engine_start_SoundSet";
825 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
826 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
827 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
828 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
829
830 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
831 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
832 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
833 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
834
835 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
836 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
837
838 SetEnginePos("0 0.7 1.2");
839 }
840
841 override void EEInit()
842 {
843 super.EEInit();
844
845 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
846 {
848 m_UTSSettings.m_ManualUpdate = true;
849 m_UTSSettings.m_TemperatureMin = 0;
850 m_UTSSettings.m_TemperatureMax = 30;
852 m_UTSSettings.m_TemperatureCap = 0;
853 m_UTSSettings.m_RangeFull = 0.5;
854 m_UTSSettings.m_RangeMax = 2;
855
858 }
859 }
860
861 override void OnEngineStart()
862 {
863 super.OnEngineStart();
864
865 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
866 {
867 m_UTSource.SetDefferedActive(true, 20.0);
868 }
869 }
870
871 override void OnEngineStop()
872 {
873 super.OnEngineStop();
874
875 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
876 {
877 m_UTSource.SetDefferedActive(false, 10.0);
878 }
879 }
880
881 override void EOnPostSimulate(IEntity other, float timeSlice)
882 {
883 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
884 {
885 if (m_UTSource.IsActive())
886 {
888 }
889 }
890 }
891
892 override int GetAnimInstance()
893 {
894 return VehicleAnimInstances.HATCHBACK;
895 }
896
897 override float GetTransportCameraDistance()
898 {
899 return 3.5;
900 }
901
902 override int GetSeatAnimationType( int posIdx )
903 {
904 switch (posIdx)
905 {
906 case 0:
907 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
908 case 1:
909 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
910 case 2:
911 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
912 case 3:
913 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
914 }
915
916 return 0;
917
918 }
919
920
922 {
923 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
924 }
925
927 {
928 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
929 }
930
932 {
933 if (!super.CanReleaseAttachment(attachment))
934 {
935 return false;
936 }
937
938 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
939 {
940 string attType = attachment.GetType();
941 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
942 {
943 return false;
944 }
945 }
946
947 return true;
948 }
949
950 override protected bool CanManipulateSpareWheel(string slotSelectionName)
951 {
952 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
953 }
954
955 override bool CanDisplayAttachmentCategory( string category_name )
956 {
957 if (!super.CanDisplayAttachmentCategory(category_name))
958 {
959 return false;
960 }
961
962 category_name.ToLower();
963 if (category_name.Contains("engine"))
964 {
965 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
966 {
967 return false;
968 }
969 }
970
971 return true;
972 }
973
974 override bool CanDisplayCargo()
975 {
976 if (!super.CanDisplayCargo())
977 {
978 return false;
979 }
980
981 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
982 {
983 return false;
984 }
985
986 return true;
987 }
988
989 override int GetCarDoorsState(string slotType)
990 {
992
993 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
994 if (!carDoor)
995 {
996 return CarDoorState.DOORS_MISSING;
997 }
998
999 switch (slotType)
1000 {
1001 case "NivaDriverDoors":
1002 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1003
1004 case "NivaCoDriverDoors":
1005 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1006
1007 case "NivaHood":
1008 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1009
1010 case "NivaTrunk":
1011 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1012 }
1013
1014 return CarDoorState.DOORS_MISSING;
1015 }
1016
1017 override bool CrewCanGetThrough(int posIdx)
1018 {
1020 switch (posIdx)
1021 {
1022 case 0:
1023 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1024 return false;
1025 else if (GetAnimationPhase("SeatDriver") > 0.5)
1026 return false;
1027
1028 return true;
1029
1030 case 1:
1031 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1032 return false;
1033 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1034 return false;
1035
1036 return true;
1037
1038 case 2:
1039 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1040 return false;
1041 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1042 return false;
1043
1044 return true;
1045
1046 case 3:
1047 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1048 return false;
1049 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1050 return false;
1051
1052 return true;
1053 }
1054
1055 return false;
1056 }
1057
1058 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1059 {
1060 switch (posIdx)
1061 {
1062 case 0:
1063 case 2:
1064 return "doors_driver";
1065 case 1:
1066 case 3:
1067 return "doors_codriver";
1068 }
1069
1070 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1071 }
1072
1073 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1074 {
1075 switch (posIdx)
1076 {
1077 case 0:
1078 case 2:
1079 return "NivaDriverDoors";
1080 case 1:
1081 case 3:
1082 return "NivaCoDriverDoors";
1083 }
1084
1085 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1086 }
1087
1088 // 0 full ambient and engine sound
1089 // 1 zero ambient and engine sound
1090 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1091 {
1092 float tempCap = 0.0;
1093
1094 switch (ctrl)
1095 {
1096 case CarSoundCtrl.DOORS:
1097 float newValue = 0;
1098 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1099 {
1100 newValue += 0.5;
1101 }
1102
1103 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1104 {
1105 newValue += 0.5;
1106 }
1107
1108 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1109 {
1110 newValue += 0.3;
1111 }
1112
1113 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1114 {
1115 newValue -= 0.6;
1116 }
1117
1118 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1119 {
1120 newValue -= 0.2;
1121 }
1122
1123 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1124 {
1125 newValue -= 0.2;
1126 }
1127
1128 return Math.Clamp(newValue, 0, 1);
1129 break;
1130 }
1131
1132 return super.OnSound(ctrl, oldValue);
1133 }
1134
1135 override string GetAnimSourceFromSelection( string selection )
1136 {
1137 switch (selection)
1138 {
1139 case "doors_driver":
1140 return "DoorsDriver";
1141 case "doors_codriver":
1142 return "DoorsCoDriver";
1143 case "doors_hood":
1144 return "DoorsHood";
1145 case "doors_trunk":
1146 return "DoorsTrunk";
1147 case "seatback_driver":
1148 return "SeatDriver";
1149 case "seatback_codriver":
1150 return "SeatCoDriver";
1151 }
1152
1153 return "";
1154 }
1155
1156 override string GetDoorConditionPointFromSelection(string selection)
1157 {
1158 switch (selection)
1159 {
1160 case "seat_driver":
1161 case "seatback_driver":
1162 case "seat_cargo1":
1163 return "seat_con_1_1";
1164 case "seat_codriver":
1165 case "seatback_codriver":
1166 case "seat_cargo2":
1167 return "seat_con_2_1";
1168 }
1169
1170 return "";
1171 }
1172
1173 override int GetCrewIndex(string selection)
1174 {
1175 switch (selection)
1176 {
1177 case "seatback_driver":
1178 return 0;
1179 case "seatback_codriver":
1180 return 1;
1181 }
1182
1183 return -1;
1184 }
1185
1186 override bool IsVitalTruckBattery()
1187 {
1188 return false;
1189 }
1190
1191 override bool IsVitalGlowPlug()
1192 {
1193 return false;
1194 }
1195
1196 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1197 {
1198 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1199 return false;
1200
1201 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1202 return false;
1203
1204 switch (currentSeat)
1205 {
1206 case 0:
1207 return nextSeat == 1;
1208
1209 case 1:
1210 return nextSeat == 0;
1211
1212 case 2:
1213 return nextSeat == 3;
1214
1215 case 3:
1216 return nextSeat == 2;
1217 }
1218
1219 return false;
1220 }
1221
1222 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1223 {
1224 switch (pCurrentSeat)
1225 {
1226 case 0:
1227 return pDoorsSelection == "DoorsDriver";
1228
1229 case 1:
1230 return pDoorsSelection == "DoorsCoDriver";
1231
1232 case 2:
1233 return pDoorsSelection == "DoorsDriver";
1234
1235 case 3:
1236 return pDoorsSelection == "DoorsCoDriver";
1237 }
1238
1239 return false;
1240 }
1241
1242 override int GetSeatIndexFromDoor( string pDoorSelection )
1243 {
1244 switch (pDoorSelection)
1245 {
1246 case "DoorsDriver":
1247 return 0;
1248 case "DoorsCoDriver":
1249 return 1;
1250 }
1251
1252 return -1;
1253 }
1254
1255 override void SetActions()
1256 {
1257 super.SetActions();
1258
1260 }
1261
1262 override void OnDebugSpawn()
1263 {
1267
1268 GetInventory().CreateInInventory("HatchbackWheel");
1269 GetInventory().CreateInInventory("HatchbackWheel");
1270 GetInventory().CreateInInventory("HatchbackWheel" );
1271 GetInventory().CreateInInventory("HatchbackWheel");
1272
1273 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1274 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1275 GetInventory().CreateInInventory("HatchbackHood");
1276 GetInventory().CreateInInventory("HatchbackTrunk");
1277
1278 //-----IN CAR CARGO
1279 GetInventory().CreateInInventory("HatchbackWheel");
1280 GetInventory().CreateInInventory("HatchbackWheel");
1281 }
1282}
1283
1285{
1286 override void OnDebugSpawn()
1287 {
1291
1292 GetInventory().CreateInInventory("HatchbackWheel");
1293 GetInventory().CreateInInventory("HatchbackWheel");
1294 GetInventory().CreateInInventory("HatchbackWheel");
1295 GetInventory().CreateInInventory("HatchbackWheel");
1296
1297 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1298 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1299 GetInventory().CreateInInventory("HatchbackHood_White");
1300 GetInventory().CreateInInventory("HatchbackTrunk_White");
1301
1302 //-----IN CAR CARGO
1303 GetInventory().CreateInInventory("HatchbackWheel");
1304 GetInventory().CreateInInventory("HatchbackWheel");
1305 }
1306}
1307
1309{
1310 override void OnDebugSpawn()
1311 {
1315
1316 GetInventory().CreateInInventory("HatchbackWheel");
1317 GetInventory().CreateInInventory("HatchbackWheel");
1318 GetInventory().CreateInInventory("HatchbackWheel");
1319 GetInventory().CreateInInventory("HatchbackWheel");
1320
1321 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1322 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1323 GetInventory().CreateInInventory("HatchbackHood_Blue");
1324 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1325
1326 //-----IN CAR CARGO
1327 GetInventory().CreateInInventory("HatchbackWheel");
1328 GetInventory().CreateInInventory("HatchbackWheel");
1329 }
1330}

◆ GetDoorInvSlotNameFromSeatPos()

override string GetDoorInvSlotNameFromSeatPos ( int posIdx)
protected
732{
736
737 void OffroadHatchback()
738 {
739 //m_dmgContactCoef = 0.075;
740
741 m_EngineStartOK = "offroad_engine_start_SoundSet";
742 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
743 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
744 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
745 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
746
747 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
748 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
749 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
750 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
751
752 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
753 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
754
755 SetEnginePos("0 0.7 1.2");
756 }
757
758 override void EEInit()
759 {
760 super.EEInit();
761
762 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
763 {
765 m_UTSSettings.m_ManualUpdate = true;
766 m_UTSSettings.m_TemperatureMin = 0;
767 m_UTSSettings.m_TemperatureMax = 30;
769 m_UTSSettings.m_TemperatureCap = 0;
770 m_UTSSettings.m_RangeFull = 0.5;
771 m_UTSSettings.m_RangeMax = 2;
772
775 }
776 }
777
778 override void OnEngineStart()
779 {
780 super.OnEngineStart();
781
782 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
783 {
784 m_UTSource.SetDefferedActive(true, 20.0);
785 }
786 }
787
788 override void OnEngineStop()
789 {
790 super.OnEngineStop();
791
792 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
793 {
794 m_UTSource.SetDefferedActive(false, 10.0);
795 }
796 }
797
798 override void EOnPostSimulate(IEntity other, float timeSlice)
799 {
800 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
801 {
802 if (m_UTSource.IsActive())
803 {
805 }
806 }
807 }
808
809 override int GetAnimInstance()
810 {
811 return VehicleAnimInstances.HATCHBACK;
812 }
813
814 override float GetTransportCameraDistance()
815 {
816 return 3.5;
817 }
818
819 override int GetSeatAnimationType( int posIdx )
820 {
821 switch (posIdx)
822 {
823 case 0:
824 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
825 case 1:
826 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
827 case 2:
828 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
829 case 3:
830 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
831 }
832
833 return 0;
834
835 }
836
837
839 {
840 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
841 }
842
844 {
845 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
846 }
847
849 {
850 if (!super.CanReleaseAttachment(attachment))
851 {
852 return false;
853 }
854
855 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
856 {
857 string attType = attachment.GetType();
858 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
859 {
860 return false;
861 }
862 }
863
864 return true;
865 }
866
867 override protected bool CanManipulateSpareWheel(string slotSelectionName)
868 {
869 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
870 }
871
872 override bool CanDisplayAttachmentCategory( string category_name )
873 {
874 if (!super.CanDisplayAttachmentCategory(category_name))
875 {
876 return false;
877 }
878
879 category_name.ToLower();
880 if (category_name.Contains("engine"))
881 {
882 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
883 {
884 return false;
885 }
886 }
887
888 return true;
889 }
890
891 override bool CanDisplayCargo()
892 {
893 if (!super.CanDisplayCargo())
894 {
895 return false;
896 }
897
898 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
899 {
900 return false;
901 }
902
903 return true;
904 }
905
906 override int GetCarDoorsState(string slotType)
907 {
909
910 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
911 if (!carDoor)
912 {
913 return CarDoorState.DOORS_MISSING;
914 }
915
916 switch (slotType)
917 {
918 case "NivaDriverDoors":
919 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
920
921 case "NivaCoDriverDoors":
922 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
923
924 case "NivaHood":
925 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
926
927 case "NivaTrunk":
928 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
929 }
930
931 return CarDoorState.DOORS_MISSING;
932 }
933
934 override bool CrewCanGetThrough(int posIdx)
935 {
937 switch (posIdx)
938 {
939 case 0:
940 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
941 return false;
942 else if (GetAnimationPhase("SeatDriver") > 0.5)
943 return false;
944
945 return true;
946
947 case 1:
948 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
949 return false;
950 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
951 return false;
952
953 return true;
954
955 case 2:
956 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
957 return false;
958 else if (GetAnimationPhase("SeatDriver") <= 0.5)
959 return false;
960
961 return true;
962
963 case 3:
964 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
965 return false;
966 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
967 return false;
968
969 return true;
970 }
971
972 return false;
973 }
974
975 override string GetDoorSelectionNameFromSeatPos(int posIdx)
976 {
977 switch (posIdx)
978 {
979 case 0:
980 case 2:
981 return "doors_driver";
982 case 1:
983 case 3:
984 return "doors_codriver";
985 }
986
987 return super.GetDoorSelectionNameFromSeatPos(posIdx);
988 }
989
990 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
991 {
992 switch (posIdx)
993 {
994 case 0:
995 case 2:
996 return "NivaDriverDoors";
997 case 1:
998 case 3:
999 return "NivaCoDriverDoors";
1000 }
1001
1002 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1003 }
1004
1005 // 0 full ambient and engine sound
1006 // 1 zero ambient and engine sound
1007 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1008 {
1009 float tempCap = 0.0;
1010
1011 switch (ctrl)
1012 {
1013 case CarSoundCtrl.DOORS:
1014 float newValue = 0;
1015 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1016 {
1017 newValue += 0.5;
1018 }
1019
1020 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1021 {
1022 newValue += 0.5;
1023 }
1024
1025 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1026 {
1027 newValue += 0.3;
1028 }
1029
1030 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1031 {
1032 newValue -= 0.6;
1033 }
1034
1035 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1036 {
1037 newValue -= 0.2;
1038 }
1039
1040 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1041 {
1042 newValue -= 0.2;
1043 }
1044
1045 return Math.Clamp(newValue, 0, 1);
1046 break;
1047 }
1048
1049 return super.OnSound(ctrl, oldValue);
1050 }
1051
1052 override string GetAnimSourceFromSelection( string selection )
1053 {
1054 switch (selection)
1055 {
1056 case "doors_driver":
1057 return "DoorsDriver";
1058 case "doors_codriver":
1059 return "DoorsCoDriver";
1060 case "doors_hood":
1061 return "DoorsHood";
1062 case "doors_trunk":
1063 return "DoorsTrunk";
1064 case "seatback_driver":
1065 return "SeatDriver";
1066 case "seatback_codriver":
1067 return "SeatCoDriver";
1068 }
1069
1070 return "";
1071 }
1072
1073 override string GetDoorConditionPointFromSelection(string selection)
1074 {
1075 switch (selection)
1076 {
1077 case "seat_driver":
1078 case "seatback_driver":
1079 case "seat_cargo1":
1080 return "seat_con_1_1";
1081 case "seat_codriver":
1082 case "seatback_codriver":
1083 case "seat_cargo2":
1084 return "seat_con_2_1";
1085 }
1086
1087 return "";
1088 }
1089
1090 override int GetCrewIndex(string selection)
1091 {
1092 switch (selection)
1093 {
1094 case "seatback_driver":
1095 return 0;
1096 case "seatback_codriver":
1097 return 1;
1098 }
1099
1100 return -1;
1101 }
1102
1103 override bool IsVitalTruckBattery()
1104 {
1105 return false;
1106 }
1107
1108 override bool IsVitalGlowPlug()
1109 {
1110 return false;
1111 }
1112
1113 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1114 {
1115 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1116 return false;
1117
1118 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1119 return false;
1120
1121 switch (currentSeat)
1122 {
1123 case 0:
1124 return nextSeat == 1;
1125
1126 case 1:
1127 return nextSeat == 0;
1128
1129 case 2:
1130 return nextSeat == 3;
1131
1132 case 3:
1133 return nextSeat == 2;
1134 }
1135
1136 return false;
1137 }
1138
1139 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1140 {
1141 switch (pCurrentSeat)
1142 {
1143 case 0:
1144 return pDoorsSelection == "DoorsDriver";
1145
1146 case 1:
1147 return pDoorsSelection == "DoorsCoDriver";
1148
1149 case 2:
1150 return pDoorsSelection == "DoorsDriver";
1151
1152 case 3:
1153 return pDoorsSelection == "DoorsCoDriver";
1154 }
1155
1156 return false;
1157 }
1158
1159 override int GetSeatIndexFromDoor( string pDoorSelection )
1160 {
1161 switch (pDoorSelection)
1162 {
1163 case "DoorsDriver":
1164 return 0;
1165 case "DoorsCoDriver":
1166 return 1;
1167 }
1168
1169 return -1;
1170 }
1171
1172 override void SetActions()
1173 {
1174 super.SetActions();
1175
1177 }
1178
1179 override void OnDebugSpawn()
1180 {
1184
1185 GetInventory().CreateInInventory("HatchbackWheel");
1186 GetInventory().CreateInInventory("HatchbackWheel");
1187 GetInventory().CreateInInventory("HatchbackWheel" );
1188 GetInventory().CreateInInventory("HatchbackWheel");
1189
1190 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1191 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1192 GetInventory().CreateInInventory("HatchbackHood");
1193 GetInventory().CreateInInventory("HatchbackTrunk");
1194
1195 //-----IN CAR CARGO
1196 GetInventory().CreateInInventory("HatchbackWheel");
1197 GetInventory().CreateInInventory("HatchbackWheel");
1198 }
1199}
1200
1202{
1203 override void OnDebugSpawn()
1204 {
1208
1209 GetInventory().CreateInInventory("HatchbackWheel");
1210 GetInventory().CreateInInventory("HatchbackWheel");
1211 GetInventory().CreateInInventory("HatchbackWheel");
1212 GetInventory().CreateInInventory("HatchbackWheel");
1213
1214 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1215 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1216 GetInventory().CreateInInventory("HatchbackHood_White");
1217 GetInventory().CreateInInventory("HatchbackTrunk_White");
1218
1219 //-----IN CAR CARGO
1220 GetInventory().CreateInInventory("HatchbackWheel");
1221 GetInventory().CreateInInventory("HatchbackWheel");
1222 }
1223}
1224
1226{
1227 override void OnDebugSpawn()
1228 {
1232
1233 GetInventory().CreateInInventory("HatchbackWheel");
1234 GetInventory().CreateInInventory("HatchbackWheel");
1235 GetInventory().CreateInInventory("HatchbackWheel");
1236 GetInventory().CreateInInventory("HatchbackWheel");
1237
1238 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1239 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1240 GetInventory().CreateInInventory("HatchbackHood_Blue");
1241 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1242
1243 //-----IN CAR CARGO
1244 GetInventory().CreateInInventory("HatchbackWheel");
1245 GetInventory().CreateInInventory("HatchbackWheel");
1246 }
1247}

◆ GetDoorSelectionNameFromSeatPos()

override string GetDoorSelectionNameFromSeatPos ( int posIdx)
protected
717{
721
722 void OffroadHatchback()
723 {
724 //m_dmgContactCoef = 0.075;
725
726 m_EngineStartOK = "offroad_engine_start_SoundSet";
727 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
728 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
729 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
730 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
731
732 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
733 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
734 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
735 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
736
737 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
738 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
739
740 SetEnginePos("0 0.7 1.2");
741 }
742
743 override void EEInit()
744 {
745 super.EEInit();
746
747 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
748 {
750 m_UTSSettings.m_ManualUpdate = true;
751 m_UTSSettings.m_TemperatureMin = 0;
752 m_UTSSettings.m_TemperatureMax = 30;
754 m_UTSSettings.m_TemperatureCap = 0;
755 m_UTSSettings.m_RangeFull = 0.5;
756 m_UTSSettings.m_RangeMax = 2;
757
760 }
761 }
762
763 override void OnEngineStart()
764 {
765 super.OnEngineStart();
766
767 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
768 {
769 m_UTSource.SetDefferedActive(true, 20.0);
770 }
771 }
772
773 override void OnEngineStop()
774 {
775 super.OnEngineStop();
776
777 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
778 {
779 m_UTSource.SetDefferedActive(false, 10.0);
780 }
781 }
782
783 override void EOnPostSimulate(IEntity other, float timeSlice)
784 {
785 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
786 {
787 if (m_UTSource.IsActive())
788 {
790 }
791 }
792 }
793
794 override int GetAnimInstance()
795 {
796 return VehicleAnimInstances.HATCHBACK;
797 }
798
799 override float GetTransportCameraDistance()
800 {
801 return 3.5;
802 }
803
804 override int GetSeatAnimationType( int posIdx )
805 {
806 switch (posIdx)
807 {
808 case 0:
809 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
810 case 1:
811 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
812 case 2:
813 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
814 case 3:
815 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
816 }
817
818 return 0;
819
820 }
821
822
824 {
825 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
826 }
827
829 {
830 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
831 }
832
834 {
835 if (!super.CanReleaseAttachment(attachment))
836 {
837 return false;
838 }
839
840 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
841 {
842 string attType = attachment.GetType();
843 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
844 {
845 return false;
846 }
847 }
848
849 return true;
850 }
851
852 override protected bool CanManipulateSpareWheel(string slotSelectionName)
853 {
854 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
855 }
856
857 override bool CanDisplayAttachmentCategory( string category_name )
858 {
859 if (!super.CanDisplayAttachmentCategory(category_name))
860 {
861 return false;
862 }
863
864 category_name.ToLower();
865 if (category_name.Contains("engine"))
866 {
867 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
868 {
869 return false;
870 }
871 }
872
873 return true;
874 }
875
876 override bool CanDisplayCargo()
877 {
878 if (!super.CanDisplayCargo())
879 {
880 return false;
881 }
882
883 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
884 {
885 return false;
886 }
887
888 return true;
889 }
890
891 override int GetCarDoorsState(string slotType)
892 {
894
895 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
896 if (!carDoor)
897 {
898 return CarDoorState.DOORS_MISSING;
899 }
900
901 switch (slotType)
902 {
903 case "NivaDriverDoors":
904 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
905
906 case "NivaCoDriverDoors":
907 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
908
909 case "NivaHood":
910 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
911
912 case "NivaTrunk":
913 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
914 }
915
916 return CarDoorState.DOORS_MISSING;
917 }
918
919 override bool CrewCanGetThrough(int posIdx)
920 {
922 switch (posIdx)
923 {
924 case 0:
925 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
926 return false;
927 else if (GetAnimationPhase("SeatDriver") > 0.5)
928 return false;
929
930 return true;
931
932 case 1:
933 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
934 return false;
935 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
936 return false;
937
938 return true;
939
940 case 2:
941 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
942 return false;
943 else if (GetAnimationPhase("SeatDriver") <= 0.5)
944 return false;
945
946 return true;
947
948 case 3:
949 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
950 return false;
951 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
952 return false;
953
954 return true;
955 }
956
957 return false;
958 }
959
960 override string GetDoorSelectionNameFromSeatPos(int posIdx)
961 {
962 switch (posIdx)
963 {
964 case 0:
965 case 2:
966 return "doors_driver";
967 case 1:
968 case 3:
969 return "doors_codriver";
970 }
971
972 return super.GetDoorSelectionNameFromSeatPos(posIdx);
973 }
974
975 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
976 {
977 switch (posIdx)
978 {
979 case 0:
980 case 2:
981 return "NivaDriverDoors";
982 case 1:
983 case 3:
984 return "NivaCoDriverDoors";
985 }
986
987 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
988 }
989
990 // 0 full ambient and engine sound
991 // 1 zero ambient and engine sound
992 override float OnSound(CarSoundCtrl ctrl, float oldValue)
993 {
994 float tempCap = 0.0;
995
996 switch (ctrl)
997 {
998 case CarSoundCtrl.DOORS:
999 float newValue = 0;
1000 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1001 {
1002 newValue += 0.5;
1003 }
1004
1005 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1006 {
1007 newValue += 0.5;
1008 }
1009
1010 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1011 {
1012 newValue += 0.3;
1013 }
1014
1015 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1016 {
1017 newValue -= 0.6;
1018 }
1019
1020 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1021 {
1022 newValue -= 0.2;
1023 }
1024
1025 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1026 {
1027 newValue -= 0.2;
1028 }
1029
1030 return Math.Clamp(newValue, 0, 1);
1031 break;
1032 }
1033
1034 return super.OnSound(ctrl, oldValue);
1035 }
1036
1037 override string GetAnimSourceFromSelection( string selection )
1038 {
1039 switch (selection)
1040 {
1041 case "doors_driver":
1042 return "DoorsDriver";
1043 case "doors_codriver":
1044 return "DoorsCoDriver";
1045 case "doors_hood":
1046 return "DoorsHood";
1047 case "doors_trunk":
1048 return "DoorsTrunk";
1049 case "seatback_driver":
1050 return "SeatDriver";
1051 case "seatback_codriver":
1052 return "SeatCoDriver";
1053 }
1054
1055 return "";
1056 }
1057
1058 override string GetDoorConditionPointFromSelection(string selection)
1059 {
1060 switch (selection)
1061 {
1062 case "seat_driver":
1063 case "seatback_driver":
1064 case "seat_cargo1":
1065 return "seat_con_1_1";
1066 case "seat_codriver":
1067 case "seatback_codriver":
1068 case "seat_cargo2":
1069 return "seat_con_2_1";
1070 }
1071
1072 return "";
1073 }
1074
1075 override int GetCrewIndex(string selection)
1076 {
1077 switch (selection)
1078 {
1079 case "seatback_driver":
1080 return 0;
1081 case "seatback_codriver":
1082 return 1;
1083 }
1084
1085 return -1;
1086 }
1087
1088 override bool IsVitalTruckBattery()
1089 {
1090 return false;
1091 }
1092
1093 override bool IsVitalGlowPlug()
1094 {
1095 return false;
1096 }
1097
1098 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1099 {
1100 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1101 return false;
1102
1103 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1104 return false;
1105
1106 switch (currentSeat)
1107 {
1108 case 0:
1109 return nextSeat == 1;
1110
1111 case 1:
1112 return nextSeat == 0;
1113
1114 case 2:
1115 return nextSeat == 3;
1116
1117 case 3:
1118 return nextSeat == 2;
1119 }
1120
1121 return false;
1122 }
1123
1124 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1125 {
1126 switch (pCurrentSeat)
1127 {
1128 case 0:
1129 return pDoorsSelection == "DoorsDriver";
1130
1131 case 1:
1132 return pDoorsSelection == "DoorsCoDriver";
1133
1134 case 2:
1135 return pDoorsSelection == "DoorsDriver";
1136
1137 case 3:
1138 return pDoorsSelection == "DoorsCoDriver";
1139 }
1140
1141 return false;
1142 }
1143
1144 override int GetSeatIndexFromDoor( string pDoorSelection )
1145 {
1146 switch (pDoorSelection)
1147 {
1148 case "DoorsDriver":
1149 return 0;
1150 case "DoorsCoDriver":
1151 return 1;
1152 }
1153
1154 return -1;
1155 }
1156
1157 override void SetActions()
1158 {
1159 super.SetActions();
1160
1162 }
1163
1164 override void OnDebugSpawn()
1165 {
1169
1170 GetInventory().CreateInInventory("HatchbackWheel");
1171 GetInventory().CreateInInventory("HatchbackWheel");
1172 GetInventory().CreateInInventory("HatchbackWheel" );
1173 GetInventory().CreateInInventory("HatchbackWheel");
1174
1175 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1176 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1177 GetInventory().CreateInInventory("HatchbackHood");
1178 GetInventory().CreateInInventory("HatchbackTrunk");
1179
1180 //-----IN CAR CARGO
1181 GetInventory().CreateInInventory("HatchbackWheel");
1182 GetInventory().CreateInInventory("HatchbackWheel");
1183 }
1184}
1185
1187{
1188 override void OnDebugSpawn()
1189 {
1193
1194 GetInventory().CreateInInventory("HatchbackWheel");
1195 GetInventory().CreateInInventory("HatchbackWheel");
1196 GetInventory().CreateInInventory("HatchbackWheel");
1197 GetInventory().CreateInInventory("HatchbackWheel");
1198
1199 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1200 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1201 GetInventory().CreateInInventory("HatchbackHood_White");
1202 GetInventory().CreateInInventory("HatchbackTrunk_White");
1203
1204 //-----IN CAR CARGO
1205 GetInventory().CreateInInventory("HatchbackWheel");
1206 GetInventory().CreateInInventory("HatchbackWheel");
1207 }
1208}
1209
1211{
1212 override void OnDebugSpawn()
1213 {
1217
1218 GetInventory().CreateInInventory("HatchbackWheel");
1219 GetInventory().CreateInInventory("HatchbackWheel");
1220 GetInventory().CreateInInventory("HatchbackWheel");
1221 GetInventory().CreateInInventory("HatchbackWheel");
1222
1223 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1224 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1225 GetInventory().CreateInInventory("HatchbackHood_Blue");
1226 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1227
1228 //-----IN CAR CARGO
1229 GetInventory().CreateInInventory("HatchbackWheel");
1230 GetInventory().CreateInInventory("HatchbackWheel");
1231 }
1232}

◆ GetSeatAnimationType()

override int GetSeatAnimationType ( int posIdx)
protected
561{
565
566 void OffroadHatchback()
567 {
568 //m_dmgContactCoef = 0.075;
569
570 m_EngineStartOK = "offroad_engine_start_SoundSet";
571 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
572 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
573 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
574 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
575
576 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
577 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
578 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
579 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
580
581 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
582 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
583
584 SetEnginePos("0 0.7 1.2");
585 }
586
587 override void EEInit()
588 {
589 super.EEInit();
590
591 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
592 {
594 m_UTSSettings.m_ManualUpdate = true;
595 m_UTSSettings.m_TemperatureMin = 0;
596 m_UTSSettings.m_TemperatureMax = 30;
598 m_UTSSettings.m_TemperatureCap = 0;
599 m_UTSSettings.m_RangeFull = 0.5;
600 m_UTSSettings.m_RangeMax = 2;
601
604 }
605 }
606
607 override void OnEngineStart()
608 {
609 super.OnEngineStart();
610
611 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
612 {
613 m_UTSource.SetDefferedActive(true, 20.0);
614 }
615 }
616
617 override void OnEngineStop()
618 {
619 super.OnEngineStop();
620
621 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
622 {
623 m_UTSource.SetDefferedActive(false, 10.0);
624 }
625 }
626
627 override void EOnPostSimulate(IEntity other, float timeSlice)
628 {
629 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
630 {
631 if (m_UTSource.IsActive())
632 {
634 }
635 }
636 }
637
638 override int GetAnimInstance()
639 {
640 return VehicleAnimInstances.HATCHBACK;
641 }
642
643 override float GetTransportCameraDistance()
644 {
645 return 3.5;
646 }
647
648 override int GetSeatAnimationType( int posIdx )
649 {
650 switch (posIdx)
651 {
652 case 0:
653 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
654 case 1:
655 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
656 case 2:
657 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
658 case 3:
659 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
660 }
661
662 return 0;
663
664 }
665
666
668 {
669 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
670 }
671
673 {
674 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
675 }
676
678 {
679 if (!super.CanReleaseAttachment(attachment))
680 {
681 return false;
682 }
683
684 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
685 {
686 string attType = attachment.GetType();
687 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
688 {
689 return false;
690 }
691 }
692
693 return true;
694 }
695
696 override protected bool CanManipulateSpareWheel(string slotSelectionName)
697 {
698 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
699 }
700
701 override bool CanDisplayAttachmentCategory( string category_name )
702 {
703 if (!super.CanDisplayAttachmentCategory(category_name))
704 {
705 return false;
706 }
707
708 category_name.ToLower();
709 if (category_name.Contains("engine"))
710 {
711 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
712 {
713 return false;
714 }
715 }
716
717 return true;
718 }
719
720 override bool CanDisplayCargo()
721 {
722 if (!super.CanDisplayCargo())
723 {
724 return false;
725 }
726
727 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
728 {
729 return false;
730 }
731
732 return true;
733 }
734
735 override int GetCarDoorsState(string slotType)
736 {
738
739 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
740 if (!carDoor)
741 {
742 return CarDoorState.DOORS_MISSING;
743 }
744
745 switch (slotType)
746 {
747 case "NivaDriverDoors":
748 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
749
750 case "NivaCoDriverDoors":
751 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
752
753 case "NivaHood":
754 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
755
756 case "NivaTrunk":
757 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
758 }
759
760 return CarDoorState.DOORS_MISSING;
761 }
762
763 override bool CrewCanGetThrough(int posIdx)
764 {
766 switch (posIdx)
767 {
768 case 0:
769 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
770 return false;
771 else if (GetAnimationPhase("SeatDriver") > 0.5)
772 return false;
773
774 return true;
775
776 case 1:
777 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
778 return false;
779 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
780 return false;
781
782 return true;
783
784 case 2:
785 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
786 return false;
787 else if (GetAnimationPhase("SeatDriver") <= 0.5)
788 return false;
789
790 return true;
791
792 case 3:
793 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
794 return false;
795 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
796 return false;
797
798 return true;
799 }
800
801 return false;
802 }
803
804 override string GetDoorSelectionNameFromSeatPos(int posIdx)
805 {
806 switch (posIdx)
807 {
808 case 0:
809 case 2:
810 return "doors_driver";
811 case 1:
812 case 3:
813 return "doors_codriver";
814 }
815
816 return super.GetDoorSelectionNameFromSeatPos(posIdx);
817 }
818
819 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
820 {
821 switch (posIdx)
822 {
823 case 0:
824 case 2:
825 return "NivaDriverDoors";
826 case 1:
827 case 3:
828 return "NivaCoDriverDoors";
829 }
830
831 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
832 }
833
834 // 0 full ambient and engine sound
835 // 1 zero ambient and engine sound
836 override float OnSound(CarSoundCtrl ctrl, float oldValue)
837 {
838 float tempCap = 0.0;
839
840 switch (ctrl)
841 {
842 case CarSoundCtrl.DOORS:
843 float newValue = 0;
844 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
845 {
846 newValue += 0.5;
847 }
848
849 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
850 {
851 newValue += 0.5;
852 }
853
854 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
855 {
856 newValue += 0.3;
857 }
858
859 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
860 {
861 newValue -= 0.6;
862 }
863
864 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
865 {
866 newValue -= 0.2;
867 }
868
869 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
870 {
871 newValue -= 0.2;
872 }
873
874 return Math.Clamp(newValue, 0, 1);
875 break;
876 }
877
878 return super.OnSound(ctrl, oldValue);
879 }
880
881 override string GetAnimSourceFromSelection( string selection )
882 {
883 switch (selection)
884 {
885 case "doors_driver":
886 return "DoorsDriver";
887 case "doors_codriver":
888 return "DoorsCoDriver";
889 case "doors_hood":
890 return "DoorsHood";
891 case "doors_trunk":
892 return "DoorsTrunk";
893 case "seatback_driver":
894 return "SeatDriver";
895 case "seatback_codriver":
896 return "SeatCoDriver";
897 }
898
899 return "";
900 }
901
902 override string GetDoorConditionPointFromSelection(string selection)
903 {
904 switch (selection)
905 {
906 case "seat_driver":
907 case "seatback_driver":
908 case "seat_cargo1":
909 return "seat_con_1_1";
910 case "seat_codriver":
911 case "seatback_codriver":
912 case "seat_cargo2":
913 return "seat_con_2_1";
914 }
915
916 return "";
917 }
918
919 override int GetCrewIndex(string selection)
920 {
921 switch (selection)
922 {
923 case "seatback_driver":
924 return 0;
925 case "seatback_codriver":
926 return 1;
927 }
928
929 return -1;
930 }
931
932 override bool IsVitalTruckBattery()
933 {
934 return false;
935 }
936
937 override bool IsVitalGlowPlug()
938 {
939 return false;
940 }
941
942 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
943 {
944 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
945 return false;
946
947 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
948 return false;
949
950 switch (currentSeat)
951 {
952 case 0:
953 return nextSeat == 1;
954
955 case 1:
956 return nextSeat == 0;
957
958 case 2:
959 return nextSeat == 3;
960
961 case 3:
962 return nextSeat == 2;
963 }
964
965 return false;
966 }
967
968 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
969 {
970 switch (pCurrentSeat)
971 {
972 case 0:
973 return pDoorsSelection == "DoorsDriver";
974
975 case 1:
976 return pDoorsSelection == "DoorsCoDriver";
977
978 case 2:
979 return pDoorsSelection == "DoorsDriver";
980
981 case 3:
982 return pDoorsSelection == "DoorsCoDriver";
983 }
984
985 return false;
986 }
987
988 override int GetSeatIndexFromDoor( string pDoorSelection )
989 {
990 switch (pDoorSelection)
991 {
992 case "DoorsDriver":
993 return 0;
994 case "DoorsCoDriver":
995 return 1;
996 }
997
998 return -1;
999 }
1000
1001 override void SetActions()
1002 {
1003 super.SetActions();
1004
1006 }
1007
1008 override void OnDebugSpawn()
1009 {
1013
1014 GetInventory().CreateInInventory("HatchbackWheel");
1015 GetInventory().CreateInInventory("HatchbackWheel");
1016 GetInventory().CreateInInventory("HatchbackWheel" );
1017 GetInventory().CreateInInventory("HatchbackWheel");
1018
1019 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1020 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1021 GetInventory().CreateInInventory("HatchbackHood");
1022 GetInventory().CreateInInventory("HatchbackTrunk");
1023
1024 //-----IN CAR CARGO
1025 GetInventory().CreateInInventory("HatchbackWheel");
1026 GetInventory().CreateInInventory("HatchbackWheel");
1027 }
1028}
1029
1031{
1032 override void OnDebugSpawn()
1033 {
1037
1038 GetInventory().CreateInInventory("HatchbackWheel");
1039 GetInventory().CreateInInventory("HatchbackWheel");
1040 GetInventory().CreateInInventory("HatchbackWheel");
1041 GetInventory().CreateInInventory("HatchbackWheel");
1042
1043 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1044 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1045 GetInventory().CreateInInventory("HatchbackHood_White");
1046 GetInventory().CreateInInventory("HatchbackTrunk_White");
1047
1048 //-----IN CAR CARGO
1049 GetInventory().CreateInInventory("HatchbackWheel");
1050 GetInventory().CreateInInventory("HatchbackWheel");
1051 }
1052}
1053
1055{
1056 override void OnDebugSpawn()
1057 {
1061
1062 GetInventory().CreateInInventory("HatchbackWheel");
1063 GetInventory().CreateInInventory("HatchbackWheel");
1064 GetInventory().CreateInInventory("HatchbackWheel");
1065 GetInventory().CreateInInventory("HatchbackWheel");
1066
1067 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1068 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1069 GetInventory().CreateInInventory("HatchbackHood_Blue");
1070 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1071
1072 //-----IN CAR CARGO
1073 GetInventory().CreateInInventory("HatchbackWheel");
1074 GetInventory().CreateInInventory("HatchbackWheel");
1075 }
1076}

◆ GetSeatIndexFromDoor()

override int GetSeatIndexFromDoor ( string pDoorSelection)
protected
901{
905
906 void OffroadHatchback()
907 {
908 //m_dmgContactCoef = 0.075;
909
910 m_EngineStartOK = "offroad_engine_start_SoundSet";
911 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
912 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
913 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
914 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
915
916 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
917 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
918 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
919 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
920
921 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
922 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
923
924 SetEnginePos("0 0.7 1.2");
925 }
926
927 override void EEInit()
928 {
929 super.EEInit();
930
931 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
932 {
934 m_UTSSettings.m_ManualUpdate = true;
935 m_UTSSettings.m_TemperatureMin = 0;
936 m_UTSSettings.m_TemperatureMax = 30;
938 m_UTSSettings.m_TemperatureCap = 0;
939 m_UTSSettings.m_RangeFull = 0.5;
940 m_UTSSettings.m_RangeMax = 2;
941
944 }
945 }
946
947 override void OnEngineStart()
948 {
949 super.OnEngineStart();
950
951 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
952 {
953 m_UTSource.SetDefferedActive(true, 20.0);
954 }
955 }
956
957 override void OnEngineStop()
958 {
959 super.OnEngineStop();
960
961 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
962 {
963 m_UTSource.SetDefferedActive(false, 10.0);
964 }
965 }
966
967 override void EOnPostSimulate(IEntity other, float timeSlice)
968 {
969 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
970 {
971 if (m_UTSource.IsActive())
972 {
974 }
975 }
976 }
977
978 override int GetAnimInstance()
979 {
980 return VehicleAnimInstances.HATCHBACK;
981 }
982
983 override float GetTransportCameraDistance()
984 {
985 return 3.5;
986 }
987
988 override int GetSeatAnimationType( int posIdx )
989 {
990 switch (posIdx)
991 {
992 case 0:
993 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
994 case 1:
995 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
996 case 2:
997 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
998 case 3:
999 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
1000 }
1001
1002 return 0;
1003
1004 }
1005
1006
1008 {
1009 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
1010 }
1011
1013 {
1014 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
1015 }
1016
1018 {
1019 if (!super.CanReleaseAttachment(attachment))
1020 {
1021 return false;
1022 }
1023
1024 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
1025 {
1026 string attType = attachment.GetType();
1027 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1028 {
1029 return false;
1030 }
1031 }
1032
1033 return true;
1034 }
1035
1036 override protected bool CanManipulateSpareWheel(string slotSelectionName)
1037 {
1038 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
1039 }
1040
1041 override bool CanDisplayAttachmentCategory( string category_name )
1042 {
1043 if (!super.CanDisplayAttachmentCategory(category_name))
1044 {
1045 return false;
1046 }
1047
1048 category_name.ToLower();
1049 if (category_name.Contains("engine"))
1050 {
1051 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
1052 {
1053 return false;
1054 }
1055 }
1056
1057 return true;
1058 }
1059
1060 override bool CanDisplayCargo()
1061 {
1062 if (!super.CanDisplayCargo())
1063 {
1064 return false;
1065 }
1066
1067 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1068 {
1069 return false;
1070 }
1071
1072 return true;
1073 }
1074
1075 override int GetCarDoorsState(string slotType)
1076 {
1078
1079 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
1080 if (!carDoor)
1081 {
1082 return CarDoorState.DOORS_MISSING;
1083 }
1084
1085 switch (slotType)
1086 {
1087 case "NivaDriverDoors":
1088 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1089
1090 case "NivaCoDriverDoors":
1091 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1092
1093 case "NivaHood":
1094 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1095
1096 case "NivaTrunk":
1097 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1098 }
1099
1100 return CarDoorState.DOORS_MISSING;
1101 }
1102
1103 override bool CrewCanGetThrough(int posIdx)
1104 {
1106 switch (posIdx)
1107 {
1108 case 0:
1109 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1110 return false;
1111 else if (GetAnimationPhase("SeatDriver") > 0.5)
1112 return false;
1113
1114 return true;
1115
1116 case 1:
1117 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1118 return false;
1119 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1120 return false;
1121
1122 return true;
1123
1124 case 2:
1125 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1126 return false;
1127 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1128 return false;
1129
1130 return true;
1131
1132 case 3:
1133 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1134 return false;
1135 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1136 return false;
1137
1138 return true;
1139 }
1140
1141 return false;
1142 }
1143
1144 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1145 {
1146 switch (posIdx)
1147 {
1148 case 0:
1149 case 2:
1150 return "doors_driver";
1151 case 1:
1152 case 3:
1153 return "doors_codriver";
1154 }
1155
1156 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1157 }
1158
1159 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1160 {
1161 switch (posIdx)
1162 {
1163 case 0:
1164 case 2:
1165 return "NivaDriverDoors";
1166 case 1:
1167 case 3:
1168 return "NivaCoDriverDoors";
1169 }
1170
1171 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1172 }
1173
1174 // 0 full ambient and engine sound
1175 // 1 zero ambient and engine sound
1176 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1177 {
1178 float tempCap = 0.0;
1179
1180 switch (ctrl)
1181 {
1182 case CarSoundCtrl.DOORS:
1183 float newValue = 0;
1184 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1185 {
1186 newValue += 0.5;
1187 }
1188
1189 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1190 {
1191 newValue += 0.5;
1192 }
1193
1194 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1195 {
1196 newValue += 0.3;
1197 }
1198
1199 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1200 {
1201 newValue -= 0.6;
1202 }
1203
1204 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1205 {
1206 newValue -= 0.2;
1207 }
1208
1209 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1210 {
1211 newValue -= 0.2;
1212 }
1213
1214 return Math.Clamp(newValue, 0, 1);
1215 break;
1216 }
1217
1218 return super.OnSound(ctrl, oldValue);
1219 }
1220
1221 override string GetAnimSourceFromSelection( string selection )
1222 {
1223 switch (selection)
1224 {
1225 case "doors_driver":
1226 return "DoorsDriver";
1227 case "doors_codriver":
1228 return "DoorsCoDriver";
1229 case "doors_hood":
1230 return "DoorsHood";
1231 case "doors_trunk":
1232 return "DoorsTrunk";
1233 case "seatback_driver":
1234 return "SeatDriver";
1235 case "seatback_codriver":
1236 return "SeatCoDriver";
1237 }
1238
1239 return "";
1240 }
1241
1242 override string GetDoorConditionPointFromSelection(string selection)
1243 {
1244 switch (selection)
1245 {
1246 case "seat_driver":
1247 case "seatback_driver":
1248 case "seat_cargo1":
1249 return "seat_con_1_1";
1250 case "seat_codriver":
1251 case "seatback_codriver":
1252 case "seat_cargo2":
1253 return "seat_con_2_1";
1254 }
1255
1256 return "";
1257 }
1258
1259 override int GetCrewIndex(string selection)
1260 {
1261 switch (selection)
1262 {
1263 case "seatback_driver":
1264 return 0;
1265 case "seatback_codriver":
1266 return 1;
1267 }
1268
1269 return -1;
1270 }
1271
1272 override bool IsVitalTruckBattery()
1273 {
1274 return false;
1275 }
1276
1277 override bool IsVitalGlowPlug()
1278 {
1279 return false;
1280 }
1281
1282 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1283 {
1284 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1285 return false;
1286
1287 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1288 return false;
1289
1290 switch (currentSeat)
1291 {
1292 case 0:
1293 return nextSeat == 1;
1294
1295 case 1:
1296 return nextSeat == 0;
1297
1298 case 2:
1299 return nextSeat == 3;
1300
1301 case 3:
1302 return nextSeat == 2;
1303 }
1304
1305 return false;
1306 }
1307
1308 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1309 {
1310 switch (pCurrentSeat)
1311 {
1312 case 0:
1313 return pDoorsSelection == "DoorsDriver";
1314
1315 case 1:
1316 return pDoorsSelection == "DoorsCoDriver";
1317
1318 case 2:
1319 return pDoorsSelection == "DoorsDriver";
1320
1321 case 3:
1322 return pDoorsSelection == "DoorsCoDriver";
1323 }
1324
1325 return false;
1326 }
1327
1328 override int GetSeatIndexFromDoor( string pDoorSelection )
1329 {
1330 switch (pDoorSelection)
1331 {
1332 case "DoorsDriver":
1333 return 0;
1334 case "DoorsCoDriver":
1335 return 1;
1336 }
1337
1338 return -1;
1339 }
1340
1341 override void SetActions()
1342 {
1343 super.SetActions();
1344
1346 }
1347
1348 override void OnDebugSpawn()
1349 {
1353
1354 GetInventory().CreateInInventory("HatchbackWheel");
1355 GetInventory().CreateInInventory("HatchbackWheel");
1356 GetInventory().CreateInInventory("HatchbackWheel" );
1357 GetInventory().CreateInInventory("HatchbackWheel");
1358
1359 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1360 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1361 GetInventory().CreateInInventory("HatchbackHood");
1362 GetInventory().CreateInInventory("HatchbackTrunk");
1363
1364 //-----IN CAR CARGO
1365 GetInventory().CreateInInventory("HatchbackWheel");
1366 GetInventory().CreateInInventory("HatchbackWheel");
1367 }
1368}
1369
1371{
1372 override void OnDebugSpawn()
1373 {
1377
1378 GetInventory().CreateInInventory("HatchbackWheel");
1379 GetInventory().CreateInInventory("HatchbackWheel");
1380 GetInventory().CreateInInventory("HatchbackWheel");
1381 GetInventory().CreateInInventory("HatchbackWheel");
1382
1383 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1384 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1385 GetInventory().CreateInInventory("HatchbackHood_White");
1386 GetInventory().CreateInInventory("HatchbackTrunk_White");
1387
1388 //-----IN CAR CARGO
1389 GetInventory().CreateInInventory("HatchbackWheel");
1390 GetInventory().CreateInInventory("HatchbackWheel");
1391 }
1392}
1393
1395{
1396 override void OnDebugSpawn()
1397 {
1401
1402 GetInventory().CreateInInventory("HatchbackWheel");
1403 GetInventory().CreateInInventory("HatchbackWheel");
1404 GetInventory().CreateInInventory("HatchbackWheel");
1405 GetInventory().CreateInInventory("HatchbackWheel");
1406
1407 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1408 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1409 GetInventory().CreateInInventory("HatchbackHood_Blue");
1410 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1411
1412 //-----IN CAR CARGO
1413 GetInventory().CreateInInventory("HatchbackWheel");
1414 GetInventory().CreateInInventory("HatchbackWheel");
1415 }
1416}

◆ GetTransportCameraDistance()

override float GetTransportCameraDistance ( )
protected
556{
560
561 void OffroadHatchback()
562 {
563 //m_dmgContactCoef = 0.075;
564
565 m_EngineStartOK = "offroad_engine_start_SoundSet";
566 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
567 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
568 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
569 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
570
571 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
572 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
573 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
574 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
575
576 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
577 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
578
579 SetEnginePos("0 0.7 1.2");
580 }
581
582 override void EEInit()
583 {
584 super.EEInit();
585
586 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
587 {
589 m_UTSSettings.m_ManualUpdate = true;
590 m_UTSSettings.m_TemperatureMin = 0;
591 m_UTSSettings.m_TemperatureMax = 30;
593 m_UTSSettings.m_TemperatureCap = 0;
594 m_UTSSettings.m_RangeFull = 0.5;
595 m_UTSSettings.m_RangeMax = 2;
596
599 }
600 }
601
602 override void OnEngineStart()
603 {
604 super.OnEngineStart();
605
606 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
607 {
608 m_UTSource.SetDefferedActive(true, 20.0);
609 }
610 }
611
612 override void OnEngineStop()
613 {
614 super.OnEngineStop();
615
616 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
617 {
618 m_UTSource.SetDefferedActive(false, 10.0);
619 }
620 }
621
622 override void EOnPostSimulate(IEntity other, float timeSlice)
623 {
624 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
625 {
626 if (m_UTSource.IsActive())
627 {
629 }
630 }
631 }
632
633 override int GetAnimInstance()
634 {
635 return VehicleAnimInstances.HATCHBACK;
636 }
637
638 override float GetTransportCameraDistance()
639 {
640 return 3.5;
641 }
642
643 override int GetSeatAnimationType( int posIdx )
644 {
645 switch (posIdx)
646 {
647 case 0:
648 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
649 case 1:
650 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
651 case 2:
652 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
653 case 3:
654 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
655 }
656
657 return 0;
658
659 }
660
661
663 {
664 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
665 }
666
668 {
669 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
670 }
671
673 {
674 if (!super.CanReleaseAttachment(attachment))
675 {
676 return false;
677 }
678
679 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
680 {
681 string attType = attachment.GetType();
682 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
683 {
684 return false;
685 }
686 }
687
688 return true;
689 }
690
691 override protected bool CanManipulateSpareWheel(string slotSelectionName)
692 {
693 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
694 }
695
696 override bool CanDisplayAttachmentCategory( string category_name )
697 {
698 if (!super.CanDisplayAttachmentCategory(category_name))
699 {
700 return false;
701 }
702
703 category_name.ToLower();
704 if (category_name.Contains("engine"))
705 {
706 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
707 {
708 return false;
709 }
710 }
711
712 return true;
713 }
714
715 override bool CanDisplayCargo()
716 {
717 if (!super.CanDisplayCargo())
718 {
719 return false;
720 }
721
722 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
723 {
724 return false;
725 }
726
727 return true;
728 }
729
730 override int GetCarDoorsState(string slotType)
731 {
733
734 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
735 if (!carDoor)
736 {
737 return CarDoorState.DOORS_MISSING;
738 }
739
740 switch (slotType)
741 {
742 case "NivaDriverDoors":
743 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
744
745 case "NivaCoDriverDoors":
746 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
747
748 case "NivaHood":
749 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
750
751 case "NivaTrunk":
752 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
753 }
754
755 return CarDoorState.DOORS_MISSING;
756 }
757
758 override bool CrewCanGetThrough(int posIdx)
759 {
761 switch (posIdx)
762 {
763 case 0:
764 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
765 return false;
766 else if (GetAnimationPhase("SeatDriver") > 0.5)
767 return false;
768
769 return true;
770
771 case 1:
772 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
773 return false;
774 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
775 return false;
776
777 return true;
778
779 case 2:
780 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
781 return false;
782 else if (GetAnimationPhase("SeatDriver") <= 0.5)
783 return false;
784
785 return true;
786
787 case 3:
788 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
789 return false;
790 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
791 return false;
792
793 return true;
794 }
795
796 return false;
797 }
798
799 override string GetDoorSelectionNameFromSeatPos(int posIdx)
800 {
801 switch (posIdx)
802 {
803 case 0:
804 case 2:
805 return "doors_driver";
806 case 1:
807 case 3:
808 return "doors_codriver";
809 }
810
811 return super.GetDoorSelectionNameFromSeatPos(posIdx);
812 }
813
814 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
815 {
816 switch (posIdx)
817 {
818 case 0:
819 case 2:
820 return "NivaDriverDoors";
821 case 1:
822 case 3:
823 return "NivaCoDriverDoors";
824 }
825
826 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
827 }
828
829 // 0 full ambient and engine sound
830 // 1 zero ambient and engine sound
831 override float OnSound(CarSoundCtrl ctrl, float oldValue)
832 {
833 float tempCap = 0.0;
834
835 switch (ctrl)
836 {
837 case CarSoundCtrl.DOORS:
838 float newValue = 0;
839 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
840 {
841 newValue += 0.5;
842 }
843
844 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
845 {
846 newValue += 0.5;
847 }
848
849 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
850 {
851 newValue += 0.3;
852 }
853
854 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
855 {
856 newValue -= 0.6;
857 }
858
859 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
860 {
861 newValue -= 0.2;
862 }
863
864 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
865 {
866 newValue -= 0.2;
867 }
868
869 return Math.Clamp(newValue, 0, 1);
870 break;
871 }
872
873 return super.OnSound(ctrl, oldValue);
874 }
875
876 override string GetAnimSourceFromSelection( string selection )
877 {
878 switch (selection)
879 {
880 case "doors_driver":
881 return "DoorsDriver";
882 case "doors_codriver":
883 return "DoorsCoDriver";
884 case "doors_hood":
885 return "DoorsHood";
886 case "doors_trunk":
887 return "DoorsTrunk";
888 case "seatback_driver":
889 return "SeatDriver";
890 case "seatback_codriver":
891 return "SeatCoDriver";
892 }
893
894 return "";
895 }
896
897 override string GetDoorConditionPointFromSelection(string selection)
898 {
899 switch (selection)
900 {
901 case "seat_driver":
902 case "seatback_driver":
903 case "seat_cargo1":
904 return "seat_con_1_1";
905 case "seat_codriver":
906 case "seatback_codriver":
907 case "seat_cargo2":
908 return "seat_con_2_1";
909 }
910
911 return "";
912 }
913
914 override int GetCrewIndex(string selection)
915 {
916 switch (selection)
917 {
918 case "seatback_driver":
919 return 0;
920 case "seatback_codriver":
921 return 1;
922 }
923
924 return -1;
925 }
926
927 override bool IsVitalTruckBattery()
928 {
929 return false;
930 }
931
932 override bool IsVitalGlowPlug()
933 {
934 return false;
935 }
936
937 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
938 {
939 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
940 return false;
941
942 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
943 return false;
944
945 switch (currentSeat)
946 {
947 case 0:
948 return nextSeat == 1;
949
950 case 1:
951 return nextSeat == 0;
952
953 case 2:
954 return nextSeat == 3;
955
956 case 3:
957 return nextSeat == 2;
958 }
959
960 return false;
961 }
962
963 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
964 {
965 switch (pCurrentSeat)
966 {
967 case 0:
968 return pDoorsSelection == "DoorsDriver";
969
970 case 1:
971 return pDoorsSelection == "DoorsCoDriver";
972
973 case 2:
974 return pDoorsSelection == "DoorsDriver";
975
976 case 3:
977 return pDoorsSelection == "DoorsCoDriver";
978 }
979
980 return false;
981 }
982
983 override int GetSeatIndexFromDoor( string pDoorSelection )
984 {
985 switch (pDoorSelection)
986 {
987 case "DoorsDriver":
988 return 0;
989 case "DoorsCoDriver":
990 return 1;
991 }
992
993 return -1;
994 }
995
996 override void SetActions()
997 {
998 super.SetActions();
999
1001 }
1002
1003 override void OnDebugSpawn()
1004 {
1008
1009 GetInventory().CreateInInventory("HatchbackWheel");
1010 GetInventory().CreateInInventory("HatchbackWheel");
1011 GetInventory().CreateInInventory("HatchbackWheel" );
1012 GetInventory().CreateInInventory("HatchbackWheel");
1013
1014 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1015 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1016 GetInventory().CreateInInventory("HatchbackHood");
1017 GetInventory().CreateInInventory("HatchbackTrunk");
1018
1019 //-----IN CAR CARGO
1020 GetInventory().CreateInInventory("HatchbackWheel");
1021 GetInventory().CreateInInventory("HatchbackWheel");
1022 }
1023}
1024
1026{
1027 override void OnDebugSpawn()
1028 {
1032
1033 GetInventory().CreateInInventory("HatchbackWheel");
1034 GetInventory().CreateInInventory("HatchbackWheel");
1035 GetInventory().CreateInInventory("HatchbackWheel");
1036 GetInventory().CreateInInventory("HatchbackWheel");
1037
1038 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1039 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1040 GetInventory().CreateInInventory("HatchbackHood_White");
1041 GetInventory().CreateInInventory("HatchbackTrunk_White");
1042
1043 //-----IN CAR CARGO
1044 GetInventory().CreateInInventory("HatchbackWheel");
1045 GetInventory().CreateInInventory("HatchbackWheel");
1046 }
1047}
1048
1050{
1051 override void OnDebugSpawn()
1052 {
1056
1057 GetInventory().CreateInInventory("HatchbackWheel");
1058 GetInventory().CreateInInventory("HatchbackWheel");
1059 GetInventory().CreateInInventory("HatchbackWheel");
1060 GetInventory().CreateInInventory("HatchbackWheel");
1061
1062 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1063 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1064 GetInventory().CreateInInventory("HatchbackHood_Blue");
1065 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1066
1067 //-----IN CAR CARGO
1068 GetInventory().CreateInInventory("HatchbackWheel");
1069 GetInventory().CreateInInventory("HatchbackWheel");
1070 }
1071}

◆ IsVitalGlowPlug()

override bool IsVitalGlowPlug ( )
protected
850{
854
855 void OffroadHatchback()
856 {
857 //m_dmgContactCoef = 0.075;
858
859 m_EngineStartOK = "offroad_engine_start_SoundSet";
860 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
861 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
862 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
863 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
864
865 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
866 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
867 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
868 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
869
870 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
871 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
872
873 SetEnginePos("0 0.7 1.2");
874 }
875
876 override void EEInit()
877 {
878 super.EEInit();
879
880 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
881 {
883 m_UTSSettings.m_ManualUpdate = true;
884 m_UTSSettings.m_TemperatureMin = 0;
885 m_UTSSettings.m_TemperatureMax = 30;
887 m_UTSSettings.m_TemperatureCap = 0;
888 m_UTSSettings.m_RangeFull = 0.5;
889 m_UTSSettings.m_RangeMax = 2;
890
893 }
894 }
895
896 override void OnEngineStart()
897 {
898 super.OnEngineStart();
899
900 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
901 {
902 m_UTSource.SetDefferedActive(true, 20.0);
903 }
904 }
905
906 override void OnEngineStop()
907 {
908 super.OnEngineStop();
909
910 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
911 {
912 m_UTSource.SetDefferedActive(false, 10.0);
913 }
914 }
915
916 override void EOnPostSimulate(IEntity other, float timeSlice)
917 {
918 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
919 {
920 if (m_UTSource.IsActive())
921 {
923 }
924 }
925 }
926
927 override int GetAnimInstance()
928 {
929 return VehicleAnimInstances.HATCHBACK;
930 }
931
932 override float GetTransportCameraDistance()
933 {
934 return 3.5;
935 }
936
937 override int GetSeatAnimationType( int posIdx )
938 {
939 switch (posIdx)
940 {
941 case 0:
942 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
943 case 1:
944 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
945 case 2:
946 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
947 case 3:
948 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
949 }
950
951 return 0;
952
953 }
954
955
957 {
958 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
959 }
960
962 {
963 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
964 }
965
967 {
968 if (!super.CanReleaseAttachment(attachment))
969 {
970 return false;
971 }
972
973 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
974 {
975 string attType = attachment.GetType();
976 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
977 {
978 return false;
979 }
980 }
981
982 return true;
983 }
984
985 override protected bool CanManipulateSpareWheel(string slotSelectionName)
986 {
987 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
988 }
989
990 override bool CanDisplayAttachmentCategory( string category_name )
991 {
992 if (!super.CanDisplayAttachmentCategory(category_name))
993 {
994 return false;
995 }
996
997 category_name.ToLower();
998 if (category_name.Contains("engine"))
999 {
1000 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
1001 {
1002 return false;
1003 }
1004 }
1005
1006 return true;
1007 }
1008
1009 override bool CanDisplayCargo()
1010 {
1011 if (!super.CanDisplayCargo())
1012 {
1013 return false;
1014 }
1015
1016 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1017 {
1018 return false;
1019 }
1020
1021 return true;
1022 }
1023
1024 override int GetCarDoorsState(string slotType)
1025 {
1027
1028 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
1029 if (!carDoor)
1030 {
1031 return CarDoorState.DOORS_MISSING;
1032 }
1033
1034 switch (slotType)
1035 {
1036 case "NivaDriverDoors":
1037 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1038
1039 case "NivaCoDriverDoors":
1040 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1041
1042 case "NivaHood":
1043 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1044
1045 case "NivaTrunk":
1046 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1047 }
1048
1049 return CarDoorState.DOORS_MISSING;
1050 }
1051
1052 override bool CrewCanGetThrough(int posIdx)
1053 {
1055 switch (posIdx)
1056 {
1057 case 0:
1058 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1059 return false;
1060 else if (GetAnimationPhase("SeatDriver") > 0.5)
1061 return false;
1062
1063 return true;
1064
1065 case 1:
1066 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1067 return false;
1068 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1069 return false;
1070
1071 return true;
1072
1073 case 2:
1074 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1075 return false;
1076 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1077 return false;
1078
1079 return true;
1080
1081 case 3:
1082 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1083 return false;
1084 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1085 return false;
1086
1087 return true;
1088 }
1089
1090 return false;
1091 }
1092
1093 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1094 {
1095 switch (posIdx)
1096 {
1097 case 0:
1098 case 2:
1099 return "doors_driver";
1100 case 1:
1101 case 3:
1102 return "doors_codriver";
1103 }
1104
1105 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1106 }
1107
1108 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1109 {
1110 switch (posIdx)
1111 {
1112 case 0:
1113 case 2:
1114 return "NivaDriverDoors";
1115 case 1:
1116 case 3:
1117 return "NivaCoDriverDoors";
1118 }
1119
1120 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1121 }
1122
1123 // 0 full ambient and engine sound
1124 // 1 zero ambient and engine sound
1125 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1126 {
1127 float tempCap = 0.0;
1128
1129 switch (ctrl)
1130 {
1131 case CarSoundCtrl.DOORS:
1132 float newValue = 0;
1133 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1134 {
1135 newValue += 0.5;
1136 }
1137
1138 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1139 {
1140 newValue += 0.5;
1141 }
1142
1143 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1144 {
1145 newValue += 0.3;
1146 }
1147
1148 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1149 {
1150 newValue -= 0.6;
1151 }
1152
1153 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1154 {
1155 newValue -= 0.2;
1156 }
1157
1158 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1159 {
1160 newValue -= 0.2;
1161 }
1162
1163 return Math.Clamp(newValue, 0, 1);
1164 break;
1165 }
1166
1167 return super.OnSound(ctrl, oldValue);
1168 }
1169
1170 override string GetAnimSourceFromSelection( string selection )
1171 {
1172 switch (selection)
1173 {
1174 case "doors_driver":
1175 return "DoorsDriver";
1176 case "doors_codriver":
1177 return "DoorsCoDriver";
1178 case "doors_hood":
1179 return "DoorsHood";
1180 case "doors_trunk":
1181 return "DoorsTrunk";
1182 case "seatback_driver":
1183 return "SeatDriver";
1184 case "seatback_codriver":
1185 return "SeatCoDriver";
1186 }
1187
1188 return "";
1189 }
1190
1191 override string GetDoorConditionPointFromSelection(string selection)
1192 {
1193 switch (selection)
1194 {
1195 case "seat_driver":
1196 case "seatback_driver":
1197 case "seat_cargo1":
1198 return "seat_con_1_1";
1199 case "seat_codriver":
1200 case "seatback_codriver":
1201 case "seat_cargo2":
1202 return "seat_con_2_1";
1203 }
1204
1205 return "";
1206 }
1207
1208 override int GetCrewIndex(string selection)
1209 {
1210 switch (selection)
1211 {
1212 case "seatback_driver":
1213 return 0;
1214 case "seatback_codriver":
1215 return 1;
1216 }
1217
1218 return -1;
1219 }
1220
1221 override bool IsVitalTruckBattery()
1222 {
1223 return false;
1224 }
1225
1226 override bool IsVitalGlowPlug()
1227 {
1228 return false;
1229 }
1230
1231 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1232 {
1233 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1234 return false;
1235
1236 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1237 return false;
1238
1239 switch (currentSeat)
1240 {
1241 case 0:
1242 return nextSeat == 1;
1243
1244 case 1:
1245 return nextSeat == 0;
1246
1247 case 2:
1248 return nextSeat == 3;
1249
1250 case 3:
1251 return nextSeat == 2;
1252 }
1253
1254 return false;
1255 }
1256
1257 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1258 {
1259 switch (pCurrentSeat)
1260 {
1261 case 0:
1262 return pDoorsSelection == "DoorsDriver";
1263
1264 case 1:
1265 return pDoorsSelection == "DoorsCoDriver";
1266
1267 case 2:
1268 return pDoorsSelection == "DoorsDriver";
1269
1270 case 3:
1271 return pDoorsSelection == "DoorsCoDriver";
1272 }
1273
1274 return false;
1275 }
1276
1277 override int GetSeatIndexFromDoor( string pDoorSelection )
1278 {
1279 switch (pDoorSelection)
1280 {
1281 case "DoorsDriver":
1282 return 0;
1283 case "DoorsCoDriver":
1284 return 1;
1285 }
1286
1287 return -1;
1288 }
1289
1290 override void SetActions()
1291 {
1292 super.SetActions();
1293
1295 }
1296
1297 override void OnDebugSpawn()
1298 {
1302
1303 GetInventory().CreateInInventory("HatchbackWheel");
1304 GetInventory().CreateInInventory("HatchbackWheel");
1305 GetInventory().CreateInInventory("HatchbackWheel" );
1306 GetInventory().CreateInInventory("HatchbackWheel");
1307
1308 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1309 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1310 GetInventory().CreateInInventory("HatchbackHood");
1311 GetInventory().CreateInInventory("HatchbackTrunk");
1312
1313 //-----IN CAR CARGO
1314 GetInventory().CreateInInventory("HatchbackWheel");
1315 GetInventory().CreateInInventory("HatchbackWheel");
1316 }
1317}
1318
1320{
1321 override void OnDebugSpawn()
1322 {
1326
1327 GetInventory().CreateInInventory("HatchbackWheel");
1328 GetInventory().CreateInInventory("HatchbackWheel");
1329 GetInventory().CreateInInventory("HatchbackWheel");
1330 GetInventory().CreateInInventory("HatchbackWheel");
1331
1332 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1333 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1334 GetInventory().CreateInInventory("HatchbackHood_White");
1335 GetInventory().CreateInInventory("HatchbackTrunk_White");
1336
1337 //-----IN CAR CARGO
1338 GetInventory().CreateInInventory("HatchbackWheel");
1339 GetInventory().CreateInInventory("HatchbackWheel");
1340 }
1341}
1342
1344{
1345 override void OnDebugSpawn()
1346 {
1350
1351 GetInventory().CreateInInventory("HatchbackWheel");
1352 GetInventory().CreateInInventory("HatchbackWheel");
1353 GetInventory().CreateInInventory("HatchbackWheel");
1354 GetInventory().CreateInInventory("HatchbackWheel");
1355
1356 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1357 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1358 GetInventory().CreateInInventory("HatchbackHood_Blue");
1359 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1360
1361 //-----IN CAR CARGO
1362 GetInventory().CreateInInventory("HatchbackWheel");
1363 GetInventory().CreateInInventory("HatchbackWheel");
1364 }
1365}

◆ IsVitalTruckBattery()

override bool IsVitalTruckBattery ( )
protected
845{
849
850 void OffroadHatchback()
851 {
852 //m_dmgContactCoef = 0.075;
853
854 m_EngineStartOK = "offroad_engine_start_SoundSet";
855 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
856 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
857 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
858 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
859
860 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
861 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
862 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
863 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
864
865 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
866 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
867
868 SetEnginePos("0 0.7 1.2");
869 }
870
871 override void EEInit()
872 {
873 super.EEInit();
874
875 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
876 {
878 m_UTSSettings.m_ManualUpdate = true;
879 m_UTSSettings.m_TemperatureMin = 0;
880 m_UTSSettings.m_TemperatureMax = 30;
882 m_UTSSettings.m_TemperatureCap = 0;
883 m_UTSSettings.m_RangeFull = 0.5;
884 m_UTSSettings.m_RangeMax = 2;
885
888 }
889 }
890
891 override void OnEngineStart()
892 {
893 super.OnEngineStart();
894
895 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
896 {
897 m_UTSource.SetDefferedActive(true, 20.0);
898 }
899 }
900
901 override void OnEngineStop()
902 {
903 super.OnEngineStop();
904
905 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
906 {
907 m_UTSource.SetDefferedActive(false, 10.0);
908 }
909 }
910
911 override void EOnPostSimulate(IEntity other, float timeSlice)
912 {
913 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
914 {
915 if (m_UTSource.IsActive())
916 {
918 }
919 }
920 }
921
922 override int GetAnimInstance()
923 {
924 return VehicleAnimInstances.HATCHBACK;
925 }
926
927 override float GetTransportCameraDistance()
928 {
929 return 3.5;
930 }
931
932 override int GetSeatAnimationType( int posIdx )
933 {
934 switch (posIdx)
935 {
936 case 0:
937 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
938 case 1:
939 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
940 case 2:
941 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
942 case 3:
943 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
944 }
945
946 return 0;
947
948 }
949
950
952 {
953 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
954 }
955
957 {
958 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
959 }
960
962 {
963 if (!super.CanReleaseAttachment(attachment))
964 {
965 return false;
966 }
967
968 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
969 {
970 string attType = attachment.GetType();
971 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
972 {
973 return false;
974 }
975 }
976
977 return true;
978 }
979
980 override protected bool CanManipulateSpareWheel(string slotSelectionName)
981 {
982 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
983 }
984
985 override bool CanDisplayAttachmentCategory( string category_name )
986 {
987 if (!super.CanDisplayAttachmentCategory(category_name))
988 {
989 return false;
990 }
991
992 category_name.ToLower();
993 if (category_name.Contains("engine"))
994 {
995 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
996 {
997 return false;
998 }
999 }
1000
1001 return true;
1002 }
1003
1004 override bool CanDisplayCargo()
1005 {
1006 if (!super.CanDisplayCargo())
1007 {
1008 return false;
1009 }
1010
1011 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1012 {
1013 return false;
1014 }
1015
1016 return true;
1017 }
1018
1019 override int GetCarDoorsState(string slotType)
1020 {
1022
1023 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
1024 if (!carDoor)
1025 {
1026 return CarDoorState.DOORS_MISSING;
1027 }
1028
1029 switch (slotType)
1030 {
1031 case "NivaDriverDoors":
1032 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1033
1034 case "NivaCoDriverDoors":
1035 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1036
1037 case "NivaHood":
1038 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1039
1040 case "NivaTrunk":
1041 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1042 }
1043
1044 return CarDoorState.DOORS_MISSING;
1045 }
1046
1047 override bool CrewCanGetThrough(int posIdx)
1048 {
1050 switch (posIdx)
1051 {
1052 case 0:
1053 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1054 return false;
1055 else if (GetAnimationPhase("SeatDriver") > 0.5)
1056 return false;
1057
1058 return true;
1059
1060 case 1:
1061 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1062 return false;
1063 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1064 return false;
1065
1066 return true;
1067
1068 case 2:
1069 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1070 return false;
1071 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1072 return false;
1073
1074 return true;
1075
1076 case 3:
1077 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1078 return false;
1079 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1080 return false;
1081
1082 return true;
1083 }
1084
1085 return false;
1086 }
1087
1088 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1089 {
1090 switch (posIdx)
1091 {
1092 case 0:
1093 case 2:
1094 return "doors_driver";
1095 case 1:
1096 case 3:
1097 return "doors_codriver";
1098 }
1099
1100 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1101 }
1102
1103 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1104 {
1105 switch (posIdx)
1106 {
1107 case 0:
1108 case 2:
1109 return "NivaDriverDoors";
1110 case 1:
1111 case 3:
1112 return "NivaCoDriverDoors";
1113 }
1114
1115 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1116 }
1117
1118 // 0 full ambient and engine sound
1119 // 1 zero ambient and engine sound
1120 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1121 {
1122 float tempCap = 0.0;
1123
1124 switch (ctrl)
1125 {
1126 case CarSoundCtrl.DOORS:
1127 float newValue = 0;
1128 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1129 {
1130 newValue += 0.5;
1131 }
1132
1133 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1134 {
1135 newValue += 0.5;
1136 }
1137
1138 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1139 {
1140 newValue += 0.3;
1141 }
1142
1143 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1144 {
1145 newValue -= 0.6;
1146 }
1147
1148 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1149 {
1150 newValue -= 0.2;
1151 }
1152
1153 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1154 {
1155 newValue -= 0.2;
1156 }
1157
1158 return Math.Clamp(newValue, 0, 1);
1159 break;
1160 }
1161
1162 return super.OnSound(ctrl, oldValue);
1163 }
1164
1165 override string GetAnimSourceFromSelection( string selection )
1166 {
1167 switch (selection)
1168 {
1169 case "doors_driver":
1170 return "DoorsDriver";
1171 case "doors_codriver":
1172 return "DoorsCoDriver";
1173 case "doors_hood":
1174 return "DoorsHood";
1175 case "doors_trunk":
1176 return "DoorsTrunk";
1177 case "seatback_driver":
1178 return "SeatDriver";
1179 case "seatback_codriver":
1180 return "SeatCoDriver";
1181 }
1182
1183 return "";
1184 }
1185
1186 override string GetDoorConditionPointFromSelection(string selection)
1187 {
1188 switch (selection)
1189 {
1190 case "seat_driver":
1191 case "seatback_driver":
1192 case "seat_cargo1":
1193 return "seat_con_1_1";
1194 case "seat_codriver":
1195 case "seatback_codriver":
1196 case "seat_cargo2":
1197 return "seat_con_2_1";
1198 }
1199
1200 return "";
1201 }
1202
1203 override int GetCrewIndex(string selection)
1204 {
1205 switch (selection)
1206 {
1207 case "seatback_driver":
1208 return 0;
1209 case "seatback_codriver":
1210 return 1;
1211 }
1212
1213 return -1;
1214 }
1215
1216 override bool IsVitalTruckBattery()
1217 {
1218 return false;
1219 }
1220
1221 override bool IsVitalGlowPlug()
1222 {
1223 return false;
1224 }
1225
1226 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1227 {
1228 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1229 return false;
1230
1231 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1232 return false;
1233
1234 switch (currentSeat)
1235 {
1236 case 0:
1237 return nextSeat == 1;
1238
1239 case 1:
1240 return nextSeat == 0;
1241
1242 case 2:
1243 return nextSeat == 3;
1244
1245 case 3:
1246 return nextSeat == 2;
1247 }
1248
1249 return false;
1250 }
1251
1252 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1253 {
1254 switch (pCurrentSeat)
1255 {
1256 case 0:
1257 return pDoorsSelection == "DoorsDriver";
1258
1259 case 1:
1260 return pDoorsSelection == "DoorsCoDriver";
1261
1262 case 2:
1263 return pDoorsSelection == "DoorsDriver";
1264
1265 case 3:
1266 return pDoorsSelection == "DoorsCoDriver";
1267 }
1268
1269 return false;
1270 }
1271
1272 override int GetSeatIndexFromDoor( string pDoorSelection )
1273 {
1274 switch (pDoorSelection)
1275 {
1276 case "DoorsDriver":
1277 return 0;
1278 case "DoorsCoDriver":
1279 return 1;
1280 }
1281
1282 return -1;
1283 }
1284
1285 override void SetActions()
1286 {
1287 super.SetActions();
1288
1290 }
1291
1292 override void OnDebugSpawn()
1293 {
1297
1298 GetInventory().CreateInInventory("HatchbackWheel");
1299 GetInventory().CreateInInventory("HatchbackWheel");
1300 GetInventory().CreateInInventory("HatchbackWheel" );
1301 GetInventory().CreateInInventory("HatchbackWheel");
1302
1303 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1304 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1305 GetInventory().CreateInInventory("HatchbackHood");
1306 GetInventory().CreateInInventory("HatchbackTrunk");
1307
1308 //-----IN CAR CARGO
1309 GetInventory().CreateInInventory("HatchbackWheel");
1310 GetInventory().CreateInInventory("HatchbackWheel");
1311 }
1312}
1313
1315{
1316 override void OnDebugSpawn()
1317 {
1321
1322 GetInventory().CreateInInventory("HatchbackWheel");
1323 GetInventory().CreateInInventory("HatchbackWheel");
1324 GetInventory().CreateInInventory("HatchbackWheel");
1325 GetInventory().CreateInInventory("HatchbackWheel");
1326
1327 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1328 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1329 GetInventory().CreateInInventory("HatchbackHood_White");
1330 GetInventory().CreateInInventory("HatchbackTrunk_White");
1331
1332 //-----IN CAR CARGO
1333 GetInventory().CreateInInventory("HatchbackWheel");
1334 GetInventory().CreateInInventory("HatchbackWheel");
1335 }
1336}
1337
1339{
1340 override void OnDebugSpawn()
1341 {
1345
1346 GetInventory().CreateInInventory("HatchbackWheel");
1347 GetInventory().CreateInInventory("HatchbackWheel");
1348 GetInventory().CreateInInventory("HatchbackWheel");
1349 GetInventory().CreateInInventory("HatchbackWheel");
1350
1351 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1352 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1353 GetInventory().CreateInInventory("HatchbackHood_Blue");
1354 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1355
1356 //-----IN CAR CARGO
1357 GetInventory().CreateInInventory("HatchbackWheel");
1358 GetInventory().CreateInInventory("HatchbackWheel");
1359 }
1360}

◆ OffroadHatchback()

void OffroadHatchback ( )
protected
496{
497 override void OnDebugSpawn()

◆ OnDebugSpawn()

474 {
478
479 GetInventory().CreateInInventory("HatchbackWheel");
480 GetInventory().CreateInInventory("HatchbackWheel");
481 GetInventory().CreateInInventory("HatchbackWheel");
482 GetInventory().CreateInInventory("HatchbackWheel");
483
484 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
485 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
486 GetInventory().CreateInInventory("HatchbackHood_White");
487 GetInventory().CreateInInventory("HatchbackTrunk_White");
488
489 //-----IN CAR CARGO
490 GetInventory().CreateInInventory("HatchbackWheel");
491 GetInventory().CreateInInventory("HatchbackWheel");
492 }

Перекрестные ссылки m_UTSLEngine, m_UTSource, m_UTSSettings и UniversalTemperatureSourceLambdaEngine().

◆ OnEngineStart()

override void OnEngineStart ( )
protected
520{
524
525 void OffroadHatchback()
526 {
527 //m_dmgContactCoef = 0.075;
528
529 m_EngineStartOK = "offroad_engine_start_SoundSet";
530 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
531 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
532 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
533 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
534
535 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
536 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
537 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
538 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
539
540 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
541 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
542
543 SetEnginePos("0 0.7 1.2");
544 }
545
546 override void EEInit()
547 {
548 super.EEInit();
549
550 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
551 {
553 m_UTSSettings.m_ManualUpdate = true;
554 m_UTSSettings.m_TemperatureMin = 0;
555 m_UTSSettings.m_TemperatureMax = 30;
557 m_UTSSettings.m_TemperatureCap = 0;
558 m_UTSSettings.m_RangeFull = 0.5;
559 m_UTSSettings.m_RangeMax = 2;
560
563 }
564 }
565
566 override void OnEngineStart()
567 {
568 super.OnEngineStart();
569
570 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
571 {
572 m_UTSource.SetDefferedActive(true, 20.0);
573 }
574 }
575
576 override void OnEngineStop()
577 {
578 super.OnEngineStop();
579
580 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
581 {
582 m_UTSource.SetDefferedActive(false, 10.0);
583 }
584 }
585
586 override void EOnPostSimulate(IEntity other, float timeSlice)
587 {
588 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
589 {
590 if (m_UTSource.IsActive())
591 {
593 }
594 }
595 }
596
597 override int GetAnimInstance()
598 {
599 return VehicleAnimInstances.HATCHBACK;
600 }
601
602 override float GetTransportCameraDistance()
603 {
604 return 3.5;
605 }
606
607 override int GetSeatAnimationType( int posIdx )
608 {
609 switch (posIdx)
610 {
611 case 0:
612 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
613 case 1:
614 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
615 case 2:
616 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
617 case 3:
618 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
619 }
620
621 return 0;
622
623 }
624
625
627 {
628 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
629 }
630
632 {
633 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
634 }
635
637 {
638 if (!super.CanReleaseAttachment(attachment))
639 {
640 return false;
641 }
642
643 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
644 {
645 string attType = attachment.GetType();
646 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
647 {
648 return false;
649 }
650 }
651
652 return true;
653 }
654
655 override protected bool CanManipulateSpareWheel(string slotSelectionName)
656 {
657 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
658 }
659
660 override bool CanDisplayAttachmentCategory( string category_name )
661 {
662 if (!super.CanDisplayAttachmentCategory(category_name))
663 {
664 return false;
665 }
666
667 category_name.ToLower();
668 if (category_name.Contains("engine"))
669 {
670 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
671 {
672 return false;
673 }
674 }
675
676 return true;
677 }
678
679 override bool CanDisplayCargo()
680 {
681 if (!super.CanDisplayCargo())
682 {
683 return false;
684 }
685
686 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
687 {
688 return false;
689 }
690
691 return true;
692 }
693
694 override int GetCarDoorsState(string slotType)
695 {
697
698 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
699 if (!carDoor)
700 {
701 return CarDoorState.DOORS_MISSING;
702 }
703
704 switch (slotType)
705 {
706 case "NivaDriverDoors":
707 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
708
709 case "NivaCoDriverDoors":
710 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
711
712 case "NivaHood":
713 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
714
715 case "NivaTrunk":
716 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
717 }
718
719 return CarDoorState.DOORS_MISSING;
720 }
721
722 override bool CrewCanGetThrough(int posIdx)
723 {
725 switch (posIdx)
726 {
727 case 0:
728 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
729 return false;
730 else if (GetAnimationPhase("SeatDriver") > 0.5)
731 return false;
732
733 return true;
734
735 case 1:
736 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
737 return false;
738 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
739 return false;
740
741 return true;
742
743 case 2:
744 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
745 return false;
746 else if (GetAnimationPhase("SeatDriver") <= 0.5)
747 return false;
748
749 return true;
750
751 case 3:
752 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
753 return false;
754 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
755 return false;
756
757 return true;
758 }
759
760 return false;
761 }
762
763 override string GetDoorSelectionNameFromSeatPos(int posIdx)
764 {
765 switch (posIdx)
766 {
767 case 0:
768 case 2:
769 return "doors_driver";
770 case 1:
771 case 3:
772 return "doors_codriver";
773 }
774
775 return super.GetDoorSelectionNameFromSeatPos(posIdx);
776 }
777
778 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
779 {
780 switch (posIdx)
781 {
782 case 0:
783 case 2:
784 return "NivaDriverDoors";
785 case 1:
786 case 3:
787 return "NivaCoDriverDoors";
788 }
789
790 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
791 }
792
793 // 0 full ambient and engine sound
794 // 1 zero ambient and engine sound
795 override float OnSound(CarSoundCtrl ctrl, float oldValue)
796 {
797 float tempCap = 0.0;
798
799 switch (ctrl)
800 {
801 case CarSoundCtrl.DOORS:
802 float newValue = 0;
803 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
804 {
805 newValue += 0.5;
806 }
807
808 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
809 {
810 newValue += 0.5;
811 }
812
813 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
814 {
815 newValue += 0.3;
816 }
817
818 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
819 {
820 newValue -= 0.6;
821 }
822
823 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
824 {
825 newValue -= 0.2;
826 }
827
828 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
829 {
830 newValue -= 0.2;
831 }
832
833 return Math.Clamp(newValue, 0, 1);
834 break;
835 }
836
837 return super.OnSound(ctrl, oldValue);
838 }
839
840 override string GetAnimSourceFromSelection( string selection )
841 {
842 switch (selection)
843 {
844 case "doors_driver":
845 return "DoorsDriver";
846 case "doors_codriver":
847 return "DoorsCoDriver";
848 case "doors_hood":
849 return "DoorsHood";
850 case "doors_trunk":
851 return "DoorsTrunk";
852 case "seatback_driver":
853 return "SeatDriver";
854 case "seatback_codriver":
855 return "SeatCoDriver";
856 }
857
858 return "";
859 }
860
861 override string GetDoorConditionPointFromSelection(string selection)
862 {
863 switch (selection)
864 {
865 case "seat_driver":
866 case "seatback_driver":
867 case "seat_cargo1":
868 return "seat_con_1_1";
869 case "seat_codriver":
870 case "seatback_codriver":
871 case "seat_cargo2":
872 return "seat_con_2_1";
873 }
874
875 return "";
876 }
877
878 override int GetCrewIndex(string selection)
879 {
880 switch (selection)
881 {
882 case "seatback_driver":
883 return 0;
884 case "seatback_codriver":
885 return 1;
886 }
887
888 return -1;
889 }
890
891 override bool IsVitalTruckBattery()
892 {
893 return false;
894 }
895
896 override bool IsVitalGlowPlug()
897 {
898 return false;
899 }
900
901 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
902 {
903 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
904 return false;
905
906 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
907 return false;
908
909 switch (currentSeat)
910 {
911 case 0:
912 return nextSeat == 1;
913
914 case 1:
915 return nextSeat == 0;
916
917 case 2:
918 return nextSeat == 3;
919
920 case 3:
921 return nextSeat == 2;
922 }
923
924 return false;
925 }
926
927 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
928 {
929 switch (pCurrentSeat)
930 {
931 case 0:
932 return pDoorsSelection == "DoorsDriver";
933
934 case 1:
935 return pDoorsSelection == "DoorsCoDriver";
936
937 case 2:
938 return pDoorsSelection == "DoorsDriver";
939
940 case 3:
941 return pDoorsSelection == "DoorsCoDriver";
942 }
943
944 return false;
945 }
946
947 override int GetSeatIndexFromDoor( string pDoorSelection )
948 {
949 switch (pDoorSelection)
950 {
951 case "DoorsDriver":
952 return 0;
953 case "DoorsCoDriver":
954 return 1;
955 }
956
957 return -1;
958 }
959
960 override void SetActions()
961 {
962 super.SetActions();
963
965 }
966
967 override void OnDebugSpawn()
968 {
972
973 GetInventory().CreateInInventory("HatchbackWheel");
974 GetInventory().CreateInInventory("HatchbackWheel");
975 GetInventory().CreateInInventory("HatchbackWheel" );
976 GetInventory().CreateInInventory("HatchbackWheel");
977
978 GetInventory().CreateInInventory("HatchbackDoors_Driver");
979 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
980 GetInventory().CreateInInventory("HatchbackHood");
981 GetInventory().CreateInInventory("HatchbackTrunk");
982
983 //-----IN CAR CARGO
984 GetInventory().CreateInInventory("HatchbackWheel");
985 GetInventory().CreateInInventory("HatchbackWheel");
986 }
987}
988
990{
991 override void OnDebugSpawn()
992 {
996
997 GetInventory().CreateInInventory("HatchbackWheel");
998 GetInventory().CreateInInventory("HatchbackWheel");
999 GetInventory().CreateInInventory("HatchbackWheel");
1000 GetInventory().CreateInInventory("HatchbackWheel");
1001
1002 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1003 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1004 GetInventory().CreateInInventory("HatchbackHood_White");
1005 GetInventory().CreateInInventory("HatchbackTrunk_White");
1006
1007 //-----IN CAR CARGO
1008 GetInventory().CreateInInventory("HatchbackWheel");
1009 GetInventory().CreateInInventory("HatchbackWheel");
1010 }
1011}
1012
1014{
1015 override void OnDebugSpawn()
1016 {
1020
1021 GetInventory().CreateInInventory("HatchbackWheel");
1022 GetInventory().CreateInInventory("HatchbackWheel");
1023 GetInventory().CreateInInventory("HatchbackWheel");
1024 GetInventory().CreateInInventory("HatchbackWheel");
1025
1026 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1027 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1028 GetInventory().CreateInInventory("HatchbackHood_Blue");
1029 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1030
1031 //-----IN CAR CARGO
1032 GetInventory().CreateInInventory("HatchbackWheel");
1033 GetInventory().CreateInInventory("HatchbackWheel");
1034 }
1035}

◆ OnEngineStop()

override void OnEngineStop ( )
protected
530{
534
535 void OffroadHatchback()
536 {
537 //m_dmgContactCoef = 0.075;
538
539 m_EngineStartOK = "offroad_engine_start_SoundSet";
540 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
541 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
542 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
543 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
544
545 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
546 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
547 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
548 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
549
550 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
551 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
552
553 SetEnginePos("0 0.7 1.2");
554 }
555
556 override void EEInit()
557 {
558 super.EEInit();
559
560 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
561 {
563 m_UTSSettings.m_ManualUpdate = true;
564 m_UTSSettings.m_TemperatureMin = 0;
565 m_UTSSettings.m_TemperatureMax = 30;
567 m_UTSSettings.m_TemperatureCap = 0;
568 m_UTSSettings.m_RangeFull = 0.5;
569 m_UTSSettings.m_RangeMax = 2;
570
573 }
574 }
575
576 override void OnEngineStart()
577 {
578 super.OnEngineStart();
579
580 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
581 {
582 m_UTSource.SetDefferedActive(true, 20.0);
583 }
584 }
585
586 override void OnEngineStop()
587 {
588 super.OnEngineStop();
589
590 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
591 {
592 m_UTSource.SetDefferedActive(false, 10.0);
593 }
594 }
595
596 override void EOnPostSimulate(IEntity other, float timeSlice)
597 {
598 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
599 {
600 if (m_UTSource.IsActive())
601 {
603 }
604 }
605 }
606
607 override int GetAnimInstance()
608 {
609 return VehicleAnimInstances.HATCHBACK;
610 }
611
612 override float GetTransportCameraDistance()
613 {
614 return 3.5;
615 }
616
617 override int GetSeatAnimationType( int posIdx )
618 {
619 switch (posIdx)
620 {
621 case 0:
622 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
623 case 1:
624 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
625 case 2:
626 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
627 case 3:
628 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
629 }
630
631 return 0;
632
633 }
634
635
637 {
638 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
639 }
640
642 {
643 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
644 }
645
647 {
648 if (!super.CanReleaseAttachment(attachment))
649 {
650 return false;
651 }
652
653 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
654 {
655 string attType = attachment.GetType();
656 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
657 {
658 return false;
659 }
660 }
661
662 return true;
663 }
664
665 override protected bool CanManipulateSpareWheel(string slotSelectionName)
666 {
667 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
668 }
669
670 override bool CanDisplayAttachmentCategory( string category_name )
671 {
672 if (!super.CanDisplayAttachmentCategory(category_name))
673 {
674 return false;
675 }
676
677 category_name.ToLower();
678 if (category_name.Contains("engine"))
679 {
680 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
681 {
682 return false;
683 }
684 }
685
686 return true;
687 }
688
689 override bool CanDisplayCargo()
690 {
691 if (!super.CanDisplayCargo())
692 {
693 return false;
694 }
695
696 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
697 {
698 return false;
699 }
700
701 return true;
702 }
703
704 override int GetCarDoorsState(string slotType)
705 {
707
708 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
709 if (!carDoor)
710 {
711 return CarDoorState.DOORS_MISSING;
712 }
713
714 switch (slotType)
715 {
716 case "NivaDriverDoors":
717 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
718
719 case "NivaCoDriverDoors":
720 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
721
722 case "NivaHood":
723 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
724
725 case "NivaTrunk":
726 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
727 }
728
729 return CarDoorState.DOORS_MISSING;
730 }
731
732 override bool CrewCanGetThrough(int posIdx)
733 {
735 switch (posIdx)
736 {
737 case 0:
738 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
739 return false;
740 else if (GetAnimationPhase("SeatDriver") > 0.5)
741 return false;
742
743 return true;
744
745 case 1:
746 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
747 return false;
748 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
749 return false;
750
751 return true;
752
753 case 2:
754 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
755 return false;
756 else if (GetAnimationPhase("SeatDriver") <= 0.5)
757 return false;
758
759 return true;
760
761 case 3:
762 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
763 return false;
764 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
765 return false;
766
767 return true;
768 }
769
770 return false;
771 }
772
773 override string GetDoorSelectionNameFromSeatPos(int posIdx)
774 {
775 switch (posIdx)
776 {
777 case 0:
778 case 2:
779 return "doors_driver";
780 case 1:
781 case 3:
782 return "doors_codriver";
783 }
784
785 return super.GetDoorSelectionNameFromSeatPos(posIdx);
786 }
787
788 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
789 {
790 switch (posIdx)
791 {
792 case 0:
793 case 2:
794 return "NivaDriverDoors";
795 case 1:
796 case 3:
797 return "NivaCoDriverDoors";
798 }
799
800 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
801 }
802
803 // 0 full ambient and engine sound
804 // 1 zero ambient and engine sound
805 override float OnSound(CarSoundCtrl ctrl, float oldValue)
806 {
807 float tempCap = 0.0;
808
809 switch (ctrl)
810 {
811 case CarSoundCtrl.DOORS:
812 float newValue = 0;
813 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
814 {
815 newValue += 0.5;
816 }
817
818 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
819 {
820 newValue += 0.5;
821 }
822
823 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
824 {
825 newValue += 0.3;
826 }
827
828 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
829 {
830 newValue -= 0.6;
831 }
832
833 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
834 {
835 newValue -= 0.2;
836 }
837
838 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
839 {
840 newValue -= 0.2;
841 }
842
843 return Math.Clamp(newValue, 0, 1);
844 break;
845 }
846
847 return super.OnSound(ctrl, oldValue);
848 }
849
850 override string GetAnimSourceFromSelection( string selection )
851 {
852 switch (selection)
853 {
854 case "doors_driver":
855 return "DoorsDriver";
856 case "doors_codriver":
857 return "DoorsCoDriver";
858 case "doors_hood":
859 return "DoorsHood";
860 case "doors_trunk":
861 return "DoorsTrunk";
862 case "seatback_driver":
863 return "SeatDriver";
864 case "seatback_codriver":
865 return "SeatCoDriver";
866 }
867
868 return "";
869 }
870
871 override string GetDoorConditionPointFromSelection(string selection)
872 {
873 switch (selection)
874 {
875 case "seat_driver":
876 case "seatback_driver":
877 case "seat_cargo1":
878 return "seat_con_1_1";
879 case "seat_codriver":
880 case "seatback_codriver":
881 case "seat_cargo2":
882 return "seat_con_2_1";
883 }
884
885 return "";
886 }
887
888 override int GetCrewIndex(string selection)
889 {
890 switch (selection)
891 {
892 case "seatback_driver":
893 return 0;
894 case "seatback_codriver":
895 return 1;
896 }
897
898 return -1;
899 }
900
901 override bool IsVitalTruckBattery()
902 {
903 return false;
904 }
905
906 override bool IsVitalGlowPlug()
907 {
908 return false;
909 }
910
911 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
912 {
913 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
914 return false;
915
916 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
917 return false;
918
919 switch (currentSeat)
920 {
921 case 0:
922 return nextSeat == 1;
923
924 case 1:
925 return nextSeat == 0;
926
927 case 2:
928 return nextSeat == 3;
929
930 case 3:
931 return nextSeat == 2;
932 }
933
934 return false;
935 }
936
937 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
938 {
939 switch (pCurrentSeat)
940 {
941 case 0:
942 return pDoorsSelection == "DoorsDriver";
943
944 case 1:
945 return pDoorsSelection == "DoorsCoDriver";
946
947 case 2:
948 return pDoorsSelection == "DoorsDriver";
949
950 case 3:
951 return pDoorsSelection == "DoorsCoDriver";
952 }
953
954 return false;
955 }
956
957 override int GetSeatIndexFromDoor( string pDoorSelection )
958 {
959 switch (pDoorSelection)
960 {
961 case "DoorsDriver":
962 return 0;
963 case "DoorsCoDriver":
964 return 1;
965 }
966
967 return -1;
968 }
969
970 override void SetActions()
971 {
972 super.SetActions();
973
975 }
976
977 override void OnDebugSpawn()
978 {
982
983 GetInventory().CreateInInventory("HatchbackWheel");
984 GetInventory().CreateInInventory("HatchbackWheel");
985 GetInventory().CreateInInventory("HatchbackWheel" );
986 GetInventory().CreateInInventory("HatchbackWheel");
987
988 GetInventory().CreateInInventory("HatchbackDoors_Driver");
989 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
990 GetInventory().CreateInInventory("HatchbackHood");
991 GetInventory().CreateInInventory("HatchbackTrunk");
992
993 //-----IN CAR CARGO
994 GetInventory().CreateInInventory("HatchbackWheel");
995 GetInventory().CreateInInventory("HatchbackWheel");
996 }
997}
998
1000{
1001 override void OnDebugSpawn()
1002 {
1006
1007 GetInventory().CreateInInventory("HatchbackWheel");
1008 GetInventory().CreateInInventory("HatchbackWheel");
1009 GetInventory().CreateInInventory("HatchbackWheel");
1010 GetInventory().CreateInInventory("HatchbackWheel");
1011
1012 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1013 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1014 GetInventory().CreateInInventory("HatchbackHood_White");
1015 GetInventory().CreateInInventory("HatchbackTrunk_White");
1016
1017 //-----IN CAR CARGO
1018 GetInventory().CreateInInventory("HatchbackWheel");
1019 GetInventory().CreateInInventory("HatchbackWheel");
1020 }
1021}
1022
1024{
1025 override void OnDebugSpawn()
1026 {
1030
1031 GetInventory().CreateInInventory("HatchbackWheel");
1032 GetInventory().CreateInInventory("HatchbackWheel");
1033 GetInventory().CreateInInventory("HatchbackWheel");
1034 GetInventory().CreateInInventory("HatchbackWheel");
1035
1036 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1037 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1038 GetInventory().CreateInInventory("HatchbackHood_Blue");
1039 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1040
1041 //-----IN CAR CARGO
1042 GetInventory().CreateInInventory("HatchbackWheel");
1043 GetInventory().CreateInInventory("HatchbackWheel");
1044 }
1045}

◆ OnSound()

override float OnSound ( CarSoundCtrl ctrl,
float oldValue )
protected
749{
753
754 void OffroadHatchback()
755 {
756 //m_dmgContactCoef = 0.075;
757
758 m_EngineStartOK = "offroad_engine_start_SoundSet";
759 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
760 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
761 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
762 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
763
764 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
765 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
766 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
767 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
768
769 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
770 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
771
772 SetEnginePos("0 0.7 1.2");
773 }
774
775 override void EEInit()
776 {
777 super.EEInit();
778
779 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
780 {
782 m_UTSSettings.m_ManualUpdate = true;
783 m_UTSSettings.m_TemperatureMin = 0;
784 m_UTSSettings.m_TemperatureMax = 30;
786 m_UTSSettings.m_TemperatureCap = 0;
787 m_UTSSettings.m_RangeFull = 0.5;
788 m_UTSSettings.m_RangeMax = 2;
789
792 }
793 }
794
795 override void OnEngineStart()
796 {
797 super.OnEngineStart();
798
799 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
800 {
801 m_UTSource.SetDefferedActive(true, 20.0);
802 }
803 }
804
805 override void OnEngineStop()
806 {
807 super.OnEngineStop();
808
809 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
810 {
811 m_UTSource.SetDefferedActive(false, 10.0);
812 }
813 }
814
815 override void EOnPostSimulate(IEntity other, float timeSlice)
816 {
817 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
818 {
819 if (m_UTSource.IsActive())
820 {
822 }
823 }
824 }
825
826 override int GetAnimInstance()
827 {
828 return VehicleAnimInstances.HATCHBACK;
829 }
830
831 override float GetTransportCameraDistance()
832 {
833 return 3.5;
834 }
835
836 override int GetSeatAnimationType( int posIdx )
837 {
838 switch (posIdx)
839 {
840 case 0:
841 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
842 case 1:
843 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
844 case 2:
845 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
846 case 3:
847 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
848 }
849
850 return 0;
851
852 }
853
854
856 {
857 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
858 }
859
861 {
862 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
863 }
864
866 {
867 if (!super.CanReleaseAttachment(attachment))
868 {
869 return false;
870 }
871
872 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
873 {
874 string attType = attachment.GetType();
875 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
876 {
877 return false;
878 }
879 }
880
881 return true;
882 }
883
884 override protected bool CanManipulateSpareWheel(string slotSelectionName)
885 {
886 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
887 }
888
889 override bool CanDisplayAttachmentCategory( string category_name )
890 {
891 if (!super.CanDisplayAttachmentCategory(category_name))
892 {
893 return false;
894 }
895
896 category_name.ToLower();
897 if (category_name.Contains("engine"))
898 {
899 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
900 {
901 return false;
902 }
903 }
904
905 return true;
906 }
907
908 override bool CanDisplayCargo()
909 {
910 if (!super.CanDisplayCargo())
911 {
912 return false;
913 }
914
915 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
916 {
917 return false;
918 }
919
920 return true;
921 }
922
923 override int GetCarDoorsState(string slotType)
924 {
926
927 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
928 if (!carDoor)
929 {
930 return CarDoorState.DOORS_MISSING;
931 }
932
933 switch (slotType)
934 {
935 case "NivaDriverDoors":
936 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
937
938 case "NivaCoDriverDoors":
939 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
940
941 case "NivaHood":
942 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
943
944 case "NivaTrunk":
945 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
946 }
947
948 return CarDoorState.DOORS_MISSING;
949 }
950
951 override bool CrewCanGetThrough(int posIdx)
952 {
954 switch (posIdx)
955 {
956 case 0:
957 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
958 return false;
959 else if (GetAnimationPhase("SeatDriver") > 0.5)
960 return false;
961
962 return true;
963
964 case 1:
965 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
966 return false;
967 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
968 return false;
969
970 return true;
971
972 case 2:
973 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
974 return false;
975 else if (GetAnimationPhase("SeatDriver") <= 0.5)
976 return false;
977
978 return true;
979
980 case 3:
981 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
982 return false;
983 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
984 return false;
985
986 return true;
987 }
988
989 return false;
990 }
991
992 override string GetDoorSelectionNameFromSeatPos(int posIdx)
993 {
994 switch (posIdx)
995 {
996 case 0:
997 case 2:
998 return "doors_driver";
999 case 1:
1000 case 3:
1001 return "doors_codriver";
1002 }
1003
1004 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1005 }
1006
1007 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1008 {
1009 switch (posIdx)
1010 {
1011 case 0:
1012 case 2:
1013 return "NivaDriverDoors";
1014 case 1:
1015 case 3:
1016 return "NivaCoDriverDoors";
1017 }
1018
1019 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1020 }
1021
1022 // 0 full ambient and engine sound
1023 // 1 zero ambient and engine sound
1024 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1025 {
1026 float tempCap = 0.0;
1027
1028 switch (ctrl)
1029 {
1030 case CarSoundCtrl.DOORS:
1031 float newValue = 0;
1032 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1033 {
1034 newValue += 0.5;
1035 }
1036
1037 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1038 {
1039 newValue += 0.5;
1040 }
1041
1042 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1043 {
1044 newValue += 0.3;
1045 }
1046
1047 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1048 {
1049 newValue -= 0.6;
1050 }
1051
1052 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1053 {
1054 newValue -= 0.2;
1055 }
1056
1057 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1058 {
1059 newValue -= 0.2;
1060 }
1061
1062 return Math.Clamp(newValue, 0, 1);
1063 break;
1064 }
1065
1066 return super.OnSound(ctrl, oldValue);
1067 }
1068
1069 override string GetAnimSourceFromSelection( string selection )
1070 {
1071 switch (selection)
1072 {
1073 case "doors_driver":
1074 return "DoorsDriver";
1075 case "doors_codriver":
1076 return "DoorsCoDriver";
1077 case "doors_hood":
1078 return "DoorsHood";
1079 case "doors_trunk":
1080 return "DoorsTrunk";
1081 case "seatback_driver":
1082 return "SeatDriver";
1083 case "seatback_codriver":
1084 return "SeatCoDriver";
1085 }
1086
1087 return "";
1088 }
1089
1090 override string GetDoorConditionPointFromSelection(string selection)
1091 {
1092 switch (selection)
1093 {
1094 case "seat_driver":
1095 case "seatback_driver":
1096 case "seat_cargo1":
1097 return "seat_con_1_1";
1098 case "seat_codriver":
1099 case "seatback_codriver":
1100 case "seat_cargo2":
1101 return "seat_con_2_1";
1102 }
1103
1104 return "";
1105 }
1106
1107 override int GetCrewIndex(string selection)
1108 {
1109 switch (selection)
1110 {
1111 case "seatback_driver":
1112 return 0;
1113 case "seatback_codriver":
1114 return 1;
1115 }
1116
1117 return -1;
1118 }
1119
1120 override bool IsVitalTruckBattery()
1121 {
1122 return false;
1123 }
1124
1125 override bool IsVitalGlowPlug()
1126 {
1127 return false;
1128 }
1129
1130 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1131 {
1132 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1133 return false;
1134
1135 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1136 return false;
1137
1138 switch (currentSeat)
1139 {
1140 case 0:
1141 return nextSeat == 1;
1142
1143 case 1:
1144 return nextSeat == 0;
1145
1146 case 2:
1147 return nextSeat == 3;
1148
1149 case 3:
1150 return nextSeat == 2;
1151 }
1152
1153 return false;
1154 }
1155
1156 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1157 {
1158 switch (pCurrentSeat)
1159 {
1160 case 0:
1161 return pDoorsSelection == "DoorsDriver";
1162
1163 case 1:
1164 return pDoorsSelection == "DoorsCoDriver";
1165
1166 case 2:
1167 return pDoorsSelection == "DoorsDriver";
1168
1169 case 3:
1170 return pDoorsSelection == "DoorsCoDriver";
1171 }
1172
1173 return false;
1174 }
1175
1176 override int GetSeatIndexFromDoor( string pDoorSelection )
1177 {
1178 switch (pDoorSelection)
1179 {
1180 case "DoorsDriver":
1181 return 0;
1182 case "DoorsCoDriver":
1183 return 1;
1184 }
1185
1186 return -1;
1187 }
1188
1189 override void SetActions()
1190 {
1191 super.SetActions();
1192
1194 }
1195
1196 override void OnDebugSpawn()
1197 {
1201
1202 GetInventory().CreateInInventory("HatchbackWheel");
1203 GetInventory().CreateInInventory("HatchbackWheel");
1204 GetInventory().CreateInInventory("HatchbackWheel" );
1205 GetInventory().CreateInInventory("HatchbackWheel");
1206
1207 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1208 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1209 GetInventory().CreateInInventory("HatchbackHood");
1210 GetInventory().CreateInInventory("HatchbackTrunk");
1211
1212 //-----IN CAR CARGO
1213 GetInventory().CreateInInventory("HatchbackWheel");
1214 GetInventory().CreateInInventory("HatchbackWheel");
1215 }
1216}
1217
1219{
1220 override void OnDebugSpawn()
1221 {
1225
1226 GetInventory().CreateInInventory("HatchbackWheel");
1227 GetInventory().CreateInInventory("HatchbackWheel");
1228 GetInventory().CreateInInventory("HatchbackWheel");
1229 GetInventory().CreateInInventory("HatchbackWheel");
1230
1231 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1232 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1233 GetInventory().CreateInInventory("HatchbackHood_White");
1234 GetInventory().CreateInInventory("HatchbackTrunk_White");
1235
1236 //-----IN CAR CARGO
1237 GetInventory().CreateInInventory("HatchbackWheel");
1238 GetInventory().CreateInInventory("HatchbackWheel");
1239 }
1240}
1241
1243{
1244 override void OnDebugSpawn()
1245 {
1249
1250 GetInventory().CreateInInventory("HatchbackWheel");
1251 GetInventory().CreateInInventory("HatchbackWheel");
1252 GetInventory().CreateInInventory("HatchbackWheel");
1253 GetInventory().CreateInInventory("HatchbackWheel");
1254
1255 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1256 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1257 GetInventory().CreateInInventory("HatchbackHood_Blue");
1258 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1259
1260 //-----IN CAR CARGO
1261 GetInventory().CreateInInventory("HatchbackWheel");
1262 GetInventory().CreateInInventory("HatchbackWheel");
1263 }
1264}

◆ SetActions()

override void SetActions ( )
protected
914{
918
919 void OffroadHatchback()
920 {
921 //m_dmgContactCoef = 0.075;
922
923 m_EngineStartOK = "offroad_engine_start_SoundSet";
924 m_EngineStartBattery = "offroad_engine_failed_start_battery_SoundSet";
925 m_EngineStartPlug = "offroad_engine_failed_start_sparkplugs_SoundSet";
926 m_EngineStartFuel = "offroad_engine_failed_start_fuel_SoundSet";
927 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
928
929 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
930 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
931 m_CarSeatShiftInSound = "Offroad_SeatShiftIn_SoundSet";
932 m_CarSeatShiftOutSound = "Offroad_SeatShiftOut_SoundSet";
933
934 m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
935 m_CarHornLongSoundName = "Offroad_Horn_SoundSet";
936
937 SetEnginePos("0 0.7 1.2");
938 }
939
940 override void EEInit()
941 {
942 super.EEInit();
943
944 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
945 {
947 m_UTSSettings.m_ManualUpdate = true;
948 m_UTSSettings.m_TemperatureMin = 0;
949 m_UTSSettings.m_TemperatureMax = 30;
951 m_UTSSettings.m_TemperatureCap = 0;
952 m_UTSSettings.m_RangeFull = 0.5;
953 m_UTSSettings.m_RangeMax = 2;
954
957 }
958 }
959
960 override void OnEngineStart()
961 {
962 super.OnEngineStart();
963
964 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
965 {
966 m_UTSource.SetDefferedActive(true, 20.0);
967 }
968 }
969
970 override void OnEngineStop()
971 {
972 super.OnEngineStop();
973
974 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
975 {
976 m_UTSource.SetDefferedActive(false, 10.0);
977 }
978 }
979
980 override void EOnPostSimulate(IEntity other, float timeSlice)
981 {
982 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
983 {
984 if (m_UTSource.IsActive())
985 {
987 }
988 }
989 }
990
991 override int GetAnimInstance()
992 {
993 return VehicleAnimInstances.HATCHBACK;
994 }
995
996 override float GetTransportCameraDistance()
997 {
998 return 3.5;
999 }
1000
1001 override int GetSeatAnimationType( int posIdx )
1002 {
1003 switch (posIdx)
1004 {
1005 case 0:
1006 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
1007 case 1:
1008 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
1009 case 2:
1010 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
1011 case 3:
1012 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
1013 }
1014
1015 return 0;
1016
1017 }
1018
1019
1021 {
1022 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackRearLight) );
1023 }
1024
1026 {
1027 return CarLightBase.Cast( ScriptedLightBase.CreateLight(OffroadHatchbackFrontLight) );
1028 }
1029
1031 {
1032 if (!super.CanReleaseAttachment(attachment))
1033 {
1034 return false;
1035 }
1036
1037 if (EngineIsOn() || GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
1038 {
1039 string attType = attachment.GetType();
1040 if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
1041 {
1042 return false;
1043 }
1044 }
1045
1046 return true;
1047 }
1048
1049 override protected bool CanManipulateSpareWheel(string slotSelectionName)
1050 {
1051 return GetCarDoorsState("NivaHood") != CarDoorState.DOORS_CLOSED;
1052 }
1053
1054 override bool CanDisplayAttachmentCategory( string category_name )
1055 {
1056 if (!super.CanDisplayAttachmentCategory(category_name))
1057 {
1058 return false;
1059 }
1060
1061 category_name.ToLower();
1062 if (category_name.Contains("engine"))
1063 {
1064 if (GetCarDoorsState("NivaHood") == CarDoorState.DOORS_CLOSED)
1065 {
1066 return false;
1067 }
1068 }
1069
1070 return true;
1071 }
1072
1073 override bool CanDisplayCargo()
1074 {
1075 if (!super.CanDisplayCargo())
1076 {
1077 return false;
1078 }
1079
1080 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1081 {
1082 return false;
1083 }
1084
1085 return true;
1086 }
1087
1088 override int GetCarDoorsState(string slotType)
1089 {
1091
1092 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
1093 if (!carDoor)
1094 {
1095 return CarDoorState.DOORS_MISSING;
1096 }
1097
1098 switch (slotType)
1099 {
1100 case "NivaDriverDoors":
1101 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1102
1103 case "NivaCoDriverDoors":
1104 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1105
1106 case "NivaHood":
1107 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1108
1109 case "NivaTrunk":
1110 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1111 }
1112
1113 return CarDoorState.DOORS_MISSING;
1114 }
1115
1116 override bool CrewCanGetThrough(int posIdx)
1117 {
1119 switch (posIdx)
1120 {
1121 case 0:
1122 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1123 return false;
1124 else if (GetAnimationPhase("SeatDriver") > 0.5)
1125 return false;
1126
1127 return true;
1128
1129 case 1:
1130 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1131 return false;
1132 else if (GetAnimationPhase("SeatCoDriver") > 0.5)
1133 return false;
1134
1135 return true;
1136
1137 case 2:
1138 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1139 return false;
1140 else if (GetAnimationPhase("SeatDriver") <= 0.5)
1141 return false;
1142
1143 return true;
1144
1145 case 3:
1146 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1147 return false;
1148 else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
1149 return false;
1150
1151 return true;
1152 }
1153
1154 return false;
1155 }
1156
1157 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1158 {
1159 switch (posIdx)
1160 {
1161 case 0:
1162 case 2:
1163 return "doors_driver";
1164 case 1:
1165 case 3:
1166 return "doors_codriver";
1167 }
1168
1169 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1170 }
1171
1172 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1173 {
1174 switch (posIdx)
1175 {
1176 case 0:
1177 case 2:
1178 return "NivaDriverDoors";
1179 case 1:
1180 case 3:
1181 return "NivaCoDriverDoors";
1182 }
1183
1184 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1185 }
1186
1187 // 0 full ambient and engine sound
1188 // 1 zero ambient and engine sound
1189 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1190 {
1191 float tempCap = 0.0;
1192
1193 switch (ctrl)
1194 {
1195 case CarSoundCtrl.DOORS:
1196 float newValue = 0;
1197 if (GetCarDoorsState("NivaDriverDoors") == CarDoorState.DOORS_CLOSED)
1198 {
1199 newValue += 0.5;
1200 }
1201
1202 if (GetCarDoorsState("NivaCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1203 {
1204 newValue += 0.5;
1205 }
1206
1207 if (GetCarDoorsState("NivaTrunk") == CarDoorState.DOORS_CLOSED)
1208 {
1209 newValue += 0.3;
1210 }
1211
1212 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1213 {
1214 newValue -= 0.6;
1215 }
1216
1217 if (GetHealthLevel("WindowLR") == GameConstants.STATE_RUINED)
1218 {
1219 newValue -= 0.2;
1220 }
1221
1222 if (GetHealthLevel("WindowRR") == GameConstants.STATE_RUINED)
1223 {
1224 newValue -= 0.2;
1225 }
1226
1227 return Math.Clamp(newValue, 0, 1);
1228 break;
1229 }
1230
1231 return super.OnSound(ctrl, oldValue);
1232 }
1233
1234 override string GetAnimSourceFromSelection( string selection )
1235 {
1236 switch (selection)
1237 {
1238 case "doors_driver":
1239 return "DoorsDriver";
1240 case "doors_codriver":
1241 return "DoorsCoDriver";
1242 case "doors_hood":
1243 return "DoorsHood";
1244 case "doors_trunk":
1245 return "DoorsTrunk";
1246 case "seatback_driver":
1247 return "SeatDriver";
1248 case "seatback_codriver":
1249 return "SeatCoDriver";
1250 }
1251
1252 return "";
1253 }
1254
1255 override string GetDoorConditionPointFromSelection(string selection)
1256 {
1257 switch (selection)
1258 {
1259 case "seat_driver":
1260 case "seatback_driver":
1261 case "seat_cargo1":
1262 return "seat_con_1_1";
1263 case "seat_codriver":
1264 case "seatback_codriver":
1265 case "seat_cargo2":
1266 return "seat_con_2_1";
1267 }
1268
1269 return "";
1270 }
1271
1272 override int GetCrewIndex(string selection)
1273 {
1274 switch (selection)
1275 {
1276 case "seatback_driver":
1277 return 0;
1278 case "seatback_codriver":
1279 return 1;
1280 }
1281
1282 return -1;
1283 }
1284
1285 override bool IsVitalTruckBattery()
1286 {
1287 return false;
1288 }
1289
1290 override bool IsVitalGlowPlug()
1291 {
1292 return false;
1293 }
1294
1295 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1296 {
1297 if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
1298 return false;
1299
1300 if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
1301 return false;
1302
1303 switch (currentSeat)
1304 {
1305 case 0:
1306 return nextSeat == 1;
1307
1308 case 1:
1309 return nextSeat == 0;
1310
1311 case 2:
1312 return nextSeat == 3;
1313
1314 case 3:
1315 return nextSeat == 2;
1316 }
1317
1318 return false;
1319 }
1320
1321 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1322 {
1323 switch (pCurrentSeat)
1324 {
1325 case 0:
1326 return pDoorsSelection == "DoorsDriver";
1327
1328 case 1:
1329 return pDoorsSelection == "DoorsCoDriver";
1330
1331 case 2:
1332 return pDoorsSelection == "DoorsDriver";
1333
1334 case 3:
1335 return pDoorsSelection == "DoorsCoDriver";
1336 }
1337
1338 return false;
1339 }
1340
1341 override int GetSeatIndexFromDoor( string pDoorSelection )
1342 {
1343 switch (pDoorSelection)
1344 {
1345 case "DoorsDriver":
1346 return 0;
1347 case "DoorsCoDriver":
1348 return 1;
1349 }
1350
1351 return -1;
1352 }
1353
1354 override void SetActions()
1355 {
1356 super.SetActions();
1357
1359 }
1360
1361 override void OnDebugSpawn()
1362 {
1366
1367 GetInventory().CreateInInventory("HatchbackWheel");
1368 GetInventory().CreateInInventory("HatchbackWheel");
1369 GetInventory().CreateInInventory("HatchbackWheel" );
1370 GetInventory().CreateInInventory("HatchbackWheel");
1371
1372 GetInventory().CreateInInventory("HatchbackDoors_Driver");
1373 GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
1374 GetInventory().CreateInInventory("HatchbackHood");
1375 GetInventory().CreateInInventory("HatchbackTrunk");
1376
1377 //-----IN CAR CARGO
1378 GetInventory().CreateInInventory("HatchbackWheel");
1379 GetInventory().CreateInInventory("HatchbackWheel");
1380 }
1381}
1382
1384{
1385 override void OnDebugSpawn()
1386 {
1390
1391 GetInventory().CreateInInventory("HatchbackWheel");
1392 GetInventory().CreateInInventory("HatchbackWheel");
1393 GetInventory().CreateInInventory("HatchbackWheel");
1394 GetInventory().CreateInInventory("HatchbackWheel");
1395
1396 GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
1397 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
1398 GetInventory().CreateInInventory("HatchbackHood_White");
1399 GetInventory().CreateInInventory("HatchbackTrunk_White");
1400
1401 //-----IN CAR CARGO
1402 GetInventory().CreateInInventory("HatchbackWheel");
1403 GetInventory().CreateInInventory("HatchbackWheel");
1404 }
1405}
1406
1408{
1409 override void OnDebugSpawn()
1410 {
1414
1415 GetInventory().CreateInInventory("HatchbackWheel");
1416 GetInventory().CreateInInventory("HatchbackWheel");
1417 GetInventory().CreateInInventory("HatchbackWheel");
1418 GetInventory().CreateInInventory("HatchbackWheel");
1419
1420 GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
1421 GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
1422 GetInventory().CreateInInventory("HatchbackHood_Blue");
1423 GetInventory().CreateInInventory("HatchbackTrunk_Blue");
1424
1425 //-----IN CAR CARGO
1426 GetInventory().CreateInInventory("HatchbackWheel");
1427 GetInventory().CreateInInventory("HatchbackWheel");
1428 }
1429}

Переменные

◆ m_UTSLEngine

◆ m_UTSource

◆ m_UTSSettings