Advertisement
R3voA3

Untitled

Aug 8th, 2024
278
0
260 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 24.86 KB | None | 0 0
  1. /*
  2. AUTHOR: Asheara, updated by R3vo
  3.  
  4. USE CASE:
  5. 0 = [0] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> OPFOR / CSAT
  6. 0 = [1] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> BLUFOR / NATO
  7. 0 = [2] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> Independent / Guerrilla
  8. 0 = [3, 0] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> Civilian side, Civilian
  9. 0 = [3, 1] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> Civilian side, Structures
  10. 0 = [3, 2] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> Civilian side, Ruins & Wrecks
  11. 0 = [3, 3] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> Civilian side, Equipment
  12. 0 = [3, 4] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> Civilian side, Objects
  13. 0 = [3, 5] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> Civilian side, VR Objects
  14. 0 = [3, 6] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> Civilian side, Animals
  15. 0 = [] spawn BIS_fnc_exportCfgVehiclesAssetDB; -> Other - Unknown, Enemy, Friendly, Modules, Empty, Ambient Life
  16. */
  17.  
  18. private _sides_param = param [0, [4, 5, 6, 7, 8, 9], [0, []]];                      // first parameter, default value is "other" -> sides bigger than three, accepts array and numbers
  19. private _categories_param = param [1, 0, [0]];                              // second parameter, default value is 0 - representing "Civilians" category as first field of array, accepts numbers
  20.  
  21. if !(_sides_param isEqualType []) then                                      // if _side is not array, make it array
  22. {
  23.     _sides_param = [_sides_param];
  24. };
  25.  
  26. if (count(_sides_param) > 1) then
  27. {
  28.     _categories_param = 1;
  29. };
  30.  
  31. startloadingscreen [""];
  32.  
  33. _cfgVehicles            = (configfile >> "cfgvehicles") call bis_fnc_returnchildren;    // gets all subclasses of cfgVehicles
  34. _text                   = "";                                                           // initializing the text variable
  35. _product                = productversion select 0;                                      // version of the product for purposes of the wiki links
  36. _productShort           = productversion select 1;                                      // version of the product for purposes of the wiki images
  37.  
  38. _scopes                 = ["Private", "Protected", "Public"];                                                                                   // list of strings for scopes
  39. _sides                  = ["OPFOR", "BLUFOR", "Independent", "Civilian", "Unknown", "Enemy", "Friendly", "Modules", "Empty", "Ambient Life"];       // list of strings for sides
  40. _scopecolor             = ["#e1c2c2", "#fff3b2", "#c2e1c2"];                                                                                    // list of colors for scopes
  41. _sidecolor              = ["#e1c2c2", "#c2d4e7", "#c2e1c2", "#dac2e1", "#fff3b2", "e1c2c2", "#c2e1c2", "#fdd3a6", "#dac2e1", "#cccccc"];                // list of colors for sides
  42.  
  43. // listed subcategories for "civilian" side
  44. _civilian               = ["Civilians"];
  45. _structures             = ["Structures", "Structures (Altis)", "Structures (Tanoa)", "Walls", "Fences"];
  46. _ruins_wrecks           = ["Ruins", "Ruins (Altis)", "Ruins (Tanoa)", "Wrecks"];
  47. _equipment              = ["Equipment", "Weapons", "Weapon Attachements", "Supplies"];
  48. _objects                = ["Furniture", "Signs", "Things", "Other"];
  49. _vr                     = ["VR Objects"];
  50. _animals                = ["Animals"];
  51.  
  52. _categories             = [_civilian, _structures, _ruins_wrecks, _equipment, _objects, _vr, _animals];
  53.  
  54. _cfg_DLC                = ["Curator", "Expansion", "Heli", "Kart", "Mark", "Orange", "Argo", "Tank"];                       // list of values for DLCs from config
  55. _icons_DLC              = [
  56.                             "Kart", "karts_icon_ca",
  57.                             "Heli", "heli_icon_ca",
  58.                             "Mark", "mark_icon_ca",
  59.                             "Expansion", "apex_icon_ca",
  60.                             "Jets", "jets_icon_ca",
  61.                             "Orange", "orange_icon_ca",
  62.                             "Argo", "malden_icon_ca",
  63.                             "Tank", "tank_icon_ca"
  64.                           ];
  65.  
  66. _exclude_list           = [];
  67.  
  68. // function returning appropriate string for the purpose of wiki links based on the item type passed as an argument
  69. _fnc_getItemPage = {
  70.     switch (_this) do {
  71.         case "Weapon": {"CfgWeapons Weapons"};
  72.         case "VehicleWeapon": {"CfgWeapons Vehicle Weapons"};
  73.         case "Item": {"CfgWeapons Items"};
  74.         case "Equipment": {"CfgWeapons Equipment"};
  75.         default {"CfgWeapons"};
  76.     };
  77. };
  78.  
  79. _text = format ["{{Navbox/A3Assets}}", _product] + endl;
  80.  
  81. // creating the wiki table header
  82. _text = _text + "{| class=""wikitable sortable"" style=""font-size:80%; margin: auto""" + endl;
  83. _text = _text + "! Preview" + endl;
  84. _text = _text + "! Class Name" + endl;
  85. _text = _text + "! Display Name" + endl;
  86. _text = _text + "! Side" + endl;
  87. _text = _text + "! Category" + endl;
  88. _text = _text + "! Subcategory" + endl;
  89. _text = _text + "! Scope" + endl;
  90. _text = _text + "! DLC" + endl;
  91. // Props do not need to have these parameters listed
  92. if (_categories_param == 0) then
  93. {
  94.     _text = _text + "! Weapons" + endl;
  95.     _text = _text + "! Magazines" + endl;
  96.     _text = _text + "! Items" + endl;
  97. };
  98. _text = _text + "! Addons" + endl;
  99. _text = _text + "! Features" + endl;
  100.  
  101. _parsed = [];               // inititalizing array for filtering the assets
  102.  
  103. // Applies only for "civilian" side - too many assets, had to be split into several categories
  104. if (3 in _sides_param) then
  105. {
  106.     {   // getting side and editor category text to ve verified for every asset
  107.         _side = getnumber(_x >> "side");
  108.         _editorcategory = gettext(configfile >> "cfgeditorcategories" >> gettext(_x >> "editorCategory") >> "displayname");
  109.         if (_editorcategory == "") then
  110.         {
  111.             _editorcategory = gettext(configfile >> "cfgFactionClasses" >> gettext(_x >> "faction") >> "displayname");
  112.         };
  113.  
  114.         // excluding classes starting as "Supply"
  115.         if ((configname _x select [0, 6]) == "Supply") then
  116.         {
  117.             _exclude_list pushBack _x;
  118.         };
  119.         // excluding carrier parts which are hidden from editor
  120.         if (((configname _x select [0, 15]) == "Land_Carrier_01") && {getnumber(_x >> "scope") != 2}) then
  121.         {
  122.             _exclude_list pushBack _x;
  123.         };
  124.  
  125.         // Verifying allegiance of an asset into chosen category
  126.         if (_side == 3 && {_editorcategory in (_categories select _categories_param)} && {!(_x in _exclude_list)}) then
  127.         {
  128.             _parsed pushBack _x;
  129.         };
  130.     } foreach _cfgVehicles;
  131.     _cfgVehicles = _parsed;
  132. };
  133.  
  134. _cfgVehiclesCount = count _cfgVehicles;                                     // count of the subclasses for purpose of the loading screen progress
  135. {
  136.     _scope = getnumber(_x >> "scope");                                      // getting the scope parameter of the asset
  137.     _side = getnumber(_x >> "side");                                        // getting the side parameter of the asset
  138.  
  139.     if (_scope > 0 && _side in _sides_param) then                           // chooses only the classes with public or private scope (1 or 2)
  140.     {
  141.         _weapons = [];                                                      // initializing the array for the weapons
  142.         _magazines = [];                                                    // initializing the array for the magazines
  143.  
  144.         _textSide = _sides select _side;                                    // getting the display name of side - number from config is used as array index
  145.         _textScope = _scopes select _scope;                                 // getting the display name of scope - number from config is used as array index
  146.         _textDLC = "";                                                      // initializing the variable for DLC
  147.         _iconDLC = "";                                                      // initializing the variable for the icon file
  148.         _textWeapons = "";                                                  // initializing the text variable for weapons
  149.         _textMagazines = "";                                                // initializing the text variable for magazines
  150.         _textItems = "";                                                    // initializing the text variable for items
  151.         _textAddons = "";                                                   // initializing the text variable for addons
  152.         _textFeatures = "";                                                 // initializing the text variable for features
  153.  
  154.         /* features attribute variables */
  155.         _tmp_features_int = 0;
  156.         _tmp_features_array = [];
  157.         _count_textures = 0;
  158.         _count_animations = 0;
  159.         _count_hiddensel = 0;
  160.         _count_vehcapacity = 0;
  161.         _count_turrets = 0;
  162.         _array_turrets = [];
  163.         _count_slingload = 0;
  164.         _count_sling_ropes = 0;
  165.         _can_float = 0;
  166.  
  167.         /* vehicle capacity details*/
  168.         _driver = 0;
  169.         _copilot = 0;
  170.         _commanders = 0;
  171.         _ffv_positions = 0;
  172.         _gunners = 0;
  173.         _cargo = 0;
  174.  
  175.         /* vehicle roles details */
  176.         _veh_medic = 0;
  177.         _veh_repair = 0;
  178.         _veh_ammo = 0;
  179.         _veh_fuel = 0;
  180.  
  181.         /* vehicle in vehicle tranport */
  182.         _veh_carrier = 0;
  183.         _veh_cargo = 0;
  184.  
  185.         /* men roles details */
  186.         _men_medic = 0;
  187.         _men_repair = 0;
  188.         _men_mines = 0;
  189.         _men_uav = 0;
  190.  
  191.         _classname = configname _x;                                                                                                     // getting the class name of the object
  192.         _displayname = gettext(_x >> "displayname");                                                                                    // getting the display name of the object
  193.         _editorcategory = gettext(configfile >> "cfgeditorcategories" >> gettext(_x >> "editorCategory") >> "displayname");             // getting editorcategory display name
  194.         _editorsubcategory = gettext(configfile >> "cfgeditorsubcategories" >> gettext(_x >> "editorSubcategory") >> "displayname");    // getting editor subcategory display name
  195.         _items = ([gettext (_x >> "uniformClass")] + getarray (_x >> "linkedItems") + getarray (_x >> "items")) - [""];                 // getting the list of the items
  196.         _addons = unitaddons _classname;                                                                                                // getting a list of addons required for the object
  197.  
  198.         // if editorCategory is empty, variable is filled with faction instead
  199.         if (_editorcategory == "") then
  200.         {
  201.             _editorcategory = gettext(configfile >> "cfgFactionClasses" >> gettext(_x >> "faction") >> "displayname");
  202.         };
  203.  
  204.         // if editorsubcategory is empty, variable is filled with vehicleclass instead
  205.         if (_editorsubcategory == "") then
  206.         {
  207.             _editorsubcategory = gettext(configfile >> "cfgVehicleClasses" >> gettext(_x >> "vehicleClass") >> "displayname");
  208.         };
  209.  
  210.         // if the asset was released as part of DLC, there will be selected text for name of the expansion
  211.         _textDLC = gettext(_x >> "DLC");
  212.         if ((_icons_DLC find _textDLC) != -1) then
  213.         {
  214.             _iconDLC = _icons_DLC select ((_icons_DLC find _textDLC)+1);
  215.         };
  216.  
  217.         // Props do not need to have these parameters listed
  218.         if (_categories_param == 0) then
  219.         {
  220.             // loop for adding the turret weapons and magazines to the variables for current object
  221.             {
  222.                 _weapons = _weapons + getarray (_x >> "weapons");
  223.                 _magazines = _magazines + getarray (_x >> "magazines");
  224.             } foreach (_classname call bis_fnc_getTurrets);
  225.  
  226.             // formatting of the _weapons array to fit to the wiki table, adding links
  227.             {
  228.                 _type = _x call bis_fnc_itemType;                               // getting the type of the weapon
  229.                 _page = (_type select 0) call _fnc_getItemPage;                 // getting and appropriate
  230.                 _textWeapons = _textWeapons + endl + format [":[[%1 %3#%2|%2]]", _product, _x, _page];
  231.             } foreach _weapons;
  232.  
  233.             // formatting of the magazines - aggregating the duplicite magazines, adding links
  234.             while {count _magazines > 0} do {
  235.                 _mag = _magazines select 0;
  236.                 _textMagazines = _textMagazines + endl + format [":%1x [[%3 CfgMagazines#%2|%2]]", {_x == _mag} count _magazines, _mag, _product];
  237.                 _magazines = _magazines - [_mag];
  238.             };
  239.  
  240.             // formatting of the items
  241.             while {count _items > 0} do {
  242.                 _item = _items select 0;
  243.                 _type = _item call bis_fnc_itemType;
  244.                 _page = (_type select 0) call _fnc_getItemPage;
  245.                 _textItems = _textItems + endl + format [":[[%4 %3#%2|%2]]", {_x == _item} count _items, _item, _page, _product];
  246.                 _items = _items - [_item];
  247.             };
  248.         };
  249.  
  250.         // formatting the addons list, adding links
  251.         {   // Addons starting with CuratorOnly shouldn't appear in the list
  252.             if ((_x find "CuratorOnly") == -1) then
  253.             {
  254.                 _textAddons = _textAddons + endl + format [":[[%1 CfgPatches CfgVehicles#%2|%2]]", _product, _x];
  255.             };
  256.         } foreach _addons;
  257.  
  258.         /* FEATURES */
  259.         /* RANDOMIZATION */
  260.         // Randomization has two parts - textures and components
  261.         _textFeatures = _textFeatures + endl + "* '''Randomization:''' ";
  262.  
  263.         // parsing amount of skins, which have non-zero value
  264.         _tmp_features_array = getarray(_x >> "TextureList");
  265.         for [{_i = 0}, {_i < count _tmp_features_array}, {_i = _i + 2}] do
  266.         {
  267.             if (_tmp_features_array select (_i + 1) > 0) then
  268.             {
  269.                 _count_textures = _count_textures + 1;
  270.             };
  271.         };
  272.  
  273.         // parsing amount of components, which have probability to be random - values between 0 and 1
  274.         _tmp_features_array = getarray(_x >> "animationList");
  275.         for [{_i = 0}, {_i < count _tmp_features_array}, {_i = _i + 2}] do
  276.         {
  277.             if (_tmp_features_array select (_i + 1) > 0 && _tmp_features_array select (_i + 1) < 1) then
  278.             {
  279.                 _count_animations = _count_animations + 1;
  280.             };
  281.         };
  282.  
  283.         // creating the final text for randomization, based on the values obtained from before
  284.         if (_count_textures > 1 || {_count_animations > 0}) then
  285.         {
  286.             _textFeatures = _textFeatures + "Yes";
  287.             // writing the amount of skins
  288.             if (_count_textures > 1) then
  289.             {
  290.                 _textFeatures = _textFeatures + ", " + str _count_textures + " skins";
  291.             };
  292.  
  293.             // writing the amount of components
  294.             if (_count_animations > 0) then
  295.             {
  296.                 _textFeatures = _textFeatures + ", " + str _count_animations + " component";
  297.  
  298.                 if (_count_animations > 1) then
  299.                 {
  300.                     _textFeatures = _textFeatures + "s";
  301.                 };
  302.             };
  303.  
  304.             _textFeatures = _textFeatures + endl;
  305.         }
  306.         else
  307.         {
  308.             _textFeatures = _textFeatures + "No" + endl;
  309.         };
  310.  
  311.         /* CAMO SELECTIONS */
  312.         // getting the amount of hidden selections used for camouflage
  313.         _count_hiddensel = count getarray(_x >> "hiddenSelections");
  314.         _textFeatures = _textFeatures + "* ''' Camo&nbsp;selections:'''&nbsp;" + str _count_hiddensel + endl;
  315.  
  316.         /* VEHICLE SPECIFIC FEATURES */
  317.         if ((configname _x isKindOf "Air") || {configname _x isKindOf "Car"} || {configname _x isKindOf "Tank"} || {configname _x isKindOf "Ship"}) then
  318.         {
  319.             /* VEHICLE CAPACITY */
  320.             // function to iterate through turrets, to get their count and list
  321.             _get_count_turrets =
  322.             {
  323.                 private _config = _this select 0;
  324.                 _count_turrets = _count_turrets + count("true" configClasses(_config >> "Turrets"));
  325.                 {
  326.                     _array_turrets pushBack _x;         // creates array of configs for the turrets, so they can be sorted out
  327.                     [_x] call _get_count_turrets;       // checks if the turret has any other turrets as children
  328.                 } forEach ("true" configClasses(_config >> "Turrets"));
  329.             };
  330.  
  331.             [_x] call _get_count_turrets;           // call the function to count and list the turrets
  332.  
  333.             _driver = getnumber(_x >> "hasDriver");         // getting value to determine whether there is a driver (but always should be)
  334.             _cargo = getnumber(_x >> "transportSoldier");   // getting value to determine amount of cargo positions
  335.  
  336.             // iterating through the array of configs for turrets to determine their types
  337.             {   // whether the turret is a commander
  338.                 if (gettext(_x >> "ProxyType") == "CPCommander") then
  339.                 {
  340.                     _commanders = _commanders + 1;
  341.                 } else
  342.                 {   // whether the turret is a copilot
  343.                     if ((getnumber(_x >> "isCopilot") == 1) && {count(getarray(_x >> "weapons")) == 0 || count(getarray(_x >> "magazines")) == 0}) then
  344.                     {
  345.                         _copilot = _copilot + 1;
  346.                     }
  347.                     else
  348.                     {   // whether the turret is a firing from the vehicle
  349.                         if (getnumber(_x >> "isPersonTurret") == 1 && {count(getarray(_x >> "weapons")) == 0 || {count(getarray(_x >> "magazines")) == 0} || {gettext(_x >> "ProxyType") == "CPCargo"}}) then
  350.                         {
  351.                             _ffv_positions = _ffv_positions + 1;
  352.                         } else
  353.                         {   // anything else is a gunner
  354.                             _gunners = _gunners + 1;
  355.                         };
  356.                     };
  357.                 };
  358.             } forEach _array_turrets;
  359.  
  360.             _count_vehcapacity = _driver + _cargo + _count_turrets;     // capacity of vehicle is driver, amount of cargo positions and amount of turrets
  361.  
  362.             _textFeatures = _textFeatures + "* '''Vehicle&nbsp;capacity:'''&nbsp;";
  363.             // vehicles with parameter isUav have are remotely controlled
  364.             if (getnumber(_x >> "isUav") == 1) then
  365.             {
  366.                 _textFeatures = _textFeatures + "Remotely&nbsp;controlled, ";
  367.             };
  368.             _textFeatures = _textFeatures + str _count_vehcapacity;
  369.  
  370.             // if capacity is more than a zero, we'll write more elaborate description
  371.             if (_count_vehcapacity > 0) then
  372.             {
  373.                 _textFeatures = _textFeatures;
  374.  
  375.                 // "amount" of drivers (always just one)
  376.                 if (_driver > 0) then
  377.                 {
  378.                     _textFeatures = _textFeatures + endl + "** " + str _driver + "&nbsp;driver";
  379.                 };
  380.  
  381.                 // "amount" of copilots
  382.                 if (_copilot > 0) then
  383.                 {
  384.                     if (_driver > 0) then
  385.                     {
  386.                         _textFeatures = _textFeatures;
  387.                     };
  388.                     _textFeatures = _textFeatures + endl + "** " + str _copilot + "&nbsp;copilot";
  389.  
  390.                     if (_copilot > 1) then
  391.                     {
  392.                         _textFeatures = _textFeatures + "s";
  393.                     };
  394.                 };
  395.  
  396.                 // amount of commanders
  397.                 if (_commanders > 0) then
  398.                 {
  399.                     if ((_driver > 0) || {_copilot > 0}) then
  400.                     {
  401.                         _textFeatures = _textFeatures;
  402.                     };
  403.                     _textFeatures = _textFeatures + endl + "** " + str _commanders + "&nbsp;commander";
  404.  
  405.                     if (_commanders > 1) then
  406.                     {
  407.                         _textFeatures = _textFeatures + "s";
  408.                     };
  409.                 };
  410.  
  411.                 // amount of gunners
  412.                 if (_gunners > 0) then
  413.                 {
  414.                     if ((_driver > 0) || {_copilot > 0} || {_commanders > 0}) then
  415.                     {
  416.                         _textFeatures = _textFeatures;
  417.                     };
  418.                     _textFeatures = _textFeatures + endl + "** " + str _gunners + "&nbsp;gunner";
  419.  
  420.                     if (_gunners > 1) then
  421.                     {
  422.                         _textFeatures = _textFeatures + "s";
  423.                     };
  424.                 };
  425.  
  426.                 // amount of positions for firing from vehicle
  427.                 if (_ffv_positions > 0) then
  428.                 {
  429.                     if ((_driver > 0) || {_copilot > 0} || {_commanders > 0} || {_gunners > 0}) then
  430.                     {
  431.                         _textFeatures = _textFeatures;
  432.                     };
  433.                     _textFeatures = _textFeatures + endl + "** " + str _ffv_positions + "&nbsp;firing&nbsp;position";
  434.  
  435.                     if (_ffv_positions > 1) then
  436.                     {
  437.                         _textFeatures = _textFeatures + "s";
  438.                     };
  439.                 };
  440.  
  441.                 // amount of cargo positions
  442.                 if (_cargo > 0) then
  443.                 {
  444.                     if ((_driver > 0) || {_copilot > 0} || {_commanders > 0} || {_gunners > 0} || {_ffv_positions > 0}) then
  445.                     {
  446.                         _textFeatures = _textFeatures;
  447.                     };
  448.                     _textFeatures = _textFeatures + endl + "** " + str _cargo + " cargo&nbsp;position";
  449.  
  450.                     if (_cargo > 1) then
  451.                     {
  452.                         _textFeatures = _textFeatures + "s";
  453.                     };
  454.                 };
  455.  
  456.                 _textFeatures = _textFeatures + endl;
  457.             };
  458.  
  459.             /* ROLES */
  460.             _veh_medic = getnumber(_x >> "attendant");
  461.             _veh_ammo = getnumber(_x >> "transportAmmo");
  462.             _veh_fuel = getnumber(_x >> "transportFuel");
  463.             _veh_repair = getnumber(_x >> "transportRepair");
  464.  
  465.             _textFeatures = _textFeatures + "* '''Roles:''' ";
  466.             // vehicle can heal, medic role
  467.             if (_veh_medic > 0) then
  468.             {
  469.                 _textFeatures = _textFeatures + endl + "** can&nbsp;heal";
  470.             };
  471.             // vehicle can repair
  472.             if (_veh_repair > 0) then
  473.             {
  474.                 if (_veh_medic > 0) then
  475.                 {
  476.                     _textFeatures = _textFeatures + ", " + endl;
  477.                 };
  478.                 _textFeatures = _textFeatures + endl + "** can&nbsp;repair";
  479.             };
  480.             // vehicle transports ammo, can replenish
  481.             if (_veh_ammo > 0) then
  482.             {
  483.                 if (_veh_medic > 0 || {_veh_repair > 0}) then
  484.                 {
  485.                     _textFeatures = _textFeatures + ", ";
  486.                 };
  487.                 _textFeatures = _textFeatures + endl + "** can&nbsp;replenish&nbsp;ammo";
  488.             };
  489.             // vehicle transports fuel, can replenish
  490.             if (_veh_fuel > 0) then
  491.             {
  492.                 if (_veh_medic > 0 || {_veh_repair > 0} || {_veh_ammo > 0}) then
  493.                 {
  494.                     _textFeatures = _textFeatures + ", " + endl;
  495.                 };
  496.                 _textFeatures = _textFeatures + endl + "** can&nbsp;replenish&nbsp;fuel";
  497.             };
  498.  
  499.             // no roles
  500.             if (!(_veh_fuel > 0) && {!(_veh_medic > 0)} && {!(_veh_repair > 0)} && {!(_veh_ammo > 0)}) then
  501.             {
  502.                 _textFeatures = _textFeatures + endl + "** None";
  503.             };
  504.             _textFeatures = _textFeatures + endl;
  505.  
  506.             /* FLOATING */
  507.             _can_float = getnumber(_x >> "canFloat");
  508.             _textFeatures = _textFeatures + "* '''Can&nbsp;float:'''&nbsp;";
  509.  
  510.             if (_can_float == 1) then
  511.             {
  512.                 _textFeatures = _textFeatures + "Yes" + endl;
  513.             }
  514.             else
  515.             {
  516.                 _textFeatures = _textFeatures + "No" + endl;
  517.             };
  518.  
  519.             /* VEHICLE IN VEHICLE TRANSPORT */
  520.             _textFeatures = _textFeatures + "* '''Vehicle&nbsp;in&nbsp;vehicle&nbsp;transport:''' ";
  521.             if (isclass (_x >> "VehicleTransport")) then
  522.             {
  523.                 _veh_carrier = getnumber(_x >> "VehicleTransport" >> "Carrier" >> "maxLoadMass");
  524.                 _veh_cargo = getnumber(_x >> "VehicleTransport" >> "Cargo" >> "canBeTransported");
  525.             }
  526.             else
  527.             {   // specific vehicles can be blacklisted and therefore can't be loaded, done with config parameter
  528.                 // therefore if config parameter is missing, vehicle can be loaded
  529.                 // from https://confluence.bistudio.com/display/ARMA3/Vehicle+in+Vehicle+Transport
  530.                 _veh_cargo = 1;
  531.             };
  532.  
  533.             if (_veh_carrier > 0) then
  534.             {
  535.                 _textFeatures = _textFeatures + "Can&nbsp;transport, &nbsp;up&nbsp;to&nbsp;" + str _veh_carrier + "&nbsp;kg. ";
  536.             }
  537.             else
  538.             {
  539.                 _textFeatures = _textFeatures + "Cannot&nbsp;transport. ";
  540.             };
  541.  
  542.             if (_veh_cargo > 0) then
  543.             {
  544.                 _textFeatures = _textFeatures + "Can be transported." + endl;
  545.             }
  546.             else
  547.             {
  548.                 _textFeatures = _textFeatures + "Cannot be transported." + endl;
  549.             };
  550.  
  551.             /* SLINGLOAD */
  552.             _count_slingload = getnumber(_x >> "slingLoadMaxCargoMass");
  553.             _textFeatures = _textFeatures + "* '''Slingload:''' ";
  554.  
  555.             if (_count_slingload > 0) then
  556.             {
  557.                 _textFeatures = _textFeatures + "Yes, &nbsp;up&nbsp;to&nbsp;" + str _count_slingload + "&nbsp;kg" + endl;
  558.             }
  559.             else
  560.             {
  561.                 _textFeatures = _textFeatures + "No" + endl;
  562.             };
  563.         };
  564.  
  565.         /* MEN SPECIFIC FEATURES */
  566.         if ((configname _x isKindOf "Man") && {!(configname _x isKindOf "Animal")}) then
  567.         {
  568.             /* ROLES */
  569.             _textFeatures = _textFeatures + "* '''Roles:''' ";
  570.  
  571.             _men_medic = getnumber(_x >> "attendant");
  572.             _men_repair = getnumber(_x >> "engineer");
  573.             _men_mines = getnumber(_x >> "canDeactivateMines");
  574.             _men_uav = getnumber(_x >> "uavHacker");
  575.  
  576.             // man can heal, medic role
  577.             if (_men_medic > 0) then
  578.             {
  579.                 _textFeatures = _textFeatures + "can&nbsp;heal";
  580.             };
  581.             // man can repair, engineer role
  582.             if (_men_repair > 0) then
  583.             {
  584.                 if (_men_medic > 0) then
  585.                 {
  586.                     _textFeatures = _textFeatures + ", ";
  587.                 };
  588.                 _textFeatures = _textFeatures + "can&nbsp;repair";
  589.             };
  590.             // man can deactivate mines
  591.             if (_men_mines > 0) then
  592.             {
  593.                 if (_men_medic > 0 || {_men_repair > 0}) then
  594.                 {
  595.                     _textFeatures = _textFeatures + ", ";
  596.                 };
  597.                 _textFeatures = _textFeatures + "can&nbsp;deactivate&nbsp;mines";
  598.             };
  599.             // vehicle transports fuel, can replenish
  600.             if (_men_uav > 0) then
  601.             {
  602.                 if (_men_medic > 0 || {_men_repair > 0} || {_men_mines > 0}) then
  603.                 {
  604.                     _textFeatures = _textFeatures + ", ";
  605.                 };
  606.                 _textFeatures = _textFeatures + "can&nbsp;replenish&nbsp;fuel";
  607.             };
  608.  
  609.             // no roles
  610.             if (!(_men_medic > 0) && {!(_men_repair > 0)} && {!(_men_mines > 0)} && {!(_men_uav > 0)}) then
  611.             {
  612.                 _textFeatures = _textFeatures + "None";
  613.             };
  614.         };
  615.  
  616.         /* FEATURES EXCLUDING MEN */
  617.         if !(configname _x isKindOf "Man") then
  618.         {
  619.             /* SLINLOADABLE */
  620.             _textFeatures = _textFeatures + "* '''Slingloadable:''' ";
  621.             _count_sling_ropes = count getarray(_x >> "slingLoadCargoMemoryPoints");
  622.             if (_count_sling_ropes > 0) then
  623.             {
  624.                 _textFeatures = _textFeatures + "Yes";
  625.             }
  626.             else
  627.             {
  628.                 _textFeatures = _textFeatures + "No";
  629.             };
  630.         };
  631.  
  632.         // Get editor preview
  633.         private _image = getText (configFile >> "CfgVehicles" >> _classname >> "editorPreview");
  634.  
  635.         if (_image != "") then
  636.         {
  637.             _image = (_image splitString "\");
  638.             reverse _image;
  639.             _image = _image param [0, ""];
  640.         };
  641.  
  642.         if (_image != "") then
  643.         {
  644.             _image = format ["[[File:%1|150px]]", "span class="re5"> arma3-" + toLower _image];
  645.         };
  646.  
  647.         diag_log _image;
  648.  
  649.         _text = _text + "|-" + endl;
  650.         _text = _text + "| " + _image + endl;                                               // preview
  651.         _text = _text + "| " + format ["<;span id=""%1"" >'''%1'''</span>", _classname] + endl;                                           // class name
  652.         _text = _text + "| " + (if (_displayName != "") then {"''" + _displayname + "''"} else {""}) + endl;                                                                        // display name
  653.         _text = _text + "| " + format ["span class="re5"> style=""span class="re5"> background-color:%2"" | %1", _textSide, _sideColor select _side] + endl;                    // side
  654.         _text = _text + "| " + _editorcategory + endl;                                                                                  // category
  655.         _text = _text + "| " + _editorsubcategory + endl;                                                                               // subcategory
  656.         _text = _text + "| " + format ["span class="re5"> style=""span class="re5"> background-color:%2"" | %1", _textScope, _scopeColor select _scope] + endl;                 // scope
  657.         if (_iconDLC != "") then                                                                                                        // DLC
  658.         {
  659.             _text = _text + "| " + format ["[[File:%1.png|50px]]", _iconDLC] + endl;
  660.         }
  661.         else
  662.         {
  663.             _text = _text + "| " + _textDLC + endl;
  664.         };
  665.         // Props do not need to have these parameters listed
  666.         if (_categories_param == 0) then
  667.         {
  668.             _text = _text + "| " + _textWeapons + endl;                                                                                 // weapons
  669.             _text = _text + "| " + _textMagazines + endl;                                                                               // magazines
  670.             _text = _text + "| " + _textItems + endl + endl;                                                                                // items
  671.         };
  672.         _text = _text + "| " + _textAddons + endl + endl;                                                                                   // addons
  673.         _text = _text + "| " + _textFeatures + endl;                                                                                        // features
  674.  
  675.     };
  676.     progressloadingscreen (_foreachindex / _cfgVehiclesCount);
  677. } foreach _cfgVehicles;
  678.  
  679. _text = _text + "|}" + endl;                                                    // wiki table ending
  680. _text = _text + format [
  681.         "<;div style=""span class="re5"> color: grey; font-size: 0.9em; padding: 0.5em; text-align: center"">;Generated in {{GVI|%1|%2|size= 0.75}} by ~~~~</div>",
  682.         tolower (productversion select 0),
  683.         (productversion select 2) * 0.01
  684.     ] + endl;
  685.  
  686. _text = _text + format ["{{Navbox/A3Assets}}", _product];
  687.  
  688. copytoclipboard _text;                                                      // copying the contents to the clipboard
  689.  
  690. endloadingscreen;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement