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