853{
  857 
  859    {
  860        
  861    
  862        m_EngineStartOK         = "offroad_engine_start_SoundSet";
  863        m_EngineStartBattery    = "offroad_engine_failed_start_battery_SoundSet";
  864        m_EngineStartPlug       = "offroad_engine_failed_start_sparkplugs_SoundSet";
  865        m_EngineStartFuel       = "offroad_engine_failed_start_fuel_SoundSet";
  866        m_EngineStop            = "offroad_engine_stop_SoundSet";
  867        m_EngineStopFuel        = "offroad_engine_stop_fuel_SoundSet";
  868        
  869        m_CarDoorOpenSound      = "offroad_door_open_SoundSet";
  870        m_CarDoorCloseSound     = "offroad_door_close_SoundSet";
  871        m_CarSeatShiftInSound   = "Offroad_SeatShiftIn_SoundSet";
  872        m_CarSeatShiftOutSound  = "Offroad_SeatShiftOut_SoundSet";
  873        
  874        m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
  875        m_CarHornLongSoundName  = "Offroad_Horn_SoundSet";
  876        
  877        SetEnginePos("0 0.7 1.2");
  878    }
  879    
  881    {       
  882        super.EEInit();
  883        
  885        {
  892            
  895        }       
  896    }
  897    
  899    {
  900        super.OnEngineStart();
  901 
  903        {
  905        }
  906    }
  907    
  909    {
  910        super.OnEngineStop();
  911 
  913        {
  915        }
  916    }
  917    
  919    {
  921        {
  923            {
  925            }
  926        }
  927    }
  928    
  930    {
  932    }
  933    
  935    {
  936        return 3.5;
  937    }
  938 
  940    {
  941        switch (posIdx)
  942        {
  943        case 0:
  945        case 1:
  947        case 2:
  949        case 3:
  951        }
  952 
  953        return 0;
  954 
  955    }
  956    
  957    
  959    {
  961    }
  962    
  964    {
  966    }
  967 
  969    {
  970        if (!super.CanReleaseAttachment(attachment))
  971        {
  972            return false;
  973        }
  974        
  976        {
  977            string attType = attachment.GetType();
  978            if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
  979            {
  980                return false;
  981            }
  982        }
  983 
  984        return true;
  985    }
  986    
  988    {
  990    }
  991 
  993    {
  994        if (!super.CanDisplayAttachmentCategory(category_name))
  995        {
  996            return false;
  997        }
  998    
 1000        if (category_name.
Contains(
"engine"))
 
 1001        {
 1003            {
 1004                return false;
 1005            }
 1006        }
 1007                
 1008        return true;
 1009    }
 1010    
 1012    {
 1013        if (!super.CanDisplayCargo())
 1014        {
 1015            return false;
 1016        }
 1017        
 1019        {
 1020            return false;
 1021        }
 1022        
 1023        return true;
 1024    }
 1025 
 1027    {
 1029        
 1030        Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
 
 1031        if (!carDoor)
 1032        {
 1034        }
 1035 
 1036        switch (slotType)
 1037        {
 1038            case "NivaDriverDoors":
 1039                return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
 1040                
 1041            case "NivaCoDriverDoors":
 1042                return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
 1043                
 1044            case "NivaHood":
 1045                return TranslateAnimationPhaseToCarDoorState("DoorsHood");
 1046                
 1047            case "NivaTrunk":
 1048                return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
 1049        }
 1050 
 1052    }
 1053    
 1055    {
 1057        switch (posIdx)
 1058        {
 1059            case 0:
 1061                    return false;
 1062                else if (GetAnimationPhase("SeatDriver") > 0.5)
 1063                    return false;
 1064    
 1065                return true;
 1066    
 1067            case 1:
 1069                    return false;
 1070                else if (GetAnimationPhase("SeatCoDriver") > 0.5)
 1071                    return false;
 1072    
 1073                return true;
 1074    
 1075            case 2:
 1077                    return false;
 1078                else if (GetAnimationPhase("SeatDriver") <= 0.5)
 1079                    return false;
 1080    
 1081                return true;
 1082    
 1083            case 3:
 1085                    return false;
 1086                else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
 1087                    return false;
 1088    
 1089                return true;
 1090        }
 1091 
 1092        return false;
 1093    }
 1094 
 1096    {
 1097        switch (posIdx)
 1098        {
 1099            case 0:
 1100            case 2:
 1101                return "doors_driver";
 1102            case 1:
 1103            case 3:
 1104                return "doors_codriver";
 1105        }
 1106        
 1107        return super.GetDoorSelectionNameFromSeatPos(posIdx);
 1108    }
 1109 
 1111    {
 1112        switch (posIdx)
 1113        {
 1114            case 0:
 1115            case 2:
 1116                return "NivaDriverDoors";
 1117            case 1:
 1118            case 3:
 1119                return "NivaCoDriverDoors";
 1120        }
 1121        
 1122        return super.GetDoorInvSlotNameFromSeatPos(posIdx);
 1123    }
 1124    
 1125    
 1126    
 1128    {
 1129        float tempCap = 0.0;
 1130 
 1131        switch (ctrl)
 1132        {
 1134            float newValue = 0;
 1136            {
 1137                newValue += 0.5;
 1138            }
 1139 
 1141            {
 1142                newValue += 0.5;
 1143            }
 1144 
 1146            {
 1147                newValue += 0.3;
 1148            }
 1149        
 1151            {
 1152                newValue -= 0.6;
 1153            }
 1154 
 1156            {
 1157                newValue -= 0.2;
 1158            }
 1159        
 1161            {
 1162                newValue -= 0.2;
 1163            }
 1164 
 1166        break;
 1167        }
 1168 
 1169        return super.OnSound(ctrl, oldValue);
 1170    }
 1171 
 1173    {
 1174        switch (selection)
 1175        {
 1176        case "doors_driver":
 1177            return "DoorsDriver";
 1178        case "doors_codriver":
 1179            return "DoorsCoDriver";
 1180        case "doors_hood":
 1181            return "DoorsHood";
 1182        case "doors_trunk":
 1183            return "DoorsTrunk";
 1184        case "seatback_driver":
 1185            return "SeatDriver";
 1186        case "seatback_codriver":
 1187            return "SeatCoDriver";
 1188        }
 1189 
 1190        return "";
 1191    }
 1192    
 1194    {
 1195        switch (selection)
 1196        {
 1197            case "seat_driver":
 1198            case "seatback_driver":
 1199            case "seat_cargo1":
 1200                return "seat_con_1_1";
 1201            case "seat_codriver":
 1202            case "seatback_codriver":
 1203            case "seat_cargo2":
 1204                return "seat_con_2_1";
 1205        }
 1206        
 1207        return "";
 1208    }
 1209 
 1211    {
 1212        switch (selection)
 1213        {
 1214            case "seatback_driver":
 1215                return 0;
 1216            case "seatback_codriver":
 1217                return 1;
 1218        }
 1219 
 1220        return -1;
 1221    }
 1222 
 1224    {
 1225        return false;
 1226    }
 1227 
 1229    {
 1230        return false;
 1231    }
 1232    
 1234    {
 1235        if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
 1236            return false;
 1237        
 1238        if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
 1239            return false;
 1240        
 1241        switch (currentSeat)
 1242        {
 1243            case 0:
 1244                return nextSeat == 1;
 1245    
 1246            case 1:
 1247                return nextSeat == 0;
 1248    
 1249            case 2:
 1250                return nextSeat == 3;
 1251    
 1252            case 3:
 1253                return nextSeat == 2;
 1254        }
 1255        
 1256        return false;
 1257    }
 1258 
 1260    {
 1261        switch (pCurrentSeat)
 1262        {
 1263            case 0:
 1264                return pDoorsSelection == "DoorsDriver";
 1265    
 1266            case 1:
 1267                return pDoorsSelection == "DoorsCoDriver";
 1268    
 1269            case 2:
 1270                return pDoorsSelection == "DoorsDriver";
 1271    
 1272            case 3:
 1273                return pDoorsSelection == "DoorsCoDriver";
 1274        }
 1275        
 1276        return false;       
 1277    }
 1278    
 1280    {
 1281        switch (pDoorSelection)
 1282        {
 1283            case "DoorsDriver":
 1284                return 0;
 1285            case "DoorsCoDriver":
 1286                return 1;
 1287        }
 1288 
 1289        return -1;
 1290    }
 1291    
 1293    {
 1294        super.SetActions();
 1295 
 1297    }
 1298    
 1300    {
 1301        SpawnUniversalParts();
 1302        SpawnAdditionalItems();
 1303        FillUpCarFluids();
 1304 
 1305        GetInventory().CreateInInventory("HatchbackWheel");
 1306        GetInventory().CreateInInventory("HatchbackWheel");
 1307        GetInventory().CreateInInventory("HatchbackWheel" );
 1308        GetInventory().CreateInInventory("HatchbackWheel");
 1309 
 1310        GetInventory().CreateInInventory("HatchbackDoors_Driver");
 1311        GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
 1312        GetInventory().CreateInInventory("HatchbackHood");
 1313        GetInventory().CreateInInventory("HatchbackTrunk");
 1314 
 1315        
 1316        GetInventory().CreateInInventory("HatchbackWheel");
 1317        GetInventory().CreateInInventory("HatchbackWheel");
 1318    }
 1319}
 1320 
 1322{
 1324    {
 1325        SpawnUniversalParts();
 1326        SpawnAdditionalItems();
 1327        FillUpCarFluids();
 1328 
 1329        GetInventory().CreateInInventory("HatchbackWheel");
 1330        GetInventory().CreateInInventory("HatchbackWheel");
 1331        GetInventory().CreateInInventory("HatchbackWheel");
 1332        GetInventory().CreateInInventory("HatchbackWheel");
 1333 
 1334        GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
 1335        GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
 1336        GetInventory().CreateInInventory("HatchbackHood_White");
 1337        GetInventory().CreateInInventory("HatchbackTrunk_White");
 1338 
 1339        
 1340        GetInventory().CreateInInventory("HatchbackWheel");
 1341        GetInventory().CreateInInventory("HatchbackWheel");
 1342    }
 1343}
 1344 
 1346{
 1348    {
 1349        SpawnUniversalParts();
 1350        SpawnAdditionalItems();
 1351        FillUpCarFluids();
 1352 
 1353        GetInventory().CreateInInventory("HatchbackWheel");
 1354        GetInventory().CreateInInventory("HatchbackWheel");
 1355        GetInventory().CreateInInventory("HatchbackWheel");
 1356        GetInventory().CreateInInventory("HatchbackWheel");
 1357    
 1358        GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
 1359        GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
 1360        GetInventory().CreateInInventory("HatchbackHood_Blue");
 1361        GetInventory().CreateInInventory("HatchbackTrunk_Blue");
 1362    
 1363        
 1364        GetInventory().CreateInInventory("HatchbackWheel");
 1365        GetInventory().CreateInInventory("HatchbackWheel");
 1366    }
 1367}
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.