631{
  635 
  637    {
  638        
  639    
  640        m_EngineStartOK         = "offroad_engine_start_SoundSet";
  641        m_EngineStartBattery    = "offroad_engine_failed_start_battery_SoundSet";
  642        m_EngineStartPlug       = "offroad_engine_failed_start_sparkplugs_SoundSet";
  643        m_EngineStartFuel       = "offroad_engine_failed_start_fuel_SoundSet";
  644        m_EngineStop            = "offroad_engine_stop_SoundSet";
  645        m_EngineStopFuel        = "offroad_engine_stop_fuel_SoundSet";
  646        
  647        m_CarDoorOpenSound      = "offroad_door_open_SoundSet";
  648        m_CarDoorCloseSound     = "offroad_door_close_SoundSet";
  649        m_CarSeatShiftInSound   = "Offroad_SeatShiftIn_SoundSet";
  650        m_CarSeatShiftOutSound  = "Offroad_SeatShiftOut_SoundSet";
  651        
  652        m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
  653        m_CarHornLongSoundName  = "Offroad_Horn_SoundSet";
  654        
  655        SetEnginePos("0 0.7 1.2");
  656    }
  657    
  659    {       
  660        super.EEInit();
  661        
  663        {
  670            
  673        }       
  674    }
  675    
  677    {
  678        super.OnEngineStart();
  679 
  681        {
  683        }
  684    }
  685    
  687    {
  688        super.OnEngineStop();
  689 
  691        {
  693        }
  694    }
  695    
  697    {
  699        {
  701            {
  703            }
  704        }
  705    }
  706    
  708    {
  710    }
  711    
  713    {
  714        return 3.5;
  715    }
  716 
  718    {
  719        switch (posIdx)
  720        {
  721        case 0:
  723        case 1:
  725        case 2:
  727        case 3:
  729        }
  730 
  731        return 0;
  732 
  733    }
  734    
  735    
  737    {
  739    }
  740    
  742    {
  744    }
  745 
  747    {
  748        if (!super.CanReleaseAttachment(attachment))
  749        {
  750            return false;
  751        }
  752        
  754        {
  755            string attType = attachment.GetType();
  756            if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
  757            {
  758                return false;
  759            }
  760        }
  761 
  762        return true;
  763    }
  764    
  766    {
  768    }
  769 
  771    {
  772        if (!super.CanDisplayAttachmentCategory(category_name))
  773        {
  774            return false;
  775        }
  776    
  778        if (category_name.
Contains(
"engine"))
 
  779        {
  781            {
  782                return false;
  783            }
  784        }
  785                
  786        return true;
  787    }
  788    
  790    {
  791        if (!super.CanDisplayCargo())
  792        {
  793            return false;
  794        }
  795        
  797        {
  798            return false;
  799        }
  800        
  801        return true;
  802    }
  803 
  805    {
  807        
  808        Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
 
  809        if (!carDoor)
  810        {
  812        }
  813 
  814        switch (slotType)
  815        {
  816            case "NivaDriverDoors":
  817                return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
  818                
  819            case "NivaCoDriverDoors":
  820                return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
  821                
  822            case "NivaHood":
  823                return TranslateAnimationPhaseToCarDoorState("DoorsHood");
  824                
  825            case "NivaTrunk":
  826                return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
  827        }
  828 
  830    }
  831    
  833    {
  835        switch (posIdx)
  836        {
  837            case 0:
  839                    return false;
  840                else if (GetAnimationPhase("SeatDriver") > 0.5)
  841                    return false;
  842    
  843                return true;
  844    
  845            case 1:
  847                    return false;
  848                else if (GetAnimationPhase("SeatCoDriver") > 0.5)
  849                    return false;
  850    
  851                return true;
  852    
  853            case 2:
  855                    return false;
  856                else if (GetAnimationPhase("SeatDriver") <= 0.5)
  857                    return false;
  858    
  859                return true;
  860    
  861            case 3:
  863                    return false;
  864                else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
  865                    return false;
  866    
  867                return true;
  868        }
  869 
  870        return false;
  871    }
  872 
  874    {
  875        switch (posIdx)
  876        {
  877            case 0:
  878            case 2:
  879                return "doors_driver";
  880            case 1:
  881            case 3:
  882                return "doors_codriver";
  883        }
  884        
  885        return super.GetDoorSelectionNameFromSeatPos(posIdx);
  886    }
  887 
  889    {
  890        switch (posIdx)
  891        {
  892            case 0:
  893            case 2:
  894                return "NivaDriverDoors";
  895            case 1:
  896            case 3:
  897                return "NivaCoDriverDoors";
  898        }
  899        
  900        return super.GetDoorInvSlotNameFromSeatPos(posIdx);
  901    }
  902    
  903    
  904    
  906    {
  907        float tempCap = 0.0;
  908 
  909        switch (ctrl)
  910        {
  912            float newValue = 0;
  914            {
  915                newValue += 0.5;
  916            }
  917 
  919            {
  920                newValue += 0.5;
  921            }
  922 
  924            {
  925                newValue += 0.3;
  926            }
  927        
  929            {
  930                newValue -= 0.6;
  931            }
  932 
  934            {
  935                newValue -= 0.2;
  936            }
  937        
  939            {
  940                newValue -= 0.2;
  941            }
  942 
  944        break;
  945        }
  946 
  947        return super.OnSound(ctrl, oldValue);
  948    }
  949 
  951    {
  952        switch (selection)
  953        {
  954        case "doors_driver":
  955            return "DoorsDriver";
  956        case "doors_codriver":
  957            return "DoorsCoDriver";
  958        case "doors_hood":
  959            return "DoorsHood";
  960        case "doors_trunk":
  961            return "DoorsTrunk";
  962        case "seatback_driver":
  963            return "SeatDriver";
  964        case "seatback_codriver":
  965            return "SeatCoDriver";
  966        }
  967 
  968        return "";
  969    }
  970    
  972    {
  973        switch (selection)
  974        {
  975            case "seat_driver":
  976            case "seatback_driver":
  977            case "seat_cargo1":
  978                return "seat_con_1_1";
  979            case "seat_codriver":
  980            case "seatback_codriver":
  981            case "seat_cargo2":
  982                return "seat_con_2_1";
  983        }
  984        
  985        return "";
  986    }
  987 
  989    {
  990        switch (selection)
  991        {
  992            case "seatback_driver":
  993                return 0;
  994            case "seatback_codriver":
  995                return 1;
  996        }
  997 
  998        return -1;
  999    }
 1000 
 1002    {
 1003        return false;
 1004    }
 1005 
 1007    {
 1008        return false;
 1009    }
 1010    
 1012    {
 1013        if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
 1014            return false;
 1015        
 1016        if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
 1017            return false;
 1018        
 1019        switch (currentSeat)
 1020        {
 1021            case 0:
 1022                return nextSeat == 1;
 1023    
 1024            case 1:
 1025                return nextSeat == 0;
 1026    
 1027            case 2:
 1028                return nextSeat == 3;
 1029    
 1030            case 3:
 1031                return nextSeat == 2;
 1032        }
 1033        
 1034        return false;
 1035    }
 1036 
 1038    {
 1039        switch (pCurrentSeat)
 1040        {
 1041            case 0:
 1042                return pDoorsSelection == "DoorsDriver";
 1043    
 1044            case 1:
 1045                return pDoorsSelection == "DoorsCoDriver";
 1046    
 1047            case 2:
 1048                return pDoorsSelection == "DoorsDriver";
 1049    
 1050            case 3:
 1051                return pDoorsSelection == "DoorsCoDriver";
 1052        }
 1053        
 1054        return false;       
 1055    }
 1056    
 1058    {
 1059        switch (pDoorSelection)
 1060        {
 1061            case "DoorsDriver":
 1062                return 0;
 1063            case "DoorsCoDriver":
 1064                return 1;
 1065        }
 1066 
 1067        return -1;
 1068    }
 1069    
 1071    {
 1072        super.SetActions();
 1073 
 1075    }
 1076    
 1078    {
 1079        SpawnUniversalParts();
 1080        SpawnAdditionalItems();
 1081        FillUpCarFluids();
 1082 
 1083        GetInventory().CreateInInventory("HatchbackWheel");
 1084        GetInventory().CreateInInventory("HatchbackWheel");
 1085        GetInventory().CreateInInventory("HatchbackWheel" );
 1086        GetInventory().CreateInInventory("HatchbackWheel");
 1087 
 1088        GetInventory().CreateInInventory("HatchbackDoors_Driver");
 1089        GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
 1090        GetInventory().CreateInInventory("HatchbackHood");
 1091        GetInventory().CreateInInventory("HatchbackTrunk");
 1092 
 1093        
 1094        GetInventory().CreateInInventory("HatchbackWheel");
 1095        GetInventory().CreateInInventory("HatchbackWheel");
 1096    }
 1097}
 1098 
 1100{
 1102    {
 1103        SpawnUniversalParts();
 1104        SpawnAdditionalItems();
 1105        FillUpCarFluids();
 1106 
 1107        GetInventory().CreateInInventory("HatchbackWheel");
 1108        GetInventory().CreateInInventory("HatchbackWheel");
 1109        GetInventory().CreateInInventory("HatchbackWheel");
 1110        GetInventory().CreateInInventory("HatchbackWheel");
 1111 
 1112        GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
 1113        GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
 1114        GetInventory().CreateInInventory("HatchbackHood_White");
 1115        GetInventory().CreateInInventory("HatchbackTrunk_White");
 1116 
 1117        
 1118        GetInventory().CreateInInventory("HatchbackWheel");
 1119        GetInventory().CreateInInventory("HatchbackWheel");
 1120    }
 1121}
 1122 
 1124{
 1126    {
 1127        SpawnUniversalParts();
 1128        SpawnAdditionalItems();
 1129        FillUpCarFluids();
 1130 
 1131        GetInventory().CreateInInventory("HatchbackWheel");
 1132        GetInventory().CreateInInventory("HatchbackWheel");
 1133        GetInventory().CreateInInventory("HatchbackWheel");
 1134        GetInventory().CreateInInventory("HatchbackWheel");
 1135    
 1136        GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
 1137        GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
 1138        GetInventory().CreateInInventory("HatchbackHood_Blue");
 1139        GetInventory().CreateInInventory("HatchbackTrunk_Blue");
 1140    
 1141        
 1142        GetInventory().CreateInInventory("HatchbackWheel");
 1143        GetInventory().CreateInInventory("HatchbackWheel");
 1144    }
 1145}
void AddAction(typename actionName)
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
ref UniversalTemperatureSourceSettings m_UTSSettings
ref UniversalTemperatureSource m_UTSource
override void SetActions()
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
override string GetAnimSourceFromSelection(string selection)
override int GetSeatAnimationType(int posIdx)
override string GetDoorConditionPointFromSelection(string selection)
override float OnSound(CarSoundCtrl ctrl, float oldValue)
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
override void EOnPostSimulate(IEntity other, float timeSlice)
override void OnEngineStop()
override float GetTransportCameraDistance()
override bool CanReleaseAttachment(EntityAI attachment)
override bool CanDisplayCargo()
override void OnEngineStart()
override CarLightBase CreateFrontLight()
override int GetAnimInstance()
override bool CrewCanGetThrough(int posIdx)
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
bool CanManipulateSpareWheel(string slotSelectionName)
override bool IsVitalGlowPlug()
override CarRearLightBase CreateRearLight()
class OffroadHatchback extends CarScript OnDebugSpawn()
override int GetSeatIndexFromDoor(string pDoorSelection)
override bool IsVitalTruckBattery()
override string GetDoorSelectionNameFromSeatPos(int posIdx)
override int GetCarDoorsState(string slotType)
override int GetCrewIndex(string selection)
override bool CanDisplayAttachmentCategory(string category_name)
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
Super root of all classes in Enforce script.
override void OnDebugSpawn()
original Timer deletes m_params which is unwanted
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
bool Contains(string sample)
Returns true if sample is substring of string.
proto int ToLower()
Changes string to lowercase. Returns length.