ArmA 2 Extract Class Names with SQF

ArmA 2 Forum, ArmA 2 Home, ArmA 2 Config, ArmA 2 File Formats, ArmA 2 Missions, ArmA 2 3D Modeling, ArmA 2 Scripting, ArmA 2 Terrain, ArmA 2 Texturing, ArmA 2 Tools

Here is excellent way to extract Class Names and the class descriptions from config.cpp using SQF script and RPT log.

SQF:

private["_getClassList"];
 
_getClassList =
{
	private["_type", "_name", "_cfg", "_n", "_class"];
 
	_type = _this select 0;
	_name = _this select 1;
 
	diag_log "";
	diag_log "";
	diag_log format["**ArmA 2 Combined Operations - %1**", _type];
	diag_log "";
	diag_log "^ Class Name ^ Name ^";
 
	_cfg = configFile >> _type;
	_n = 0;
	for "_i" from 0 to count _cfg - 1 do
	{
		_class = _cfg select _i;
		if (isClass _class) then
		{
			_n = _n + 1;
			diag_log format ["| %1 | %2 |", configName _class, getText (_class >> _name)];
		};
	};
};
 
["CfgMusic", "name"] call _getClassList;
["CfgWeapons", "displayName"] call _getClassList;
["CfgVehicles", "displayName"] call _getClassList;

Then just open RPT and clean out “ character's and you are ready to drop in the data into dokuwiki.