Biki Export Scripts: Difference between revisions
Jump to navigation
Jump to search
↑ Back to spoiler's top
↑ Back to spoiler's top
↑ Back to spoiler's top
↑ Back to spoiler's top
↑ Back to spoiler's top
↑ Back to spoiler's top
↑ Back to spoiler's top
↑ Back to spoiler's top
↑ Back to spoiler's top
↑ Back to spoiler's top
↑ Back to spoiler's top
↑ Back to spoiler's top
Lou Montana (talk | contribs) (Add getTextRaw usage) |
Lou Montana (talk | contribs) m (Fix missing semicolon) |
||
Line 1,311: | Line 1,311: | ||
(" values[] = { " + (getArray (_x >> "values") joinString ", ") + " };") call _addLine; | (" values[] = { " + (getArray (_x >> "values") joinString ", ") + " };") call _addLine; | ||
(" default = " + str getNumber (_x >> "default")) call _addLine; | (" default = " + str getNumber (_x >> "default")) call _addLine; | ||
"}" call _addLine; | "};" call _addLine; | ||
} forEach ("true" configClasses getMissionConfig "Params"); | } forEach ("true" configClasses getMissionConfig "Params"); | ||
}; | }; |
Revision as of 09:45, 19 September 2023
This page contains all export scripts used to generate data on various pages on this wiki.
Arma: Airport IDs
Author: POLPOX
_world = "Enoch";
_cfg = (configFile >> "CfgWorlds" >> _world);
_r = [
'{| class="wikitable"',
"! ID !! Coordinates !! Description !! AI approach",
"|-"
];
_id = 0;
_addAirportInfo = {
_dir = asin ((getArray (_cfg >> "ilsDirection")) # 0);
if (_dir < 0) then
{
_dir = -_dir;
};
_compassDir = call {
_dir45 = round (_dir/45);
if (_dir45 == 1) exitWith { "NE" };
if (_dir45 == 2) exitWith { "E" };
if (_dir45 == 3) exitWith { "SE" };
if (_dir45 == 4) exitWith { "S" };
if (_dir45 == 5) exitWith { "SW" };
if (_dir45 == 6) exitWith { "W" };
if (_dir45 == 7) exitWith { "NW" };
"N"
};
_r pushBack "| " + str _id;
_r pushBack "| " + mapGridPosition (getArray (_cfg >> "ilsPosition"));
_r pushBack "| -";
_r pushBack "| " + str round _dir + " (" + _compassDir + ")";
_r pushBack "|-";
_id = _id + 1;
};
if (count getArray (_cfg >> "ilsPosition") != 0) exitWith
{
call _addAirportInfo;
{
_cfg = _x;
call _addAirportInfo;
} forEach ("true" configClasses (_cfg >> "SecondaryAirports"));
_r pushBack "|}";
copyToClipboard (_r joinString endl);
};
Arma 3: CfgFunctions
Author: R3vo
private _export = format ["Last updated: {{GVI|arma3|%1}}", (productVersion # 2 / 100) toFixed 2] + endl + "{| class=""wikitable sortable"" cellpadding=""0.5em""
! Group
! Category
! Functions";
{ // Config
private _indexConfig = _forEachIndex;
private _nameConfig = _x # 0;
{ // Tags
private _nameTAG = configName _x;
private _valueTAG = getText (_x >> "tag");
if (_valueTAG == "") then { _valueTag = configName _x };
{ // Categories
private _nameCategory = configName _x;
_export = _export + endl + "|-" + endl + "! " + _nameTAG + endl + "! " + _nameCategory + endl + "|";
private _pathCategory = getText (_x >> "file");
{ // Functions
private _prefix = ["BIS_fnc_", "BIN_fnc_"] select (_nameTAG in ["A3_Enoch", "A3_Contact"]);
_export = _export + endl + ": [[" + _prefix + (configName _x) + "]]";
} forEach ((_nameConfig >> "CfgFunctions" >> _nameTAG >> _nameCategory) call BIS_fnc_returnChildren);
} forEach ((_nameConfig >> "CfgFunctions" >> configName _x) call BIS_fnc_returnChildren);
} forEach ((_nameConfig >> "CfgFunctions") call BIS_fnc_returnChildren);
} foreach [[configFile, "configFile"]];
_export = _export + endl + "|}";
copyToClipboard _export;
Arma 3: CfgIdentities
Author: Lou Montana and POLPOX
private _result = [
'{| class="sortable wikitable"',
'! className !! Name !! Note'
];
{
_result pushBack "|-";
_note = ["", "Hidden"] select (getNumber (_x >> "disabled") == 1);
_result pushBack format ["| {{hl|%1}} || %2 || %3", configName _x, getText (_x >> "displayName"), _note];
} forEach ("true" configClasses (configFile >> "CfgFaces" >> "Man_A3"));
_result pushBack "|}";
_result joinString endl;
Arma 3: CfgMarkers
Author: R3vo
// Marker data to biki table
_classes = ("true" configClasses (ConfigFile >> "CfgMarkers"));
_classes = [_classes, [], {configName _x}, "ASCEND"] call BIS_fnc_sortBy;
_export = "{| class=""wikitable - sortable""
|-
! No. !! Class !! Name !! Icon Path !! Shadow !! Scope !! Added with
|-";
{
_addon = _x call ENH_fnc_getConfigSourceAddon params [["_addonClass", ""]];
if (_addonClass isNotEqualTo "") then { _addonClass = format ["{{Icon|%1|24}}", _addonClass] };
_shadow = ["{{Icon|checked}}", "{{Icon|unchecked}}"] select (getNumber (_x >> "shadow"));
_export = _export + endl + "| " + str (_forEachIndex + 1) + "." + " || " + "{{hl|" + configName _x + "}}" + " || " + getText (_x >> "name") + " || " + "{{hl|" + getText (_x >> "icon") + "}}" + " || " + _shadow + " || " + str getNumber (_x >> "scope") + " || " + _addonClass + endl + "|-"
} forEach _classes;
copyToClipboard ((_export trim ["|-", 2]) + "|}");
// Marker icons screenshot
//Create a solid, grey area marker in the editor first. Set its size to 100000x100000
_startPos = [-33000, 20000, 0];
_classes = ("true" configClasses (ConfigFile >> "CfgMarkers"));
_classes = [_classes, [], {configName _x}, "ASCEND"] call BIS_fnc_sortBy;
{
if (_startPos # 0 > 30000) then
{
_startPos set [0, -33000];
_startPos = _startPos vectorAdd [0, -1600, 0];
};
_marker = createMarker [configName _x , _startPos];
_marker setMarkerType configName _x;
_marker setMarkerText format [" %1.", _forEachIndex + 1];
_startPos = _startPos vectorAdd [3500, 0, 0];
} forEach _classes;
Arma 3: CfgMarkerColors
Author: R3vo
private _output = format ["Last updated: {{GVI|arma3|%1}}", (productVersion select 2) / 100] + endl;
_output = _output + "{| class =""wikitable""" + endl + format ["|-%1! %2 !! %3", endl, "Config Name", "RGBA"];
{
private _colour = getArray (_x >> "color") call BIS_fnc_colorConfigToRGBA;
private _colourName = configName _x;
_output = _output + format ["%1|-%1|%2 || %3", endl, _colourName, _colour];
} forEach configProperties [configFile >> "CfgMarkerColors"];
_output = _output + endl + "|}";
copyToClipboard _output;
Arma 3: CfgMusic
Author: Killzone_kid
private _cfgMusic = [];
_cfgMusic pushBack format ["Last updated: {{GVI|arma3|%1}}", ((productVersion select 2) / 100) toFixed 2];
_cfgMusic pushBack "{| class=""wikitable sortable"" width=""100%1""", "%";
_cfgMusic pushBack "! width=""5%"" | No.";
_cfgMusic pushBack "! width=""35%"" | Title";
_cfgMusic pushBack "! width=""30%"" | Class Name";
_cfgMusic pushBack "! width=""15%"" | Duration";
_cfgMusic pushBack "! width=""15%"" | DLC";
_cfgMusic pushBack "";
{
private _name = getText (_x >> "name");
private _duration = getNumber (_x >> "duration");
_duration = round _duration;
private _minutes = floor (_duration / 60);
private _mod = _duration mod 60;
private _seconds = _mod / 1;
_minutesStr = if (_minutes < 10) then { format ["0%1", _minutes] } else { format ["%1", _minutes] };
_secondsStr = if (_seconds < 10) then { format ["0%1", _seconds] } else { format ["%1", _seconds] };
_duration = format ["%1:%2", _minutesStr, _secondsStr];
private _dlc = if (configSourceMod _x == "") then
{
"Arma 3";
}
else
{
format ["%1", (modParams [configSourceMod _x, ["name"]]) select 0];
};
//Some work around to make wiki link work
if (_dlc isEqualTo "[[Arma 3 Contact (Platform)]]") then
{
_dlc = "Arma 3 Contact";
};
if (_dlc isEqualTo "[[Arma 3 Tac-Ops]]") then
{
_dlc = "[[Arma 3 Tac-Ops Mission Pack]]";
};
_cfgMusic pushBack "|-";
_cfgMusic pushBack format ["| %1", _forEachIndex + 1];
_cfgMusic pushBack format ["| %1", if (_name == "") then { "N/A" } else { _name }];
_cfgMusic pushBack format ["| %1", configName _x];
_cfgMusic pushBack format ["| %1", if (_duration == "00:00") then { "N/A" } else { _duration }];
_cfgMusic pushBack format ["| %1", _dlc];
_cfgMusic pushBack "";
} forEach ("isClass _x" configClasses (configFile >> "CfgMusic"));
_cfgMusic pushBack "|}";
copyToClipboard (_cfgMusic joinString toString[10]);
Arma 3: Difficulty Settings
Author: Killzone_kid
"debug_console" callExtension format ["class Difficulties"];
"debug_console" callExtension format ["{"];
_cfg = configFile >> "CfgDifficulties";
{
_class = configName _x;
"debug_console" callExtension format [" class %1", _class];
"debug_console" callExtension format [" {"];
"debug_console" callExtension format [" class Flags"];
"debug_console" callExtension format [" {"];
_flags = _cfg >> _class >> "Flags";
_flagNames = [];
for "_i" from 0 to count _flags - 1 do {
_flag = _flags select _i;
_flagNames pushBack configName _flag;
};
_flagNames sort true;
{
getArray (_flags >> _x) params ["_current", "_canChange"];
if (_canChange == 1) then
{
"debug_console" callExtension format [
" %1 = %2;",
_x, _current];
} else {
"debug_console" callExtension format [
" /* %1 = %2; - cannot be changed */",
_x, _current];
}
} forEach _flagNames;
"debug_console" callExtension format [" };"];
{
"debug_console" callExtension format [
" %1 = %2;",
_x, getNumber(_cfg >> _class >> _x)];
} foreach [
"precisionEnemy",
"precisionFriendly",
"skillEnemy",
"skillFriendly"
];
"debug_console" callExtension format [" };"];
} forEach ("true" configClasses _cfg);
"debug_console" callExtension format ["};"];
Arma 3: Display3DEN IDCs
Author: R3vo
private _sqfTag = "sqf";
private _controls = "{| class=""wikitable sortable""
|-
! Config Name !! IDC !! Config Path" + endl;
private _fnc_scanConfig =
{
params ["_config"];
"true" configClasses _config apply
{
_idc = getNumber (_x >> "idc");
if (_idc > 0) then
{
_controls = _controls + "|-" + endl + "| " + "{{hl|" + configName _x + "}}" + " || " + str _idc + " || " + "<" + _sqfTag + ">" + ([_x, ""] call BIS_fnc_configPath) + "</" + _sqfTag + ">" + endl;
};
_x call _fnc_scanConfig;
};
};
[configFile >> "display3DEN"] call _fnc_scanConfig;
copyToClipboard (_controls + endl + "|}");
Arma 3: Hitpoints
Author: R3vo
//If 3den Enhanced is installed, the script will also fill the "Name" column with available translations
[] spawn
{
startLoadingScreen ["Loading"];
private _hitPoints = [];
{
_veh = configName _x createVehicle [0, 0, 0];
{
_hitpoints pushBackUnique _x;
} forEach (getAllHitPointsDamage _veh # 0);
deleteVehicle _veh;
} forEach ("isClass (_x >> 'HitPoints') && getNumber (_x >> 'Scope') >= 1" configClasses (configFile >> "CfgVehicles"));
_hitpoints sort true;
private _text = "{| class=""wikitable sortable""" + endl +"|-" + endl + "! No. !! Hit Point !! Name";
{
_text = _text + endl + "|-" + endl + "| " + str (_forEachIndex + 1) + " || " + _x + " || " + localize ("STR_ENH_DAMAGE_" + _x);
} forEach _hitpoints;
copyToClipboard (_text + endl + "|}");
systemChat "Data copied!";
endLoadingScreen;
};
Arma 3: Moves
Author: Lou Montana
private _allAnimConfigs = toString { private _name = configName _x; count _name > 7 && { toLowerANSI (_name select [0, 8]) == "cfgmoves" } } configClasses configFile;
private _humanAnimConfigs = _allAnimConfigs select {
private _name = configName _x;
count _name > 11 && { toLowerANSI (_name select [0, 12]) == "cfgmovesmale" }
|| { count _name > 12 && { toLowerANSI (_name select [0, 13]) == "cfgmoveswomen" } }
};
private _humanActions = [];
private _humanStates = [];
{
_humanActions append ("true" configClasses (_x >> "Actions") apply { "* " + configName _x });
_humanStates append ("true" configClasses (_x >> "States") apply { "* " + configName _x });
} forEach _humanAnimConfigs;
private _result = "{{TOC|side||3}}" + endl
+ "== All Human Animations ==" + endl + endl
+ "=== Actions ===" + endl + endl + "{{Columns|2|" + endl + ((_humanActions call BIS_fnc_sortAlphabetically) joinString endl) + endl + "}}" + endl + endl
+ "=== States ===" + endl + endl + "{{Columns|2|" + endl + ((_humanStates call BIS_fnc_sortAlphabetically) joinString endl) + endl + "}}" + endl + endl;
_result = _result + endl + "== All Animations ==" + endl + endl;
{
if (count (_x >> "Actions") + count (_x >> "States") < 1) then { continue };
_result = _result + format ["=== %1 ===", configName _x];
if (count (_x >> "Actions") > 0) then
{
_result = _result + endl + endl + "==== Actions ====" + endl + "{{Columns|2|" + endl + ("true" configClasses (_x >> "Actions") apply { "* " + configName _x } call BIS_fnc_sortAlphabetically joinString endl) + endl + "}}";
};
if (count (_x >> "States") > 0) then
{
_result = _result + endl + endl + "==== States ====" + endl + "{{Columns|2|" + endl + ("true" configClasses (_x >> "States") apply { "* " + configName _x } call BIS_fnc_sortAlphabetically joinString endl) + endl + "}}";
};
_result = _result + endl + endl;
} forEach _allAnimConfigs;
_result = _result + endl + "{{Wiki|extractionScript}}" + endl + endl + "[[Category:Moves]]" + endl + "{{GameCategory|arma3|Reference Lists}}"; // categories
copyToClipboard _result;
Arma 3: createSimpleObject/objects
Author: Lou Montana
private _result = [];
{ _result append addonFiles [_x select 0, ".p3d"] } forEach allAddonsInfo;
copyToClipboard str _result;
Arma 3: createVehicle/vehicles
light version (without hitpoints)
Author: Lou Montana
private _result = "";
"if (getNumber (_x >> 'scope') > 0) then
{
_result = format ['%1* %2\n', _result, configName _x];
}" configClasses (configFile >> "CfgVehicles");
copyToClipboard _result;
_result;
heavy version (with hitpoints)
Author: Killzone_Kid
private _result = "";
toString {
if (getNumber (_x >> "scope") > 0) then
{
_result = _result + "* " + configName _x + "\n";
for "_i" from 0 to count (_x >> "AnimationSources") - 1 do
{
_animSource = (_x >> "AnimationSources") select _i;
_source = getText (_animSource >> "source");
if (_source == "hit") then { _source = "hit [" + getText (_animSource >> "hitpoint") + "]" };
if (_source != "") then { _source = " => " + _source };
_result = _result + ("*# " + configName _animSource + _source) + "\n";
};
}
} configClasses (configFile >> "CfgVehicles");
copyToClipboard _result;
_result;
heavy version (with hidden hitpoints)
Author: Lou Montana from the above one
private _result = "";
private _tagName = "spoiler"; // cannot write the whole tag
private _classes = "getNumber (_x >> 'scope') > 0" configClasses (configFile >> "CfgVehicles");
_classes = [_classes, [], { configName _x }, "ASCEND"] call BIS_fnc_sortBy;
private _currentLetter = "";
private ["_configName", "_letter", "_config", "_animsCount", "_animSource", "_source"];
{
_configName = configName _x;
_letter = toUpperANSI (_configName select [0, 1]);
if (_letter != _currentLetter) then
{
_result = _result + endl + "=== " + _letter + " ===" + endl + endl;
_currentLetter = _letter;
};
_result = _result + "* " + _configName;
_config = (_x >> "AnimationSources");
_animsCount = count _config;
if (_animsCount > 0) then
{
_result = _result + " <" + _tagName + " text= ""Show AnimationSources"">";
for "_i" from 0 to _animsCount - 1 do
{
_animSource = _config select _i;
_source = getText (_animSource >> "source");
if (_source == "hit") then { _source = "hit [" + getText (_animSource >> "hitpoint") + "]" };
if (_source != "") then { _source = " => " + _source };
_result = _result + endl + ("# " + configName _animSource + _source);
};
_result = _result + endl + "</" + _tagName + ">";
};
_result = _result + endl;
} forEach _classes;
_result = trim _result;
copyToClipboard _result;
Arma 3: DLC Restrictions
Author: POLPOX
// use unicode to prevent export error
forceUnicode 0;
// 0: personal equipments 1: vehicles
private _mode = 0;
// create hashmap to check looked models
private _lookedModels = createHashMap;
// get classes
private "_classes";
if (_mode == 0) then
{
// get weapons, equipments, glasses, bags (in CfgVehicles)
_classes = (
toString {
getNumber (_x >> 'scope') == 2 &&
(([configName _x] call BIS_fnc_baseWeapon) == configName _x) &&
getNumber (_x >> 'type') != 65536 &&
!('UnknownEquipment' in (configName _x call BIS_fnc_itemType))
} configClasses (configFile >> "CfgWeapons")
) +
("getNumber (_x >> 'scope') == 2" configClasses (configFile >> "CfgGlasses")) +
("getNumber (_x >> 'scope') == 2 && configName _x isKindOf 'Bag_Base'" configClasses (configFile >> "CfgVehicles"));
};
if (_mode == 1) then
{
// get vehicles, except Men
_classes = ("
getNumber (_x >> 'scope') == 2 &&
(configName _x isKindOf 'AllVehicles' &&
!(configName _x isKindOf 'Man'))
" configClasses (configFile >> "CfgVehicles"));
};
private _data = _classes apply {
private _class = configName _x;
private _model = toLower (call {
// check if the thing is a uniform
if ((getNumber (_x >> "itemInfo" >> "type")) == 801) exitWith
{
getText (_x >> "itemInfo" >> "uniformClass")
};
// normalize model path to prevent errors
private _split = (getText (_x >> "model") splitString "\");
if ((count _split >= 2) && { !(".p3d" in toLower (_split # (count _split-1))) }) then
{
_split set [count _split -1, (_split # (count _split-1)) + ".p3d"];
};
(_split joinString "\")
});
// get DLC info per items
if (isNil { _lookedModels get _model }) then
{
systemChat _class;
// create a simple object and check the DLC via getObjectDLC
private _obj = createSimpleObject [_model, [0, 0, 0]];
private _dlc = getObjectDLC _obj;
// and remove the object. bye-bye
deleteVehicle _obj;
// if it is a part of the base game, -1, otherwise DLC id
if (isNil "_dlc") then
{
_lookedModels set [_model, -1];
[_x, -1]
} else {
_lookedModels set [_model, _dlc];
[_x, _dlc]
};
} else {
// Skip the generation if the model is already checked
systemChat ("simple object generate skipped: " + _class);
[_x, _lookedModels get _model]
};
};
// return value preparation
private _return = [
'{| class="wikitable sortable"',
'|-'
];
if (_mode == 0) then
{
_return pushBack '! Type'
} else {
_return pushBack '! Faction'
};
_return append [
'! classname',
'! displayName',
'! Icon',
'! Restricted?'
];
// code to convert things to things
private _IDtoDLC = {
switch _this do {
case 275700: { "arma3zeus" };
case 288520: { "arma3karts" };
case 304380: { "arma3helicopters" };
case 332350: { "arma3marksmen" };
case 395180: { "arma3apex" };
case 571710: { "arma3lawsofwar" };
case 601670: { "arma3jets" };
case 612480: { "arma3malden" };
case 744950: { "arma3tacops" };
case 798390: { "arma3tanks" };
case 1021790: { "arma3contact" };
case 1325500: { "arma3artofwar" };
default { "" };
};
};
private _DLCToName = {
switch _this do {
case "arma3zeus": { "Zeus" };
case "arma3karts": { "Karts" };
case "arma3helicopters": { "Helicopters" };
case "arma3marksmen": { "Marksmen" };
case "arma3apex": { "Apex" };
case "arma3lawsofwar": { "Laws of War" };
case "arma3jets": { "Jets" };
case "arma3malden": { "Malden" };
case "arma3tacops": { "Tac-Ops" };
case "arma3tanks": { "Tanks" };
case "arma3contact": { "Contact" };
case "arma3artofwar": { "Art of War" };
default { "" };
};
};
private _MODtoDLC = {
switch toLower _this do {
case "curator": { "arma3zeus" };
case "kart": { "arma3karts" };
case "heli": { "arma3helicopters" };
case "mark": { "arma3marksmen" };
case "expansion": { "arma3apex" };
case "orange": { "arma3lawsofwar" };
case "jets": { "arma3jets" };
case "argo": { "arma3malden" };
case "tacops": { "arma3tacops" };
case "tank": { "arma3tanks" };
case "enoch": { "arma3contact" };
case "aow": { "arma3artofwar" };
default { "" };
};
};
{
_x params ["_class", "_dlc"];
private _dlcName = _dlc call _IDtoDLC;
// Make the BG red when is restricted
_return pushBack ("|-" + (["", " style=""background: #EDD; color: #333"""] select (_dlcName != "")));
// Categorize personal equipments
if (_mode == 0) then
{
_return pushBack ("| " + call {
if ((configHierarchy (_x # 0)) # 1 == (configFile >> "CfgWeapons")) exitWith
{
_type = (configName (_x # 0)) call BIS_fnc_itemType;
if (configName (_x select 0) isKindOf ["Rifle", configFile >> "CfgWeapons"]) exitWith { "Rifle" };
if (configName (_x select 0) isKindOf ["Pistol", configFile >> "CfgWeapons"]) exitWith { "Pistol" };
if (configName (_x select 0) isKindOf ["Launcher", configFile >> "CfgWeapons"]) exitWith { "Launcher" };
if (_type # 1 == "GPS") exitWith { "Terminal" };
if (_type # 1 == "UAVTerminal") exitWith { "Terminal" };
if (_type # 1 == "AccessoryMuzzle") exitWith { "Muzzle Attachment" };
if (_type # 1 == "AccessorySights") exitWith { "Sight" };
if (_type # 1 == "AccessoryPointer") exitWith { "Rail Attachment" };
if (_type # 1 == "AccessoryBipod") exitWith { "Bipod" };
if (_type # 1 == "LaserDesignator") exitWith { "Binocular" };
if (_type # 1 == "NVGoggles") exitWith { "NVGs" };
if (_type # 1 == "Radio") exitWith { "Communication" };
if (
_type # 1 == "FirstAidKit" ||
_type # 1 == "Medikit" ||
_type # 1 == "Toolkit" ||
_type # 1 == "MineDetector"
) exitWith { "Item" };
_type # 1
};
if ((configHierarchy (_x # 0)) # 1 == (configFile >> "CfgGlasses")) exitWith
{
"Facewear"
};
if ((configHierarchy (_x # 0)) # 1 == (configFile >> "CfgVehicles") && configName (_x # 0) isKindOf "Bag_Base") exitWith
{
"Backpack"
};
});
} else {
_return pushBack ("| " + getText (configfile >> "CfgFactionClasses" >> (getText (_class >> "faction")) >> "displayName"));
};
_return append [
("| " + configName _class),
("| " + getText (_class >> "displayName"))
];
// DLC Icons
private _MOD = call {
private _return = "";
// emulate Arsenal icons
if (_mode == 0) then
{
private _addon = configSourceAddonList (_x # 0);
private _MOD = configSourceMODList (configFile >> "CfgPatches" >> _addon # 0);
if (count _MOD > 0) then
{
_MOD = _MOD # 0
} else {
_MOD = ""
};
_return = _MOD;
};
// emulate Eden Editor icons
if (_mode == 1) then
{
private _MOD = configSourceMODList (_x # 0);
if (count _MOD > 0) then
{
_MOD = _MOD # 0
} else {
_MOD = ""
};
_return = _MOD;
};
_return;
};
_return pushBack ("| " + (["", format ["{{Icon|%1|25}}", _MOD call _MODtoDLC]] select (_MOD != "")));
if (_dlcName == "") then
{
_return pushBack ("| No");
} else {
_return pushBack ("| " + (_dlcName call _DLCToName));
};
} forEach _data;
_return pushBack "|}";
// and finally done, use joinString to make line breaks and copy
copyToClipboard (_return joinString endl);
Arma 3: Shooting Targets
Author: R3vo
popUpTargets = "{| class=""wikitable""
|-
! Display Name !! Class !! Animation Sources"
{
private _anims = "true" configClasses (_x >> "AnimationSources");
if (_anims isNotEqualTo []) then
{
private _animsStr = "";
{
_animsStr = _animsStr + "{{hl|" + configName _x + "}}" + "<br>" + endl;
} forEach _anims;
popUpTargets = popUpTargets + endl + "|-" + endl + "| " + getText (_x >> "displayName") + " || " + "{{hl|" + configName _x + "}}" + " || " + endl + _animsStr;
};
} forEach ("getNumber (_x >> 'scope') > 1 && getText (_x >> 'editorSubcategory') == 'EdSubcat_Targets'" configClasses (configfile >> "CfgVehicles"));
copyToClipboard (popUpTargets + endl + "|}");
Arma 3: Sound Files
Author: Lou Montana
0 spawn {
private _exts = [".wav", ".wss", ".ogg"];
private _spoilerTagThreshold = 30;
private _extractRadioDubbing = false;
private _addonPaths = allAddonsInfo apply { _x select 0 };
if (!_extractRadioDubbing) then
{
_addonPaths = _addonPaths select { !("dubbing_radio" in _x) };
};
_addonPaths sort true;
{
private _addonPath = _x;
private _files = [];
{
_files append addonFiles [_addonPath, _x];
} forEach _exts;
if (_files isEqualTo []) then { continue };
private _showSpoiler = count _files > _spoilerTagThreshold;
diag_log text "";
diag_log text ("=== " + (_addonPath select [3, count _addonPath - 4]) + " ===");
diag_log text "";
if (_showSpoiler) then { diag_log text ("<" + "spoiler>") };
_files sort true;
{
diag_log text (" """ + _x + """");
} forEach _files;
if (_showSpoiler) then { diag_log text ("</" + "spoiler>") };
} forEach _addonPaths;
};
BIS_fnc_holdActionAdd
Author: Lou Montana
private _result = [];
private _foundPaas = [];
private _splits = [];
{
_foundPaas = addonFiles [_x select 0, ".paa"] select {
_x = toLower _x;
_x = _x splitString "\";
if (count _x > 5 && { _x select 2 == "data" && _x select 3 == "igui" && _x select 5 in ["actions", "holdactions"] }) then
{
true
}
else
{
_x = _x select (count _x - 1);
"action" in _x && { !("faction" in _x) && { !("interaction" in _x) } };
};
};
_result append _foundPaas;
} forEach allAddonsInfo;
copyToClipboard str _result;
CfgGroups
Author: Lou Montana
- Arma 2: CfgGroups↑ Back to spoiler's toplocal _result = ""; local _addLine = { _result = _result + _this + (toString [10]); }; local _maxGroupWidth = 5; local _cfgGroups = configFile >> "CfgGroups"; "{{TOC|horizontal}}" call _addLine; for "_sideindex" from 0 to (count _cfgGroups -1) do { // side level local _sideConfig = _cfgGroups select _sideindex; if (isClass _sideConfig) then { if (_sideindex > 0) then { "" call _addLine; }; "" call _addLine; "== " + getText (_sideConfig >> "name") + " ==" call _addLine; "" call _addLine; "config: " + configName _sideConfig call _addLine; "" call _addLine; for "_factionindex" from 0 to count _sideConfig -1 do { // faction level local _factionConfig = _sideConfig select _factionindex; if (isClass _factionConfig) then { "=== " + getText (_factionConfig >> "name") + " ===" call _addLine; "" call _addLine; "config: " + configName _factionConfig call _addLine; "" call _addLine; "{| class=""wikitable""" call _addLine; for "_grouptypeindex" from 0 to count _factionConfig -1 do { // groupType level local _groupTypeConfig = _factionConfig select _grouptypeindex; if (isClass _groupTypeConfig) then { local _count = 0; for "_cnt" from 0 to count _groupTypeConfig -1 do { if (isClass (_groupTypeConfig select _cnt)) then { _count = _count + 1; }; }; local _groupLines = ceil (_count / _maxGroupWidth); "|- style=""vertical-align: top""" call _addLine; "! style=""vertical-align: middle; white-space: pre""" + (["", format [" rowspan=""%1""", _groupLines]] select (_groupLines > 1)) + " | " + getText (_groupTypeConfig >> "name") call _addLine; "<div style=""font-weight: normal"">config: " + configName _groupTypeConfig + "</div>" call _addLine; local _groupRow = 1; for "_groupindex" from 0 to count _groupTypeConfig -1 do { // group level local _groupConfig = _groupTypeConfig select _groupindex; if (isClass _groupConfig) then { "| <div style=""white-space: pre"">'''" + getText(_groupConfig >> "name") + "'''<br>config: " + configName _groupConfig + "</div>" call _addLine; "Composition:<div style=""" + (["", "columns: 2; "] select (count _groupConfig > 600 /* if needed */)) + "font-size: small"" class=""mw-collapsible mw-collapsed""><div style=""margin-right: 5em; padding-top: 1em"">" call _addLine; for "_unitindex" from 0 to count _groupConfig -1 do { local _unitClass = _groupConfig select _unitindex; if (isClass _unitClass) then { ("# " + getText (_unitClass >> "vehicle")) call _addLine; }; }; "</div></div>" call _addLine; _groupRow = _groupRow + 1; if (_groupRow > _maxGroupWidth) then { "|-" call _addLine; _groupRow = 1; }; }; }; "|-" call _addLine; }; }; "|}" call _addLine; }; }; }; }; "" call _addLine; "" call _addLine; "[[Category: CfgGroups]]" call _addLine; "" call _addLine; copyToClipboard _result; _result;
- Arma 2: Operation Arrowhead: CfgGroups↑ Back to spoiler's toplocal _result = ""; local _addLine = { _result = _result + _this + (toString [10]); }; local _maxGroupWidth = 5; local _cfgGroups = configFile >> "CfgGroups"; "{{TOC|horizontal|||y}}" call _addLine; for "_sideindex" from 0 to (count _cfgGroups -1) do { // side level local _sideConfig = _cfgGroups select _sideindex; if (isClass _sideConfig) then { if (_sideindex > 0) then { "" call _addLine; }; "" call _addLine; "== " + getText (_sideConfig >> "name") + " ==" call _addLine; "" call _addLine; "config: " + configName _sideConfig call _addLine; "" call _addLine; for "_factionindex" from 0 to count _sideConfig -1 do { // faction level local _factionConfig = _sideConfig select _factionindex; if (isClass _factionConfig) then { "=== " + getText (_factionConfig >> "name") + " ===" call _addLine; "" call _addLine; "config: " + configName _factionConfig call _addLine; "" call _addLine; "{| class=""wikitable""" call _addLine; for "_grouptypeindex" from 0 to count _factionConfig -1 do { // groupType level local _groupTypeConfig = _factionConfig select _grouptypeindex; if (isClass _groupTypeConfig) then { local _count = 0; for "_cnt" from 0 to count _groupTypeConfig -1 do { if (isClass (_groupTypeConfig select _cnt)) then { _count = _count + 1; }; }; local _groupLines = ceil (_count / _maxGroupWidth); "|- style=""vertical-align: top""" call _addLine; "! style=""vertical-align: middle; white-space: pre""" + (["", format [" rowspan=""%1""", _groupLines]] select (_groupLines > 1)) + " | " + getText (_groupTypeConfig >> "name") call _addLine; "<div style=""font-weight: normal"">config: " + configName _groupTypeConfig + "</div>" call _addLine; local _groupRow = 1; for "_groupindex" from 0 to count _groupTypeConfig -1 do { // group level local _groupConfig = _groupTypeConfig select _groupindex; if (isClass _groupConfig) then { "| <div style=""white-space: pre"">'''" + getText(_groupConfig >> "name") + "'''<br>config: " + configName _groupConfig + "</div>" call _addLine; "Composition:<div style=""" + (["", "columns: 2; "] select (count _groupConfig > 600 /* if needed */)) + "font-size: small"" class=""mw-collapsible mw-collapsed""><div style=""margin-right: 5em; padding-top: 1em"">" call _addLine; for "_unitindex" from 0 to count _groupConfig -1 do { local _unitClass = _groupConfig select _unitindex; if (isClass _unitClass) then { ("# " + getText (_unitClass >> "vehicle")) call _addLine; }; }; "</div></div>" call _addLine; _groupRow = _groupRow + 1; if (_groupRow > _maxGroupWidth) then { "|-" call _addLine; _groupRow = 1; }; }; }; "|-" call _addLine; }; }; "|}" call _addLine; }; }; }; }; "" call _addLine; "" call _addLine; "[[Category: CfgGroups]]" call _addLine; "" call _addLine; copyToClipboard _result; _result;
- Arma 3: CfgGroups↑ Back to spoiler's topprivate _lines = []; private _maxGroupWidth = 5; private _groupSides = "true" configClasses (configFile >> "CfgGroups"); // _lines pushBack "" + (_groupSides apply { format ["%1", getText (_x >> "name")] } joinString "") + ""; _lines pushBack "{{TOC|horizontal|||y}}"; { // side level if (_forEachIndex > 0) then { _lines pushBack ""; }; _lines pushBack ""; _lines pushBack "== " + getText (_x >> "name") + " =="; _lines pushBack ""; _lines pushBack "config: " + configName _x; _lines pushBack ""; private _factions = "true" configClasses _x; { // faction level _lines pushBack "=== " + getText (_x >> "name") + " ==="; _lines pushBack ""; _lines pushBack "config: " + configName _x; _lines pushBack ""; _lines pushBack "{| class=""wikitable"""; private _groupTypes = "true" configClasses _x; { // groupType level private _groups = "true" configClasses _x; private _groupLines = ceil (count _groups / _maxGroupWidth); _lines pushBack "|- style=""vertical-align: top"""; _lines pushBack "! style=""vertical-align: middle; white-space: pre""" + (["", format [" rowspan=""%1""", _groupLines]] select (_groupLines > 1)) + " | " + getText (_x >> "name"); _lines pushBack "<div style=""font-weight: normal"">config: " + configName _x + "</div>"; private _groupRow = 1; { // group level _lines pushBack "| <div style=""white-space: pre"">'''" + getText(_x >> "name") + "'''<br>config: " + configName _x + "</div>"; private _units = "true" configClasses _x; _lines pushBack "Composition:<div style=""" + (["", "columns: 2; "] select (count _units > 600 /* if needed */)) + "font-size: small"" class=""mw-collapsible mw-collapsed""><div style=""margin-right: 5em; padding-top: 1em"">"; { _lines pushBack ("# " + getText (_x >> "vehicle")); } forEach _units; _lines pushBack "</div></div>"; _groupRow = _groupRow + 1; if (_groupRow > _maxGroupWidth) then { _lines pushBack "|-"; _groupRow = 1; } } forEach _groups; _lines pushBack "|-"; } forEach _groupTypes; _lines pushBack "|}"; } forEach _factions; } forEach _groupSides; _lines pushBack ""; _lines pushBack ""; _lines pushBack "[[Category: CfgGroups]]"; _lines pushBack ""; private _result = _lines joinString endl; copyToClipboard _result; _result;
CfgWorlds/Group*
Author: Killzone Kid
"if ((configName _x) select [0, 5] == 'group') then
{
diag_log ('%' + configName _x);
for '_i' from 0 to count _x - 1 do {
diag_log ('* ""' + configName (_x select _i) + '"" &rarr; ' + getText ((_x select _i) >> "name"));
};
}; false" configClasses (configFile >> "CfgWorlds");
inputAction/actions
Author: POLPOX
_r = [];
{
_r pushBack [getText (_x >> "name"), []];
_index = _forEachIndex;
{
private _actionName = actionName _x;
(_r # _index # 1) pushBack [_x, _actionName];
} forEach getArray (_x >> "group");
} forEach ("true" configClasses (configFile >> "UserActionGroups"));
_rFinal = [
'{| class="sortable wikitable"'
];
_presets = ("configName _x != 'Empty'" configClasses (configFile >> "CfgDefaultKeysPresets"));
_str = '! Type !! actionName !! Name';
{
_str = _str + " !! " + getText (_x >> "displayName");
if (getNumber (_x >> "default") == 1) then
{
_str = _str + "<br/>(Default)";
};
} forEach _presets;
_rFinal pushBack format ['! colspan="3" | Action information !! colspan="%1" | Presets', count _presets];
_rFinal pushBack "|-";
_rFinal pushBack _str;
{
_type = _x # 0;
{
_rFinal pushBack "|-";
_x params ["_actionName", "_name"/*, "_tooltip"*/];
if (_name isEqualTo "") then
{
_name = "{{n/a}}";
};
_str = format ["| %1 || {{hl|%2}} || %3 ", _type, _actionName, _name];
{
_keys = getArray (_x >> "Mappings" >> _actionName);
if (count _keys != 0) then
{
_keys = _keys apply {
call {
if (typeName _x == "STRING") exitWith
{
keyName call compile _x;
};
if (typeName _x == "ARRAY") exitWith
{
_r = [];
{
if (typeName _x == "STRING") then
{
_r pushBack ((keyName call compile _x) splitString """") # 0;
};
_r pushBack ((keyName _x) splitString """") # 0;
} forEach _x;
_r = (_r joinString "+");
_r
};
keyName _x
};
};
_str = _str + format ["|| %1 ", (_keys joinString ", " splitString """") # 0];
} else {
_str = _str + "|| ";
};
} forEach _presets;
_rFinal pushBack _str;
} forEach (_x # 1);
} forEach _r;
_rFinal pushBack "|}";
copyToClipboard (_rFinal joinString endl);
Mission Parameters
Author: Lou Montana
private _addLine = { _result = _result + _this + endl; };
private _result = "";
if (not isNull getMissionConfig "titleParam1") then
{
("titleParam1 = """ + getText getMissionConfig "titleParam1" + """; // " + getTextRaw ("titleParam1")) call _addLine;
("textsParam1[] = { """ + (getArray (getMissionConfig "textsParam1") joinString """, """) + """ };") call _addLine;
("valuesParam1[] = { " + (getArray (getMissionConfig "valuesParam1") joinString ", ") + " };") call _addLine;
("defValueParam1 = " + str getNumber getMissionConfig "defValueParam1" + ";") call _addLine;
};
if (not isNull getMissionConfig "titleParam2") then
{
("titleParam2 = """ + getText getMissionConfig "titleParam2" + """; // " + getTextRaw ("titleParam2")) call _addLine;
("textsParam2[] = { """ + (getArray (getMissionConfig "textsParam2") joinString """, """) + """ };") call _addLine;
("valuesParam2[] = { " + (getArray (getMissionConfig "valuesParam2") joinString ", ") + " };") call _addLine;
("defValueParam2 = " + str getNumber getMissionConfig "defValueParam2" + ";") call _addLine;
};
if (not isNull getMissionConfig "Params") then
{
{
("class " + configName _x) call _addLine;
"{" call _addLine;
(" title = """ + getText (_x >> "title") + """; // " + getTextRaw (_x >> "title")) call _addLine;
(" texts[] = { """ + (getArray (_x >> "texts") joinString """, """) + """ };") call _addLine;
(" values[] = { " + (getArray (_x >> "values") joinString ", ") + " };") call _addLine;
(" default = " + str getNumber (_x >> "default")) call _addLine;
"};" call _addLine;
} forEach ("true" configClasses getMissionConfig "Params");
};
copyToClipboard _result;
systemChat "Mission Params copied to clipboard";
Modules
Author: R3vo
private _version = format ["Last updated: {{GVI|arma3|%1}}", (productVersion # 2 / 100) toFixed 2];
private _counter = 0;
private _export = _version + endl + "{| class=""wikitable""" + endl + "! Module Name !! Category !! Addon !! Function !! Description" + endl + "|-" + endl;
private _modules = "(configName inheritsFrom _x) == 'Module_F'" configClasses (configFile >> "CfgVehicles");
{
if ((getNumber (_x >> "scope") > 1)) then
{
private _name = getText (_x >> "displayName");
private _cat = getText (_x >> "category");
private _mod = configSourceMod _x;
private _fnc = getText (_x >> "function");
if !(_fnc isEqualTo "") then
{
_fnc = _fnc select [7];
_fnc = "[[BIS_fnc" + _fnc + "]]";
};
private _desc = getText (_x >> "ModuleDescription" >> "Description");
if (_desc isEqualTo "") then { _desc = "" };
if (_mod == "") then { _mod = "A3" };
private _modName = modParams [_mod, ["name"]];
_modName = _modName select 0;
_cat = getText (configFile >> "CfgFactionClasses" >> _cat >> "displayName");
if (_cat isEqualTo "") then { _cat = "Others" };
_export = _export + "| " + _name + endl + "| " + _cat + endl + "| " + _modName + endl + "| " + _fnc + endl + "| " + _desc + endl + "|-" + endl;
};
_counter = _counter + 1;
} forEach _modules;
_export = _export + "|}" + endl + format ["Total number of modules: %1", _counter];
copyToClipboard _export;
nearestTerrainObjects
Author: R3vo
[] spawn
{
private _types = ["TREE", "SMALL TREE", "BUSH", "BUILDING", "HOUSE", "FOREST BORDER", "FOREST TRIANGLE", "FOREST SQUARE", "CHURCH", "CHAPEL",
"CROSS", "BUNKER", "FORTRESS", "FOUNTAIN", "VIEW-TOWER", "LIGHTHOUSE", "QUAY", "FUELSTATION", "HOSPITAL", "FENCE", "WALL", "HIDE", "BUSSTOP",
"ROAD", "FOREST", "TRANSMITTER", "STACK", "RUIN", "TOURISM", "WATERTOWER", "TRACK", "MAIN ROAD", "ROCK", "ROCKS", "POWER LINES", "RAILWAY",
"POWERSOLAR", "POWERWAVE", "POWERWIND", "SHIPWRECK", "TRAIL"];
_types sort true;
private _counts = [];
private _countTypes = count _types;
["R3vo_GetNearestTerrainObjects", ""] call BIS_fnc_startLoadingScreen;
{
private _terrainObjects = nearestTerrainObjects [
[worldSize / 2, worldSize / 2],
[_x],
worldSize / 2 * sqrt 2,
false
];
if (count _terrainObjects > 0) then
{
_counts pushBack [_x, count _terrainObjects toFixed 0];
};
((_forEachIndex + 1) / _countTypes) call BIS_fnc_progressLoadingScreen;
} forEach _types;
"R3vo_GetNearestTerrainObjects" call BIS_fnc_endLoadingScreen;
private _export = "<big>[[" + getText (configFile >> "CfgWorlds" >> worldName >> "description") + "]]</big>" + endl + "{{Columns|5|";
{
_export = _export + endl + "* " + (_x # 0) + ": " + (_x # 1);
} forEach _counts;
_export = _export + endl + "}}";
copyToClipboard _export;
};
Side Relations
Author: Lou Montana
private _func = BIS_fnc_sideIsFriendly; // change here with BIS_fnc_sideIsEnemy for the other table
private _sidesAsString = ["east", "west", "resistance", "civilian", "sideAmbientLife", "sideUnknown", "sideEnemy", "sideFriendly", "sideEmpty", "sideLogic"];
private _sideResults = [];
{
private _sideAsString = _x;
private _side = call compile _sideAsString;
_sideResults pushBack ([_sideAsString] + (_sidesAsString apply { [_side, call compile _x] call _func }));
} forEach _sidesAsString;
private _result = "{| class=""wikitable align-center""\n|-\n";
{
_result = _result + "! [[" + _x +"]]\n";
} forEach _sidesAsString;
{
private _results = _x;
{
if (_x isEqualType true) then
{
if (_x) then
{
_result = _result + "| {{Icon|checked}}\n";
}
else
{
_result = _result + "| {{Icon|unchecked}}\n";
}
}
else
{
_result = _result + ("| [[" + _x + "]]\n");
}
} forEach _results;
_result = _result + "|-\n";
} forEach _sideResults;
_result = _result + "|}";
_result;