Advertisement
Dimon_UA

Untitled

Oct 2nd, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. _root = configFile >> "cfgVehicles";
  2. _configs = [];
  3. _parents = [];
  4. _output = "";
  5. for "_i" from 0 to (count _root - 1) do {
  6.     _configs set [_i, configName(_root select _i)];
  7.     _parents set [_i, configName inheritsFrom(_root select _i)];
  8. };
  9. _getChildren =
  10. {
  11.     private["_class", "_tab", "_i","_temp","_DisplayName","_side","_cargospace","_crew","_magazines","_weapons"];
  12.     _class = _this select 0;
  13.     _tab = _this select 1;
  14.     for "_i" from 0 to (count _configs - 1) do
  15.     {
  16.  
  17.         if ((_parents select _i) == _class) then
  18.         {
  19.             _abstract = if(getText((_root select _i) >> "model") != "")then{""}else{"*"};
  20.             // if (_abstract != "*") then {
  21.  
  22.  
  23.             if (((_configs select _i) isKindOf "Man") || ((_configs select _i) isKindOf "landvehicle") || ((_configs select _i) isKindOf "air") ) then {
  24.             _DisplayName = getText (_root>>(_configs select _i)>> "displayname");
  25.  
  26.             _side="unknown";
  27.             _crew="";
  28.             _magazines="";
  29.             _weapons="";
  30.             _cargospace="";
  31.  
  32.             if ((getNumber (_root>>(_configs select _i)>> "side")) == 0) then {_side="east"};
  33.             if ((getNumber (_root>>(_configs select _i)>> "side")) == 1) then {_side="west"};
  34.             if ((getNumber (_root>>(_configs select _i)>> "side")) == 2) then {_side="guerilla"};
  35.             if ((getNumber (_root>>(_configs select _i)>> "side")) == 3) then {_side="civilian"};
  36.  
  37.             if ((_configs select _i) isKindOf "Man") then
  38.             {
  39.                 _cargospace="";
  40.                 _crew="";
  41.                 {_magazines=_magazines+", "+_x} forEach getArray (_root>>(_configs select _i)>> "magazines");
  42.                 {_weapons=_weapons+", "+_x} forEach getArray (_root>>(_configs select _i)>> "weapons");
  43.             };
  44.  
  45.             if ((_configs select _i) isKindOf "landvehicle") then
  46.             {
  47.                 _magazines="";
  48.                 _weapons="";
  49.                 _cargospace=format["%1",(getNumber (_root>>(_configs select _i)>> "transportsoldier"))];
  50.                 {_crew=_crew+", "+_x} forEach getArray (_root>>(_configs select _i)>> "typicalcargo");
  51.             };
  52.  
  53.             if ((_configs select _i) isKindOf "air") then
  54.             {
  55.                 _magazines="";
  56.                 _weapons="";
  57.                 _cargospace=format["%1",(getNumber (_root>>(_configs select _i)>> "transportsoldier"))];
  58.                 {_crew=_crew+", "+_x} forEach getArray (_root>>(_configs select _i)>> "typicalcargo");
  59.             };
  60.  
  61.             diag_log format ["%1;%2;%3;%4;%5;%6;%7", (_configs select _i), _DisplayName,_side,_cargospace,_crew,_magazines,_weapons];
  62.             // _output = _output+_abstract+(_configs select _i)+";"+_DisplayName+";"+_side+";"+_magazines+";"+_weapons+";"+_cargospace+";"+_crew+toString[10];
  63.             };
  64.  
  65.  
  66.             hint (_configs select _i);
  67.             [_configs select _i, _tab + " "] call _getChildren;
  68.         };
  69.  
  70.     };
  71. };
  72. ["", ""] call _getChildren;
  73. //copyToClipboard _output;
  74. hint "done";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement