Config-Extraction-Tools/testConfig.Altis/vehicles.sqf

118 lines
3.0 KiB
Plaintext
Raw Normal View History

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/
*/
_excludedVehicles = [];
_baseClasses = [];
#include "ExcludedClassNames\excludedVehicles.sqf"
2017-08-05 01:32:07 +00:00
_veh = (configfile >> "CfgVehicles") call BIS_fnc_getCfgSubClasses;
_veh sort true;
2017-08-05 01:32:07 +00:00
_index = 0;
_cars = [];
_tanks = [];
2017-08-05 01:32:07 +00:00
_boats = [];
_air = [];
_helis = [];
_planes = [];
_process = true;
_n = count _veh;
_index = 0;
_counter = 1;
_interval = 25;
systemChat "Classname Extraction tool for vehicles initialized";
2017-08-05 01:32:07 +00:00
{
_process = true;
if (GRG_Root isEqualTo "") then
{
_process = true;
} else {
_leftSTR = [toLower _x,count GRG_Root] call KRON_StrLeft;
_process = ((toLower GRG_Root) isEqualTo _leftSTR);
//systemChat format["vehicles.sqf:: _leftSTR = %1 and _process = %2",_leftSTR, _process];
};
if ([toLower _x,"base"] call KRON_StrInStr || [toLower _x,"abstract"] call KRON_StrInStr) then
2017-08-05 01:32:07 +00:00
{
if !(_x in _baseClasses) then {_baseClasses pushBack _x};
_process = false;
_msg = format["base class %1 ignored",_x];
systemChat _msg;
//diag_log _msg;
};
if (_process && !(_x in _excludedVehicles)) then
{
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];*/};
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;
systemChat format["%1 classnames processed, formating trader entries",count _veh];
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;
};
{
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;
};
{
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]
];
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];