Merge pull request #826 from Ignatz-HeMan/experimental

Moved Vehicle Upgrade to DynaMenu
This commit is contained in:
vbawol 2017-08-21 09:07:45 -05:00 committed by GitHub
commit 5741f72d08
9 changed files with 256 additions and 331 deletions

View File

@ -64,6 +64,7 @@ else {
EPOCH_CraftingItem = ""; EPOCH_CraftingItem = "";
}; };
/* Moved to DynaMenu
_config = 'CfgVehicleUpgrades' call EPOCH_returnConfig; _config = 'CfgVehicleUpgrades' call EPOCH_returnConfig;
if (isClass (_config >> _data)) then { if (isClass (_config >> _data)) then {
{ {
@ -80,6 +81,7 @@ if (isClass (_config >> _data)) then {
}; };
} foreach (nearestobjects [player,["Landvehicle","SHIP","AIR","TANK"],10]); } foreach (nearestobjects [player,["Landvehicle","SHIP","AIR","TANK"],10]);
}; };
*/
if !(_button_texts isEqualTo []) then { if !(_button_texts isEqualTo []) then {
_display = ctrlParent (_this select 0); _display = ctrlParent (_this select 0);

View File

@ -1,28 +1,32 @@
if (isnil 'EPOCH_UpgradeVehicle') exitwith { /*
["Upgrade failed - Error",5] call Epoch_message; Author: He-Man / DirtySanchez
};
EPOCH_UpgradeVehicle params ["_data",["_veh",objnull]]; Contributors:
EPOCH_UpgradeVehicle = nil;
Description:
Upgrade Vehicle
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/vehicles/EPOCH_client_upgradeVehicle.sqf
*/
private ["_vehType","_config","_reqMaterials","_crypto","_hasall","_missing","_has","_msg"];
params [["_veh",objnull],["_classUpgrade",""],["_displayname",""],["_mattxt",""]];
Ignatz_VehicleUpgradeArray = [];
if (isnull _veh) exitwith { if (isnull _veh) exitwith {
["Upgrade failed - Vehicle not found",5] call Epoch_message; ["Upgrade failed - Vehicle not found",5] call Epoch_message;
}; };
if (player distance _veh > 12) exitwith {
["Upgrade failed - Vehicle to far away",5] call Epoch_message;
};
if !(local _veh) exitwith {
["Upgrade failed - Go in as Driver first",5] call Epoch_message;
};
if !(crew _veh isequalto []) exitwith {
["Upgrade failed - All passengers must leave the Vehicle",5] call Epoch_message;
};
_vehType = typeOf _veh; _vehType = typeOf _veh;
_config = 'CfgVehicleUpgrades' call EPOCH_returnConfig; _config = 'CfgVehicleUpgrades' call EPOCH_returnConfig;
_classUpgrade = gettext (_config >> _data >> _vehType >> "upgradeToVehicle"); if !(isclass (_config >> _vehType)) exitwith {
_reqMaterials = getArray (_config >> _data >> _vehType >> "ReqMaterials"); ["Vehicle not upgradeable",5] call Epoch_message;
};
_reqMaterials = getArray (_config >> _vehType >> _classUpgrade >> "ReqMaterials");
_crypto = 0; _crypto = 0;
if(_reqMaterials isEqualTo [])exitWith{ if(_reqMaterials isEqualTo [])exitWith{
@ -51,6 +55,19 @@ if (!_hasall) exitwith {
} foreach _missing; } foreach _missing;
[_msg,5] call Epoch_message; [_msg,5] call Epoch_message;
}; };
if !(local _veh) exitwith {
["Upgrade failed - Go in as Driver first",5] call Epoch_message;
};
if !(crew _veh isequalto []) exitwith {
["Upgrade failed - All passengers must leave the Vehicle",5] call Epoch_message;
};
if (player distance _veh > 15) exitwith {
["Upgrade failed - Vehicle to far away",5] call Epoch_message;
};
if (player distance _veh < 4.5) exitwith {
["Upgrade failed - Take a bit distance and try again",5] call Epoch_message;
};
{ {
_x params ["_count","_item"]; _x params ["_count","_item"];
if (_item isequalto "Crypto") then { if (_item isequalto "Crypto") then {
@ -62,4 +79,5 @@ if (!_hasall) exitwith {
}; };
}; };
} forEach _reqMaterials; } forEach _reqMaterials;
[[_veh,_classUpgrade,_crypto],player,Epoch_personalToken] remoteExec ["EPOCH_server_upgrade_vehicle",2]; [[_veh,_classUpgrade,_crypto],player,Epoch_personalToken] remoteExec ["EPOCH_server_upgrade_vehicle",2];

View File

@ -0,0 +1,51 @@
/*
Author: He-Man
Contributors: DirtySanchez
Description:
Upgrade Vehicle Check
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/vehicles/EPOCH_client_upgradeVehicleCheck.sqf
*/
private ["_veh","_vehType","_config","_classUpgrade","_reqMaterials","_mattxt","_displayname"];
_veh = _this;
Ignatz_VehicleUpgradeArray = [];
if (isnull _veh) exitwith {
["Upgrade failed - Vehicle not found",5] call Epoch_message;
};
if (player distance _veh > 12) exitwith {
["Upgrade failed - Vehicle to far away",5] call Epoch_message;
};
_vehType = typeOf _veh;
_config = 'CfgVehicleUpgrades' call EPOCH_returnConfig;
if !(isclass (_config >> _vehType)) exitwith {
["Vehicle not upgradeable",5] call Epoch_message;
};
_classUpgrade = getarray (_config >> _vehType >> "upgradeToVehicle");
if (_classUpgrade isequalto []) exitwith {
["Vehicle not upgradeable",5] call Epoch_message;
};
{
_classUpgrade = _x;
if (_x isequaltype []) then {
_classUpgrade = selectrandom _x;
};
if (isclass (_config >> _vehType >> _classUpgrade)) then {
_reqMaterials = getArray (_config >> _vehType >> _classUpgrade >> "ReqMaterials");
_mattxt = "Needed:";
{
_mattxt = _mattxt + format [' %1 %2,', _x select 0, (_x select 1) call EPOCH_itemDisplayName];
} forEach _reqMaterials;
_displayname = _classUpgrade call EPOCH_itemDisplayName;
Ignatz_VehicleUpgradeArray pushback [_veh,_classUpgrade,_displayname,_mattxt];
};
} foreach _classUpgrade;

View File

@ -1,7 +1,7 @@
/* /*
Author: Raimonds Virtoss - EpochMod.com Author: Raimonds Virtoss - EpochMod.com
Contributors: Contributors: He-Man
Description: Description:
DESC-TBA DESC-TBA
@ -14,7 +14,7 @@
*/ */
disableSerialization; disableSerialization;
//[[[cog import generate_private_arrays ]]] //[[[cog import generate_private_arrays ]]]
private ["_action","_arr","_buttonSettings","_c","_cfg","_checkConfigs","_config","_configs","_dName","_display","_entries","_hasTarget","_icon","_in","_selfOrTarget","_subclasses","_tTip","_tooltip","_tooltipcode","_x"]; private ["_iconcode","_action","_arr","_buttonSettings","_c","_cfg","_checkConfigs","_config","_configs","_dName","_display","_entries","_hasTarget","_icon","_in","_selfOrTarget","_subclasses","_tTip","_tooltip","_tooltipcode","_x"];
//[[[end]]] //[[[end]]]
_in = [_this, 0, "",[""]] call BIS_fnc_param; _in = [_this, 0, "",[""]] call BIS_fnc_param;
@ -118,9 +118,21 @@ _checkConfigs = {
else { else {
_tooltip = getText(_x >> "tooltip"); _tooltip = getText(_x >> "tooltip");
}; };
_icon = "";
_iconcode = getText(_x >> "iconcode");
if (_iconcode != "") then {
_icon = [] call compile _iconcode;
}
else {
_icon = getText(_x >> "icon");
};
if (!(_icon isequaltype "") || _icon isequalto "") then {
_icon = "x\addons\a3_epoch_code\Data\UI\buttons\player_inspect.paa";
};
_buttonSettings pushBack [ _buttonSettings pushBack [
getText(_x >> "icon"), _icon,
_tooltip, _tooltip,
_action _action
]; ];

View File

@ -21,7 +21,7 @@ class CfgActionMenu
dyna_cursorTargetType = "typeOf ([10] call EPOCH_fnc_cursorTarget)"; dyna_cursorTargetType = "typeOf ([10] call EPOCH_fnc_cursorTarget)";
dyna_inVehicle = "vehicle player != player"; dyna_inVehicle = "vehicle player != player";
dyna_itemsPlayer = "items player"; dyna_itemsPlayer = "items player";
dyna_sizeOf = "((sizeOf dyna_cursorTargetType/2) max 5) min 30"; dyna_sizeOf = "((sizeOf dyna_cursorTargetType/2) max 6) min 30";
dyna_distance = "(player distance dyna_cursorTarget) <= dyna_sizeOf"; dyna_distance = "(player distance dyna_cursorTarget) <= dyna_sizeOf";
dyna_buildMode = "([10] call EPOCH_fnc_cursorTarget) call EPOCH_checkBuild;"; dyna_buildMode = "([10] call EPOCH_fnc_cursorTarget) call EPOCH_checkBuild;";

View File

@ -461,4 +461,46 @@ class VehMaintanance
tooltip = "Remove 4th Right Wheel"; tooltip = "Remove 4th Right Wheel";
}; };
}; };
class UpgradeVehicle
{
condition = "dyna_isVehicle";
action = "dyna_cursorTarget call EPOCH_client_upgradeVehicleCheck;";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_upgrade.paa";
tooltip = "Upgrade Vehicle";
class Upgrade0
{
condition = "(count Ignatz_VehicleUpgradeArray) > 0";
action = "(Ignatz_VehicleUpgradeArray select 0) call EPOCH_client_upgradeVehicle";
iconcode = "gettext (configfile >> 'CfgVehicles' >> (Ignatz_VehicleUpgradeArray select 0 select 1) >> 'picture')";
tooltipcode = "format ['Upgrade to %1 - %2',(Ignatz_VehicleUpgradeArray select 0 select 2),(Ignatz_VehicleUpgradeArray select 0 select 3)]";
};
class Upgrade1
{
condition = "(count Ignatz_VehicleUpgradeArray) > 1";
action = "(Ignatz_VehicleUpgradeArray select 1) call EPOCH_client_upgradeVehicle";
iconcode = "gettext (configfile >> 'CfgVehicles' >> (Ignatz_VehicleUpgradeArray select 1 select 1) >> 'picture')";
tooltipcode = "format ['Upgrade to %1 - %2',(Ignatz_VehicleUpgradeArray select 1 select 2),(Ignatz_VehicleUpgradeArray select 1 select 3)]";
};
class Upgrade2
{
condition = "(count Ignatz_VehicleUpgradeArray) > 2";
action = "(Ignatz_VehicleUpgradeArray select 2) call EPOCH_client_upgradeVehicle";
iconcode = "gettext (configfile >> 'CfgVehicles' >> (Ignatz_VehicleUpgradeArray select 2 select 1) >> 'picture')";
tooltipcode = "format ['Upgrade to %1 - %2',(Ignatz_VehicleUpgradeArray select 2 select 2),(Ignatz_VehicleUpgradeArray select 2 select 3)]";
};
class Upgrade3
{
condition = "(count Ignatz_VehicleUpgradeArray) > 3";
action = "(Ignatz_VehicleUpgradeArray select 3) call EPOCH_client_upgradeVehicle";
iconcode = "gettext (configfile >> 'CfgVehicles' >> (Ignatz_VehicleUpgradeArray select 3 select 1) >> 'picture')";
tooltipcode = "format ['Upgrade to %1 - %2',(Ignatz_VehicleUpgradeArray select 3 select 2),(Ignatz_VehicleUpgradeArray select 3 select 3)]";
};
class Upgrade4
{
condition = "(count Ignatz_VehicleUpgradeArray) > 4";
action = "(Ignatz_VehicleUpgradeArray select 4) call EPOCH_client_upgradeVehicle";
iconcode = "gettext (configfile >> 'CfgVehicles' >> (Ignatz_VehicleUpgradeArray select 4 select 1) >> 'picture')";
tooltipcode = "format ['Upgrade to %1 - %2',(Ignatz_VehicleUpgradeArray select 4 select 2),(Ignatz_VehicleUpgradeArray select 4 select 3)]";
};
};
}; };

View File

@ -154,6 +154,7 @@ class CfgClientFunctions
class client_fillVehicle {}; class client_fillVehicle {};
class client_gearVehicle {}; class client_gearVehicle {};
class client_upgradeVehicle {}; class client_upgradeVehicle {};
class client_upgradeVehicleCheck {};
class client_VehicleMaintananceCheck {}; class client_VehicleMaintananceCheck {};
class client_VehicleMaintananceDo {}; class client_VehicleMaintananceDo {};
}; };

View File

@ -1,314 +1,114 @@
/* /*
@author = "Aaron Clark - https://EpochMod.com"; @author = "Aaron Clark - https://EpochMod.com";
@contributors[] = {"DirtySanchez"}; @contributors[] = {"DirtySanchez","He-Man"};
@description = "Vehicle Upgrade configs"; @description = "Vehicle Upgrade configs";
@licence = "Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike"; @licence = "Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike";
@github = "https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_config/Configs/CfgItemInteractions.hpp"; @github = "https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_config/Configs/CfgItemInteractions.hpp";
*/ */
class CfgVehicleUpgrades class CfgVehicleUpgrades
{ {
class ItemVehDoc1 class C_Hatchback_01_EPOCH
{ {
class C_Hatchback_01_EPOCH upgradeToVehicle[] = {"C_Hatchback_01_EPOCH1"};
{ class C_Hatchback_01_EPOCH1
ReqMaterials[] = {{1,"ItemVehDoc1"},{1,"ItemCables"},{1,"CircuitParts"},{2,"VehicleRepairLg"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH1";
};
class C_Hatchback_02_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_Hatchback_02_EPOCH1"; };
class C_Offroad_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_Offroad_01_EPOCH1"; };
class C_SUV_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_SUV_01_EPOCH1"; };
class B_MRAP_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "B_MRAP_01_EPOCH1"; };
class O_MRAP_02_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "O_MRAP_02_EPOCH1"; };
class I_MRAP_03_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "I_MRAP_03_EPOCH1"; };
};
class KitVehicleUpgradeI_100_EPOCH
{
class C_Hatchback_01_EPOCH
{
ReqMaterials[] = {{1,"KitVehicleUpgradeI_100_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH1";
};
class C_Hatchback_02_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_Hatchback_02_EPOCH1"; };
class C_Offroad_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_Offroad_01_EPOCH1"; };
class C_SUV_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_SUV_01_EPOCH1"; };
class B_MRAP_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "B_MRAP_01_EPOCH1"; };
class O_MRAP_02_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "O_MRAP_02_EPOCH1"; };
class I_MRAP_03_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "I_MRAP_03_EPOCH1"; };
};
class KitVehicleUpgradeI_200_EPOCH
{
class C_Hatchback_01_EPOCH
{ {
ReqMaterials[] = {{1,"KitVehicleUpgradeI_200_EPOCH"}}; ReqMaterials[] = {{1,"KitVehicleUpgradeI_200_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH1";
}; };
class C_Hatchback_02_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_Hatchback_02_EPOCH1"; }; class C_Hatchback_02_EPOCH1: C_Hatchback_01_EPOCH1 {};
class C_Offroad_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_Offroad_01_EPOCH1"; }; class C_Offroad_01_EPOCH1: C_Hatchback_01_EPOCH1 {};
class C_SUV_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_SUV_01_EPOCH1"; }; class C_SUV_01_EPOCH1: C_Hatchback_01_EPOCH1 {};
class B_MRAP_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "B_MRAP_01_EPOCH1"; }; class B_MRAP_01_EPOCH1: C_Hatchback_01_EPOCH1 {};
class O_MRAP_02_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "O_MRAP_02_EPOCH1"; }; class O_MRAP_02_EPOCH1: C_Hatchback_01_EPOCH1 {};
class I_MRAP_03_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "I_MRAP_03_EPOCH1"; }; class I_MRAP_03_EPOCH1: C_Hatchback_01_EPOCH1 {};
}; };
class KitVehicleUpgradeI_300_EPOCH class C_Hatchback_02_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle[] = {"C_Hatchback_02_EPOCH1"}; };
class C_Offroad_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle[] = {"C_Offroad_01_EPOCH1"}; };
class C_SUV_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle[] = {"C_SUV_01_EPOCH1"}; };
class B_MRAP_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle[] = {"B_MRAP_01_EPOCH1"}; };
class O_MRAP_02_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle[] = {"O_MRAP_02_EPOCH1"}; };
class I_MRAP_03_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle[] = {"I_MRAP_03_EPOCH1"}; };
class C_Hatchback_01_EPOCH1
{ {
class C_Hatchback_01_EPOCH upgradeToVehicle[] = {"C_Hatchback_01_EPOCH2"};
{ class C_Hatchback_01_EPOCH2
ReqMaterials[] = {{1,"KitVehicleUpgradeI_300_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH1";
};
class C_Hatchback_02_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_Hatchback_02_EPOCH1"; };
class C_Offroad_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_Offroad_01_EPOCH1"; };
class C_SUV_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "C_SUV_01_EPOCH1"; };
class B_MRAP_01_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "B_MRAP_01_EPOCH1"; };
class O_MRAP_02_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "O_MRAP_02_EPOCH1"; };
class I_MRAP_03_EPOCH: C_Hatchback_01_EPOCH { upgradeToVehicle = "I_MRAP_03_EPOCH1"; };
};
class ItemVehDoc2
{
class C_Hatchback_01_EPOCH1
{
ReqMaterials[] = {{1,"ItemVehDoc2"},{2,"SpareTire"},{2,"KitTankTrap"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH2";
};
class C_Hatchback_02_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_Hatchback_02_EPOCH2"; };
class C_Offroad_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_Offroad_01_EPOCH2"; };
class C_SUV_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_SUV_01_EPOCH2"; };
class B_MRAP_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "B_MRAP_01_EPOCH2"; };
class O_MRAP_02_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "O_MRAP_02_EPOCH2"; };
class I_MRAP_03_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "I_MRAP_03_EPOCH2"; };
};
class KitVehicleUpgradeII_100_EPOCH
{
class C_Hatchback_01_EPOCH1
{
ReqMaterials[] = {{1,"KitVehicleUpgradeII_100_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH2";
};
class C_Hatchback_02_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_Hatchback_02_EPOCH2"; };
class C_Offroad_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_Offroad_01_EPOCH2"; };
class C_SUV_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_SUV_01_EPOCH2"; };
class B_MRAP_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "B_MRAP_01_EPOCH2"; };
class O_MRAP_02_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "O_MRAP_02_EPOCH2"; };
class I_MRAP_03_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "I_MRAP_03_EPOCH2"; };
};
class KitVehicleUpgradeII_200_EPOCH
{
class C_Hatchback_01_EPOCH1
{ {
ReqMaterials[] = {{1,"KitVehicleUpgradeII_200_EPOCH"}}; ReqMaterials[] = {{1,"KitVehicleUpgradeII_200_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH2";
}; };
class C_Hatchback_02_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_Hatchback_02_EPOCH2"; }; class C_Hatchback_02_EPOCH2: C_Hatchback_01_EPOCH2 {};
class C_Offroad_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_Offroad_01_EPOCH2"; }; class C_Offroad_01_EPOCH2: C_Hatchback_01_EPOCH2 {};
class C_SUV_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_SUV_01_EPOCH2"; }; class C_SUV_01_EPOCH2: C_Hatchback_01_EPOCH2 {};
class B_MRAP_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "B_MRAP_01_EPOCH2"; }; class B_MRAP_01_EPOCH2: C_Hatchback_01_EPOCH2 {};
class O_MRAP_02_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "O_MRAP_02_EPOCH2"; }; class O_MRAP_02_EPOCH2: C_Hatchback_01_EPOCH2 {};
class I_MRAP_03_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "I_MRAP_03_EPOCH2"; }; class I_MRAP_03_EPOCH2: C_Hatchback_01_EPOCH2 {};
}; };
class KitVehicleUpgradeII_300_EPOCH class C_Hatchback_02_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle[] = {"C_Hatchback_02_EPOCH2"}; };
class C_Offroad_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle[] = {"C_Offroad_01_EPOCH2"}; };
class C_SUV_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle[] = {"C_SUV_01_EPOCH2"}; };
class B_MRAP_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle[] = {"B_MRAP_01_EPOCH2"}; };
class O_MRAP_02_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle[] = {"O_MRAP_02_EPOCH2"}; };
class I_MRAP_03_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle[] = {"I_MRAP_03_EPOCH2"}; };
class C_Hatchback_01_EPOCH2
{ {
class C_Hatchback_01_EPOCH1 upgradeToVehicle[] = {"C_Hatchback_01_EPOCH3"};
{ class C_Hatchback_01_EPOCH3
ReqMaterials[] = {{1,"KitVehicleUpgradeII_300_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH2";
};
class C_Hatchback_02_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_Hatchback_02_EPOCH2"; };
class C_Offroad_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_Offroad_01_EPOCH2"; };
class C_SUV_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "C_SUV_01_EPOCH2"; };
class B_MRAP_01_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "B_MRAP_01_EPOCH2"; };
class O_MRAP_02_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "O_MRAP_02_EPOCH2"; };
class I_MRAP_03_EPOCH1: C_Hatchback_01_EPOCH1 { upgradeToVehicle = "I_MRAP_03_EPOCH2"; };
};
class ItemVehDoc3
{
class C_Hatchback_01_EPOCH2
{
ReqMaterials[] = {{1,"ItemVehDoc3"},{2,"ItemPipe"},{2,"KitShelf"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH3";
};
class C_Hatchback_02_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Hatchback_02_EPOCH3"; };
class C_Offroad_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Offroad_01_EPOCH3"; };
class C_SUV_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_SUV_01_EPOCH3"; };
class B_MRAP_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "B_MRAP_01_EPOCH3"; };
class O_MRAP_02_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "O_MRAP_02_EPOCH3"; };
class I_MRAP_03_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "I_MRAP_03_EPOCH3"; };
class C_Van_01_box_EPOCH: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Van_01_box_EPOCH3"; };
class C_Van_01_transport_EPOCH: C_Hatchback_01_EPOCH2
{
ReqMaterials[] = {{1,"ItemVehDoc3"},{5,"ItemCorrugatedLg"},{8,"ItemPipe"},{4,"KitShelf"}};
upgradeToVehicle = "C_Van_01_transport_EPOCH3";
};
class O_Truck_02_covered_EPOCH: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "O_Truck_02_covered_EPOCH3"; };
class O_Truck_02_transport_EPOCH: C_Hatchback_01_EPOCH2
{
ReqMaterials[] = {{1,"ItemVehDoc3"},{6,"ItemBurlap"},{6,"ItemPipe"},{4,"KitShelf"}};
upgradeToVehicle = "O_Truck_02_transport_EPOCH3";
};
};
class KitVehicleUpgradeIII_100_EPOCH
{
class C_Hatchback_01_EPOCH2
{
ReqMaterials[] = {{1,"KitVehicleUpgradeIII_100_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH3";
};
class C_Hatchback_02_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Hatchback_02_EPOCH3"; };
class C_Offroad_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Offroad_01_EPOCH3"; };
class C_SUV_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_SUV_01_EPOCH3"; };
class B_MRAP_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "B_MRAP_01_EPOCH3"; };
class O_MRAP_02_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "O_MRAP_02_EPOCH3"; };
class I_MRAP_03_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "I_MRAP_03_EPOCH3"; };
class C_Van_01_box_EPOCH: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Van_01_box_EPOCH3"; };
class C_Van_01_transport_EPOCH: C_Hatchback_01_EPOCH2
{
ReqMaterials[] = {{1,"KitVehicleUpgradeIII_100_EPOCH"},{5,"ItemCorrugatedLg"},{6,"ItemPipe"},{2,"KitShelf"}};
upgradeToVehicle = "C_Van_01_transport_EPOCH3";
};
class O_Truck_02_covered_EPOCH: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "O_Truck_02_covered_EPOCH3"; };
class O_Truck_02_transport_EPOCH: C_Hatchback_01_EPOCH2
{
ReqMaterials[] = {{1,"KitVehicleUpgradeIII_100_EPOCH"},{6,"ItemBurlap"},{4,"ItemPipe"},{2,"KitShelf"}};
upgradeToVehicle = "O_Truck_02_transport_EPOCH3";
};
};
class KitVehicleUpgradeIII_200_EPOCH
{
class C_Hatchback_01_EPOCH2
{ {
ReqMaterials[] = {{1,"KitVehicleUpgradeIII_200_EPOCH"}}; ReqMaterials[] = {{1,"KitVehicleUpgradeIII_200_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH3";
};
class C_Hatchback_02_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Hatchback_02_EPOCH3"; };
class C_Offroad_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Offroad_01_EPOCH3"; };
class C_SUV_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_SUV_01_EPOCH3"; };
class B_MRAP_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "B_MRAP_01_EPOCH3"; };
class O_MRAP_02_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "O_MRAP_02_EPOCH3"; };
class I_MRAP_03_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "I_MRAP_03_EPOCH3"; };
class C_Van_01_box_EPOCH: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Van_01_box_EPOCH3"; };
class C_Van_01_transport_EPOCH: C_Hatchback_01_EPOCH2
{
ReqMaterials[] = {{1,"KitVehicleUpgradeIII_200_EPOCH"},{5,"ItemCorrugatedLg"},{6,"ItemPipe"},{2,"KitShelf"}};
upgradeToVehicle = "C_Van_01_transport_EPOCH3";
};
class O_Truck_02_covered_EPOCH: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "O_Truck_02_covered_EPOCH3"; };
class O_Truck_02_transport_EPOCH: C_Hatchback_01_EPOCH2
{
ReqMaterials[] = {{1,"KitVehicleUpgradeIII_100_EPOCH"},{6,"ItemBurlap"},{4,"ItemPipe"},{2,"KitShelf"}};
upgradeToVehicle = "O_Truck_02_transport_EPOCH3";
}; };
class C_Hatchback_02_EPOCH3: C_Hatchback_01_EPOCH3 {};
class C_Offroad_01_EPOCH3: C_Hatchback_01_EPOCH3 {};
class C_SUV_01_EPOCH3: C_Hatchback_01_EPOCH3 {};
class B_MRAP_01_EPOCH3: C_Hatchback_01_EPOCH3 {};
class O_MRAP_02_EPOCH3: C_Hatchback_01_EPOCH3 {};
class I_MRAP_03_EPOCH3: C_Hatchback_01_EPOCH3 {};
}; };
class KitVehicleUpgradeIII_300_EPOCH class C_Hatchback_02_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle[] = {"C_Hatchback_02_EPOCH3"}; };
class C_Offroad_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle[] = {"C_Offroad_01_EPOCH3"}; };
class C_SUV_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle[] = {"C_SUV_01_EPOCH3"}; };
class B_MRAP_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle[] = {"B_MRAP_01_EPOCH3"}; };
class O_MRAP_02_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle[] = {"O_MRAP_02_EPOCH3"}; };
class I_MRAP_03_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle[] = {"I_MRAP_03_EPOCH3"}; };
class C_Hatchback_01_EPOCH3
{ {
class C_Hatchback_01_EPOCH2 upgradeToVehicle[] = {"C_Hatchback_01_EPOCH4"};
{ class C_Hatchback_01_EPOCH4
ReqMaterials[] = {{1,"KitVehicleUpgradeIII_300_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH3";
};
class C_Hatchback_02_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Hatchback_02_EPOCH3"; };
class C_Offroad_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Offroad_01_EPOCH3"; };
class C_SUV_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_SUV_01_EPOCH3"; };
class B_MRAP_01_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "B_MRAP_01_EPOCH3"; };
class O_MRAP_02_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "O_MRAP_02_EPOCH3"; };
class I_MRAP_03_EPOCH2: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "I_MRAP_03_EPOCH3"; };
class C_Van_01_box_EPOCH: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "C_Van_01_box_EPOCH3"; };
class C_Van_01_transport_EPOCH: C_Hatchback_01_EPOCH2
{
ReqMaterials[] = {{1,"KitVehicleUpgradeIII_300_EPOCH"},{5,"ItemCorrugatedLg"},{6,"ItemPipe"},{2,"KitShelf"}};
upgradeToVehicle = "C_Van_01_transport_EPOCH3";
};
class O_Truck_02_covered_EPOCH: C_Hatchback_01_EPOCH2 { upgradeToVehicle = "O_Truck_02_covered_EPOCH3"; };
class O_Truck_02_transport_EPOCH: C_Hatchback_01_EPOCH2
{
ReqMaterials[] = {{1,"KitVehicleUpgradeIII_100_EPOCH"},{6,"ItemBurlap"},{4,"ItemPipe"},{2,"KitShelf"}};
upgradeToVehicle = "O_Truck_02_transport_EPOCH3";
};
};
class ItemVehDoc4
{
class C_Hatchback_01_EPOCH3
{
ReqMaterials[] = {{1,"ItemVehDoc3"},{1,"CircuitParts"},{2,"ItemScraps"},{2,"jerrycan_epoch"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH4";
};
class C_Hatchback_02_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Hatchback_02_EPOCH4"; };
class C_Offroad_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Offroad_01_EPOCH4"; };
class C_SUV_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_SUV_01_EPOCH4"; };
class B_MRAP_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "B_MRAP_01_EPOCH4"; };
class O_MRAP_02_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_MRAP_02_EPOCH4"; };
class I_MRAP_03_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "I_MRAP_03_EPOCH4"; };
class C_Van_01_box_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Van_01_box_EPOCH4"; };
class C_Van_01_transport_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Van_01_transport_EPOCH4"; };
class O_Truck_02_covered_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_Truck_02_covered_EPOCH4"; };
class O_Truck_02_transport_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_Truck_02_transport_EPOCH4"; };
};
class KitVehicleUpgradeIV_100_EPOCH
{
class C_Hatchback_01_EPOCH3
{
ReqMaterials[] = {{1,"KitVehicleUpgradeIV_100_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH4";
};
class C_Hatchback_02_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Hatchback_02_EPOCH4"; };
class C_Offroad_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Offroad_01_EPOCH4"; };
class C_SUV_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_SUV_01_EPOCH4"; };
class B_MRAP_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "B_MRAP_01_EPOCH4"; };
class O_MRAP_02_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_MRAP_02_EPOCH4"; };
class I_MRAP_03_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "I_MRAP_03_EPOCH4"; };
class C_Van_01_box_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Van_01_box_EPOCH4"; };
class C_Van_01_transport_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Van_01_transport_EPOCH4"; };
class O_Truck_02_covered_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_Truck_02_covered_EPOCH4"; };
class O_Truck_02_transport_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_Truck_02_transport_EPOCH4"; };
};
class KitVehicleUpgradeIV_200_EPOCH
{
class C_Hatchback_01_EPOCH3
{ {
ReqMaterials[] = {{1,"KitVehicleUpgradeIV_200_EPOCH"}}; ReqMaterials[] = {{1,"KitVehicleUpgradeIV_200_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH4";
}; };
class C_Hatchback_02_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Hatchback_02_EPOCH4"; }; class C_Hatchback_02_EPOCH4: C_Hatchback_01_EPOCH4 {};
class C_Offroad_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Offroad_01_EPOCH4"; }; class C_Offroad_01_EPOCH4: C_Hatchback_01_EPOCH4 {};
class C_SUV_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_SUV_01_EPOCH4"; }; class C_SUV_01_EPOCH4: C_Hatchback_01_EPOCH4 {};
class B_MRAP_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "B_MRAP_01_EPOCH4"; }; class B_MRAP_01_EPOCH4: C_Hatchback_01_EPOCH4 {};
class O_MRAP_02_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_MRAP_02_EPOCH4"; }; class O_MRAP_02_EPOCH4: C_Hatchback_01_EPOCH4 {};
class I_MRAP_03_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "I_MRAP_03_EPOCH4"; }; class I_MRAP_03_EPOCH4: C_Hatchback_01_EPOCH4 {};
class C_Van_01_box_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Van_01_box_EPOCH4"; };
class C_Van_01_transport_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Van_01_transport_EPOCH4"; };
class O_Truck_02_covered_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_Truck_02_covered_EPOCH4"; };
class O_Truck_02_transport_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_Truck_02_transport_EPOCH4"; };
}; };
class KitVehicleUpgradeIV_300_EPOCH class C_Hatchback_02_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle[] = {"C_Hatchback_02_EPOCH4"}; };
class C_Offroad_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle[] = {"C_Offroad_01_EPOCH4"}; };
class C_SUV_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle[] = {"C_SUV_01_EPOCH4"}; };
class B_MRAP_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle[] = {"B_MRAP_01_EPOCH4"}; };
class O_MRAP_02_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle[] = {"O_MRAP_02_EPOCH4"}; };
class I_MRAP_03_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle[] = {"I_MRAP_03_EPOCH4"}; };
class K01
{ {
class C_Hatchback_01_EPOCH3 upgradeToVehicle[] = {"mosquito_epoch"};
{ class mosquito_epoch
ReqMaterials[] = {{1,"KitVehicleUpgradeIV_300_EPOCH"}};
upgradeToVehicle = "C_Hatchback_01_EPOCH4";
};
class C_Hatchback_02_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Hatchback_02_EPOCH4"; };
class C_Offroad_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Offroad_01_EPOCH4"; };
class C_SUV_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_SUV_01_EPOCH4"; };
class B_MRAP_01_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "B_MRAP_01_EPOCH4"; };
class O_MRAP_02_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_MRAP_02_EPOCH4"; };
class I_MRAP_03_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "I_MRAP_03_EPOCH4"; };
class C_Van_01_box_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Van_01_box_EPOCH4"; };
class C_Van_01_transport_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "C_Van_01_transport_EPOCH4"; };
class O_Truck_02_covered_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_Truck_02_covered_EPOCH4"; };
class O_Truck_02_transport_EPOCH3: C_Hatchback_01_EPOCH3 { upgradeToVehicle = "O_Truck_02_transport_EPOCH4"; };
};
class ItemVehDocRara
{
class K01
{ {
ReqMaterials[] = {{1,"ItemVehDocRara"},{2,"PaintCanOra"},{4,"ItemPipe"},{2,"jerrycan_epoch"}}; ReqMaterials[] = {{1,"ItemVehDocRara"},{2,"PaintCanOra"},{4,"ItemPipe"},{2,"jerrycan_epoch"}};
upgradeToVehicle = "mosquito_epoch";
}; };
class K02: K01{};
class K03: K01{};
class K04: K01{};
}; };
class K02: K01 {};
class K03: K01 {};
class K04: K01 {};
class C_Offroad_01_EPOCH4 class C_Offroad_01_EPOCH4
{ {
ReqMaterials[] = {{1,"ItemVehDocRara"},{1,"PaintCanBlu"},{1,"PaintCanRed"},{1,"CircuitParts"},{1,"ItemBattery"}}; upgradeToVehicle[] = {"C_Offroad_01_EPOCH5"};
upgradeToVehicle = "C_Offroad_01_EPOCH5"; class C_Offroad_01_EPOCH5
{
ReqMaterials[] = {{1,"ItemVehDocRara"},{1,"PaintCanBlu"},{1,"PaintCanRed"},{1,"CircuitParts"},{1,"ItemBattery"}};
};
}; };
}; };

View File

@ -9,6 +9,8 @@
Licence: Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
*/ */
private ["_slot","_pos","_dir","_cargo","_damage","_OldHitPoints","_typeVeh","_baseVeh","_color","_fuel","_newVeh","_checkclass","_cfgEpochVehicles","_availableColorsConfig","_colors","_textureSelectionIndex","_selections","_textures","_count","_newHitpoints","_idx","_dmg"];
params [["_array",[]],["_player",objnull],["_token","",[""]]]; params [["_array",[]],["_player",objnull],["_token","",[""]]];
if (_array isequalto []) exitwith { if (_array isequalto []) exitwith {
diag_log "Array is empty"; diag_log "Array is empty";
@ -35,22 +37,17 @@ _pos = getposasl _veh;
_dir = getdir _veh; _dir = getdir _veh;
_cargo = _veh call EPOCH_server_CargoSave; _cargo = _veh call EPOCH_server_CargoSave;
_damage = damage _veh; _damage = damage _veh;
_hitPoints = getAllHitPointsDamage _veh; _OldHitPoints = getAllHitPointsDamage _veh;
_baseVeh = _veh getVariable ["VEHICLE_BASECLASS",""];
_typeVeh = typeOf _veh; _typeVeh = typeOf _veh;
_colorVeh = _veh getVariable ["VEHICLE_TEXTURE",""]; _baseVeh = _veh getVariable ["VEHICLE_BASECLASS",_typeVeh];
_color = _veh getVariable ["VEHICLE_TEXTURE",""];
_fuel = fuel _veh; _fuel = fuel _veh;
deletevehicle _veh; deletevehicle _veh;
waituntil {isnull _veh}; waituntil {isnull _veh};
_pos set [2,(_pos select 2)+0.5]; _pos set [2,(_pos select 2)+0.5];
_newVeh = createVehicle [_UpgradeVeh, [random 500, random 500,500], [], 0, "CAN_COLLIDE"]; _newVeh = createVehicle [_UpgradeVeh, [random 500, random 500,500], [], 0, "CAN_COLLIDE"];
_newVeh setVariable ["VEHICLE_SLOT", _slot, true]; _newVeh setVariable ["VEHICLE_SLOT", _slot, true];
if!(_baseVeh isEqualTo "")then _newVeh setVariable ["VEHICLE_BASECLASS", _baseVeh];
{
_newVeh setVariable["VEHICLE_BASECLASS", _baseVeh];
}else{
_newVeh setVariable["VEHICLE_BASECLASS", _typeVeh];
};
_newVeh call EPOCH_server_setVToken; _newVeh call EPOCH_server_setVToken;
_newVeh call EPOCH_server_vehicleInit; _newVeh call EPOCH_server_vehicleInit;
_newVeh setdir _dir; _newVeh setdir _dir;
@ -60,23 +57,28 @@ _newVeh setposasl _pos;
_newVeh setFuel _fuel; _newVeh setFuel _fuel;
// apply persistent textures // apply persistent textures
_checkclass = _typeVeh;
if !(_newVeh iskindof _typeVeh) then {
_checkclass = _UpgradeVeh;
};
_cfgEpochVehicles = 'CfgEpochVehicles' call EPOCH_returnConfig; _cfgEpochVehicles = 'CfgEpochVehicles' call EPOCH_returnConfig;
_newbaseVeh = _veh getVariable ["VEHICLE_BASECLASS",""]; _availableColorsConfig = (_cfgEpochVehicles >> _checkclass >> "availableColors");
_availableColorsConfig = (_cfgEpochVehicles >> _newbaseVeh >> "availableColors"); if (isArray(_availableColorsConfig)) then{
if (isArray(_availableColorsConfig)) then { _colors = getArray (_availableColorsConfig);
_color = _colorVeh; _textureSelectionIndex = (_cfgEpochVehicles >> _checkclass >> "textureSelectionIndex");
_colors = getArray(_availableColorsConfig); _selections = if (isArray(_textureSelectionIndex)) then{ getArray(_textureSelectionIndex) } else { [0] };
_textureSelectionIndex = (_cfgEpochVehicles >> _newbaseVeh >> "textureSelectionIndex"); _textures = _colors select 0;
_selections = if (isArray(_textureSelectionIndex)) then { getArray(_textureSelectionIndex) } else { [0] }; if (!(_newVeh iskindof _typeVeh) || _color isequalto "") then {
_color = floor(random(count _textures));
};
_count = (count _colors) - 1; _count = (count _colors) - 1;
{ {
_textures = _colors select 0; if (_count >= _forEachIndex) then{
if (_count >= _forEachIndex) then {
_textures = _colors select _forEachIndex; _textures = _colors select _forEachIndex;
}; };
_newVeh setObjectTextureGlobal [_x, _textures select _color]; _newVeh setObjectTextureGlobal[_x, (_textures select _color)];
} forEach _selections; } forEach _selections;
_newVeh setVariable ["VEHICLE_TEXTURE", _color]; _newVeh setVariable["VEHICLE_TEXTURE", _color];
}; };
// disable thermal imaging equipment // disable thermal imaging equipment
@ -84,19 +86,17 @@ _newVeh disableTIEquipment true;
// set damage and hitpoints // set damage and hitpoints
_newVeh setDamage _damage; _newVeh setDamage _damage;
_allHitpoints = getAllHitPointsDamage _newVeh; _newHitpoints = getAllHitPointsDamage _newVeh;
if !(_allHitpoints isEqualTo []) then{ {
_actualHitpoints = _allHitpoints select 0; _idx = (_newHitpoints select 0) find _x;
if ((count _actualHitpoints) == (count _hitpoints)) then{ if (_idx > -1) then {
{ _dmg = _OldHitPoints select 2 select _foreachindex;
_dmg = _hitpoints param [_forEachIndex,0]; if (_x in ["HitFuel", "HitEngine"]) then {
if (_x in ["HitFuel", "HitEngine"]) then { _dmg = _dmg min 0.9;
_dmg = _dmg min 0.9; };
}; _newVeh setHitPointDamage [_x, _dmg];
_newVeh setHitIndex [_forEachIndex, _dmg];
} forEach _actualHitpoints;
}; };
}; } foreach (_OldHitPoints select 0);
// new Dynamicsimulation // new Dynamicsimulation
if(["CfgDynamicSimulation", "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then if(["CfgDynamicSimulation", "vehicleDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntryV2)then
@ -105,7 +105,6 @@ if(["CfgDynamicSimulation", "vehicleDynamicSimulationSystem", true] call EPOCH_f
_newveh enableDynamicSimulation true; _newveh enableDynamicSimulation true;
}; };
// add back old inventory // add back old inventory
clearWeaponCargoGlobal _newveh; clearWeaponCargoGlobal _newveh;
clearMagazineCargoGlobal _newveh; clearMagazineCargoGlobal _newveh;