User Tools

Site Tools


arma2:config:extract-class-names-with-sqf

Extract Class Names with SQF

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.

arma2/config/extract-class-names-with-sqf.txt · Last modified: 2015-07-13 06:47 by snakeman