2017-08-05 01:32:07 +00:00
|
|
|
/*
|
|
|
|
Class Name Extraction Tool
|
|
|
|
By GhostriderDbD
|
|
|
|
For Arma 3
|
|
|
|
|
|
|
|
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
|
|
|
|
|
|
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
|
|
|
*/
|
2017-09-25 09:40:17 +00:00
|
|
|
|
2017-10-04 22:35:36 +00:00
|
|
|
_excludedVehicles = [];
|
|
|
|
_baseClasses = [];
|
|
|
|
#include "ExcludedClassNames\excludedVehicles.sqf"
|
2017-08-05 01:32:07 +00:00
|
|
|
_veh = (configfile >> "CfgVehicles") call BIS_fnc_getCfgSubClasses;
|
2017-09-25 09:40:17 +00:00
|
|
|
_veh sort true;
|
2017-08-05 01:32:07 +00:00
|
|
|
_index = 0;
|
|
|
|
_cars = [];
|
2017-09-25 09:40:17 +00:00
|
|
|
_tanks = [];
|
2017-08-05 01:32:07 +00:00
|
|
|
_boats = [];
|
|
|
|
_air = [];
|
2017-09-25 09:40:17 +00:00
|
|
|
_helis = [];
|
|
|
|
_planes = [];
|
2017-10-19 02:12:47 +00:00
|
|
|
processVehicle = true;
|
2017-10-04 22:35:36 +00:00
|
|
|
_n = count _veh;
|
|
|
|
_index = 0;
|
|
|
|
_counter = 1;
|
|
|
|
_interval = 25;
|
|
|
|
systemChat "Classname Extraction tool for vehicles initialized";
|
2017-08-05 01:32:07 +00:00
|
|
|
{
|
2017-10-19 02:12:47 +00:00
|
|
|
processVehicle = true;
|
2017-10-04 22:35:36 +00:00
|
|
|
if (GRG_Root isEqualTo "") then
|
|
|
|
{
|
2017-10-19 02:12:47 +00:00
|
|
|
processVehicle = true;
|
|
|
|
};
|
|
|
|
if (count GRG_Root > 0) then
|
|
|
|
{
|
2017-10-04 22:35:36 +00:00
|
|
|
_leftSTR = [toLower _x,count GRG_Root] call KRON_StrLeft;
|
2017-10-19 02:12:47 +00:00
|
|
|
processVehicle = ((toLower GRG_Root) isEqualTo _leftSTR);
|
|
|
|
_msg = format["vehicles.sqf:: _leftSTR = %1 and processVehicle = %2",_leftSTR, processVehicle];
|
|
|
|
//systemChat _msg;
|
|
|
|
diag_log _msg;
|
|
|
|
};
|
|
|
|
if (processVehicle) then
|
|
|
|
{
|
|
|
|
if (GRG_addIttemsMissingFromPricelistOnly) then
|
|
|
|
{
|
|
|
|
if(GRG_mod isEqualTo "Exile") then
|
|
|
|
{
|
|
|
|
if (isNumber (missionConfigFile >> "CfgExileArsenal" >> _x >> "price")) then
|
|
|
|
{
|
|
|
|
diag_log format["price for item %1 = %2 tabs",_x,getNumber(missionConfigFile >> "CfgExileArsenal" >> _x >> "price")];
|
|
|
|
processVehicle = false; // Item already listed and assumed to be included in both trader lists and price lists
|
|
|
|
diag_log format["Item %1 already has a price: Not processing item %1",_x];
|
|
|
|
} else {
|
|
|
|
diag_log format["price for item %1 = %2 tabs",_x,getNumber(missionConfigFile >> "CfgExileArsenal" >> _x >> "price")];
|
|
|
|
diag_log format["Item %1 has no price: processing item %1",_x];
|
|
|
|
processVehicle = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (GRG_mod isEqualTo "Epoch") then
|
|
|
|
{
|
|
|
|
if (isNumber (missionConfigFile >> "CfgPricing" >> _x >> "price")) then
|
|
|
|
{
|
|
|
|
processVehicle = false; // Item already listed and assumed to be included in both trader lists and price lists
|
|
|
|
|
|
|
|
} else {
|
|
|
|
processVehicle = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2017-10-04 22:35:36 +00:00
|
|
|
};
|
|
|
|
if ([toLower _x,"base"] call KRON_StrInStr || [toLower _x,"abstract"] call KRON_StrInStr) then
|
2017-08-05 01:32:07 +00:00
|
|
|
{
|
2017-10-04 22:35:36 +00:00
|
|
|
if !(_x in _baseClasses) then {_baseClasses pushBack _x};
|
2017-10-19 02:12:47 +00:00
|
|
|
processVehicle = false;
|
2017-10-04 22:35:36 +00:00
|
|
|
_msg = format["base class %1 ignored",_x];
|
|
|
|
systemChat _msg;
|
|
|
|
//diag_log _msg;
|
|
|
|
};
|
2017-10-19 02:12:47 +00:00
|
|
|
if (processVehicle && !(_x in _excludedVehicles)) then
|
2017-10-04 22:35:36 +00:00
|
|
|
{
|
|
|
|
if (_index == 1) then
|
|
|
|
{
|
|
|
|
_msg = format["Classname: %1 %2 out of %3",_x, _counter, _n];
|
|
|
|
systemChat _msg;
|
|
|
|
//diag_log _msg;
|
|
|
|
};
|
|
|
|
if (_index == _interval) then {_index = 0};
|
|
|
|
_index = _index + 1;
|
|
|
|
_counter = _counter + 1;
|
|
|
|
if (_x isKindOf "Tank") then {_tanks pushBack _x;/*systemChat format["Adding Tank %1",_x];*/};
|
2017-09-25 09:40:17 +00:00
|
|
|
if (_x isKindOf "Car") then {_cars pushBack _x};
|
|
|
|
if ((_x isKindOf "Plane")) then {_planes pushBack _x};
|
|
|
|
if ((_x isKindOf "Helicopter")) then {_helis pushBack _x};
|
|
|
|
if (_x isKindOf "Ship") then {_boats pushback _x;};
|
2017-08-05 01:32:07 +00:00
|
|
|
};
|
|
|
|
}forEach _veh;
|
|
|
|
|
2017-10-04 22:35:36 +00:00
|
|
|
systemChat format["%1 classnames processed, formating trader entries",count _veh];
|
2017-09-25 09:40:17 +00:00
|
|
|
|
2017-08-05 01:32:07 +00:00
|
|
|
_clipBoard = "";
|
|
|
|
|
|
|
|
if (GRG_mod == "Exile") then
|
|
|
|
{
|
|
|
|
_clipboard = _clipboard + GRG_Exile_TraderItemLists_Header;
|
|
|
|
};
|
|
|
|
if (GRG_mod == "Epoch") then
|
|
|
|
{
|
|
|
|
_clipboard = _clipboard + GRG_Epoch_ItemLists_Header;
|
|
|
|
};
|
|
|
|
|
2017-09-25 09:40:17 +00:00
|
|
|
{
|
|
|
|
private _t = "";
|
|
|
|
_clipboard = _clipboard + format["%2%2// %1%2%2",_x select 0,endl];
|
|
|
|
_t = [_x select 1] call fn_generateItemList;
|
|
|
|
_clipBoard = _clipBoard + _t;
|
|
|
|
}forEach[
|
|
|
|
["Cars",_cars],
|
|
|
|
["Tanks",_tanks],
|
|
|
|
["Boats",_boats],
|
|
|
|
["Helis",_helis],
|
|
|
|
["Planes",_planes],
|
|
|
|
["Other Air",_air]
|
|
|
|
];
|
2017-08-05 01:32:07 +00:00
|
|
|
|
|
|
|
if (GRG_mod == "Exile") then
|
|
|
|
{
|
|
|
|
_clipboard = _clipBoard + GRG_Exile_Pricelist_Header;
|
|
|
|
};
|
|
|
|
if (GRG_mod == "Epoch") then
|
|
|
|
{
|
|
|
|
_clipboard = _clipBoard + GRG_Epoch_Pricelist_Header;
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
2017-09-25 09:40:17 +00:00
|
|
|
private _t = "";
|
|
|
|
_clipboard = _clipboard + format["%2%2// %1%2%2",_x select 0,endl];
|
|
|
|
_t = [_x select 1] call fn_generatePriceList;
|
|
|
|
_clipBoard = _clipBoard + _t;
|
|
|
|
}forEach[
|
|
|
|
["Cars",_cars],
|
|
|
|
["Tanks",_tanks],
|
|
|
|
["Boats",_boats],
|
|
|
|
["Helis",_helis],
|
|
|
|
["Planes",_planes],
|
|
|
|
["Other Air",_air]
|
|
|
|
];
|
2017-10-04 22:35:36 +00:00
|
|
|
systemChat "All Vehicles Process and results copied to clipboard";
|
2017-08-05 01:32:07 +00:00
|
|
|
copyToClipboard _clipboard;
|
|
|
|
|
|
|
|
hint format["Vehicles Config Extractor Run complete%1Output copied to clipboard%1Paste it into a text editor to acces",endl];
|