549{
  553 
  555    {
  556        
  557    
  558        m_EngineStartOK         = "offroad_engine_start_SoundSet";
  559        m_EngineStartBattery    = "offroad_engine_failed_start_battery_SoundSet";
  560        m_EngineStartPlug       = "offroad_engine_failed_start_sparkplugs_SoundSet";
  561        m_EngineStartFuel       = "offroad_engine_failed_start_fuel_SoundSet";
  562        m_EngineStop            = "offroad_engine_stop_SoundSet";
  563        m_EngineStopFuel        = "offroad_engine_stop_fuel_SoundSet";
  564        
  565        m_CarDoorOpenSound      = "offroad_door_open_SoundSet";
  566        m_CarDoorCloseSound     = "offroad_door_close_SoundSet";
  567        m_CarSeatShiftInSound   = "Offroad_SeatShiftIn_SoundSet";
  568        m_CarSeatShiftOutSound  = "Offroad_SeatShiftOut_SoundSet";
  569        
  570        m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
  571        m_CarHornLongSoundName  = "Offroad_Horn_SoundSet";
  572        
  573        SetEnginePos("0 0.7 1.2");
  574    }
  575    
  577    {       
  578        super.EEInit();
  579        
  581        {
  588            
  591        }       
  592    }
  593    
  595    {
  596        super.OnEngineStart();
  597 
  599        {
  601        }
  602    }
  603    
  605    {
  606        super.OnEngineStop();
  607 
  609        {
  611        }
  612    }
  613    
  615    {
  617        {
  619            {
  621            }
  622        }
  623    }
  624    
  626    {
  628    }
  629    
  631    {
  632        return 3.5;
  633    }
  634 
  636    {
  637        switch (posIdx)
  638        {
  639        case 0:
  641        case 1:
  643        case 2:
  645        case 3:
  647        }
  648 
  649        return 0;
  650 
  651    }
  652    
  653    
  655    {
  657    }
  658    
  660    {
  662    }
  663 
  665    {
  666        if (!super.CanReleaseAttachment(attachment))
  667        {
  668            return false;
  669        }
  670        
  672        {
  673            string attType = attachment.GetType();
  674            if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
  675            {
  676                return false;
  677            }
  678        }
  679 
  680        return true;
  681    }
  682    
  684    {
  686    }
  687 
  689    {
  690        if (!super.CanDisplayAttachmentCategory(category_name))
  691        {
  692            return false;
  693        }
  694    
  696        if (category_name.
Contains(
"engine"))
 
  697        {
  699            {
  700                return false;
  701            }
  702        }
  703                
  704        return true;
  705    }
  706    
  708    {
  709        if (!super.CanDisplayCargo())
  710        {
  711            return false;
  712        }
  713        
  715        {
  716            return false;
  717        }
  718        
  719        return true;
  720    }
  721 
  723    {
  725        
  726        Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
 
  727        if (!carDoor)
  728        {
  730        }
  731 
  732        switch (slotType)
  733        {
  734            case "NivaDriverDoors":
  735                return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
  736                
  737            case "NivaCoDriverDoors":
  738                return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
  739                
  740            case "NivaHood":
  741                return TranslateAnimationPhaseToCarDoorState("DoorsHood");
  742                
  743            case "NivaTrunk":
  744                return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
  745        }
  746 
  748    }
  749    
  751    {
  753        switch (posIdx)
  754        {
  755            case 0:
  757                    return false;
  758                else if (GetAnimationPhase("SeatDriver") > 0.5)
  759                    return false;
  760    
  761                return true;
  762    
  763            case 1:
  765                    return false;
  766                else if (GetAnimationPhase("SeatCoDriver") > 0.5)
  767                    return false;
  768    
  769                return true;
  770    
  771            case 2:
  773                    return false;
  774                else if (GetAnimationPhase("SeatDriver") <= 0.5)
  775                    return false;
  776    
  777                return true;
  778    
  779            case 3:
  781                    return false;
  782                else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
  783                    return false;
  784    
  785                return true;
  786        }
  787 
  788        return false;
  789    }
  790 
  792    {
  793        switch (posIdx)
  794        {
  795            case 0:
  796            case 2:
  797                return "doors_driver";
  798            case 1:
  799            case 3:
  800                return "doors_codriver";
  801        }
  802        
  803        return super.GetDoorSelectionNameFromSeatPos(posIdx);
  804    }
  805 
  807    {
  808        switch (posIdx)
  809        {
  810            case 0:
  811            case 2:
  812                return "NivaDriverDoors";
  813            case 1:
  814            case 3:
  815                return "NivaCoDriverDoors";
  816        }
  817        
  818        return super.GetDoorInvSlotNameFromSeatPos(posIdx);
  819    }
  820    
  821    
  822    
  824    {
  825        float tempCap = 0.0;
  826 
  827        switch (ctrl)
  828        {
  830            float newValue = 0;
  832            {
  833                newValue += 0.5;
  834            }
  835 
  837            {
  838                newValue += 0.5;
  839            }
  840 
  842            {
  843                newValue += 0.3;
  844            }
  845        
  847            {
  848                newValue -= 0.6;
  849            }
  850 
  852            {
  853                newValue -= 0.2;
  854            }
  855        
  857            {
  858                newValue -= 0.2;
  859            }
  860 
  862        break;
  863        }
  864 
  865        return super.OnSound(ctrl, oldValue);
  866    }
  867 
  869    {
  870        switch (selection)
  871        {
  872        case "doors_driver":
  873            return "DoorsDriver";
  874        case "doors_codriver":
  875            return "DoorsCoDriver";
  876        case "doors_hood":
  877            return "DoorsHood";
  878        case "doors_trunk":
  879            return "DoorsTrunk";
  880        case "seatback_driver":
  881            return "SeatDriver";
  882        case "seatback_codriver":
  883            return "SeatCoDriver";
  884        }
  885 
  886        return "";
  887    }
  888    
  890    {
  891        switch (selection)
  892        {
  893            case "seat_driver":
  894            case "seatback_driver":
  895            case "seat_cargo1":
  896                return "seat_con_1_1";
  897            case "seat_codriver":
  898            case "seatback_codriver":
  899            case "seat_cargo2":
  900                return "seat_con_2_1";
  901        }
  902        
  903        return "";
  904    }
  905 
  907    {
  908        switch (selection)
  909        {
  910            case "seatback_driver":
  911                return 0;
  912            case "seatback_codriver":
  913                return 1;
  914        }
  915 
  916        return -1;
  917    }
  918 
  920    {
  921        return false;
  922    }
  923 
  925    {
  926        return false;
  927    }
  928    
  930    {
  931        if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
  932            return false;
  933        
  934        if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
  935            return false;
  936        
  937        switch (currentSeat)
  938        {
  939            case 0:
  940                return nextSeat == 1;
  941    
  942            case 1:
  943                return nextSeat == 0;
  944    
  945            case 2:
  946                return nextSeat == 3;
  947    
  948            case 3:
  949                return nextSeat == 2;
  950        }
  951        
  952        return false;
  953    }
  954 
  956    {
  957        switch (pCurrentSeat)
  958        {
  959            case 0:
  960                return pDoorsSelection == "DoorsDriver";
  961    
  962            case 1:
  963                return pDoorsSelection == "DoorsCoDriver";
  964    
  965            case 2:
  966                return pDoorsSelection == "DoorsDriver";
  967    
  968            case 3:
  969                return pDoorsSelection == "DoorsCoDriver";
  970        }
  971        
  972        return false;       
  973    }
  974    
  976    {
  977        switch (pDoorSelection)
  978        {
  979            case "DoorsDriver":
  980                return 0;
  981            case "DoorsCoDriver":
  982                return 1;
  983        }
  984 
  985        return -1;
  986    }
  987    
  989    {
  990        super.SetActions();
  991 
  993    }
  994    
  996    {
  997        SpawnUniversalParts();
  998        SpawnAdditionalItems();
  999        FillUpCarFluids();
 1000 
 1001        GetInventory().CreateInInventory("HatchbackWheel");
 1002        GetInventory().CreateInInventory("HatchbackWheel");
 1003        GetInventory().CreateInInventory("HatchbackWheel" );
 1004        GetInventory().CreateInInventory("HatchbackWheel");
 1005 
 1006        GetInventory().CreateInInventory("HatchbackDoors_Driver");
 1007        GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
 1008        GetInventory().CreateInInventory("HatchbackHood");
 1009        GetInventory().CreateInInventory("HatchbackTrunk");
 1010 
 1011        
 1012        GetInventory().CreateInInventory("HatchbackWheel");
 1013        GetInventory().CreateInInventory("HatchbackWheel");
 1014    }
 1015}
 1016 
 1018{
 1020    {
 1021        SpawnUniversalParts();
 1022        SpawnAdditionalItems();
 1023        FillUpCarFluids();
 1024 
 1025        GetInventory().CreateInInventory("HatchbackWheel");
 1026        GetInventory().CreateInInventory("HatchbackWheel");
 1027        GetInventory().CreateInInventory("HatchbackWheel");
 1028        GetInventory().CreateInInventory("HatchbackWheel");
 1029 
 1030        GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
 1031        GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
 1032        GetInventory().CreateInInventory("HatchbackHood_White");
 1033        GetInventory().CreateInInventory("HatchbackTrunk_White");
 1034 
 1035        
 1036        GetInventory().CreateInInventory("HatchbackWheel");
 1037        GetInventory().CreateInInventory("HatchbackWheel");
 1038    }
 1039}
 1040 
 1042{
 1044    {
 1045        SpawnUniversalParts();
 1046        SpawnAdditionalItems();
 1047        FillUpCarFluids();
 1048 
 1049        GetInventory().CreateInInventory("HatchbackWheel");
 1050        GetInventory().CreateInInventory("HatchbackWheel");
 1051        GetInventory().CreateInInventory("HatchbackWheel");
 1052        GetInventory().CreateInInventory("HatchbackWheel");
 1053    
 1054        GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
 1055        GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
 1056        GetInventory().CreateInInventory("HatchbackHood_Blue");
 1057        GetInventory().CreateInInventory("HatchbackTrunk_Blue");
 1058    
 1059        
 1060        GetInventory().CreateInInventory("HatchbackWheel");
 1061        GetInventory().CreateInInventory("HatchbackWheel");
 1062    }
 1063}
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.