Difference between revisions of "User:VKing/Sandbox"

From UOAF Codex
Jump to navigation Jump to search
m
(SQF syntax test)
Line 4: Line 4:
 
}}
 
}}
 
<!-- Edit below this line -->
 
<!-- Edit below this line -->
[[File:vk markers example.jpg|thumb|right|Examples of markers that can be created]]The '''APP-6A NATO markers''' addon made by [[User:VKing|VKing]] is made to extend the amount of military unit types that can be represented in [[:Category:ArmA 3|Arma]] without adding an unmanageable amount of markers to the game. It functions by overlaying several markers on the map, each representing a function of unit the combined marker represents.
+
==SQF==
 +
<syntaxhighlight lang="sqf">
 +
// #define DEBUG_MODE_FULL
 +
#include "script_component.hpp"
  
....
+
PARAMS_4(_name,_unit,_type,_mods);
 +
DEFAULT_PARAM(4,_groupSize,-1);
 +
DEFAULT_PARAM(5,_scale,1);
 +
DEFAULT_PARAM(6,_visibleTo,nil);
 +
DEFAULT_PARAM(7,_text,"");
 +
DEFAULT_PARAM(8,_bft,false);
  
[[User:Verox|Verox]] has created a tool for generating marker code. It is available [http://www.unitedoperations.net/tools/vk_markers/ here].
+
private ["_pos","_data"];
  
<!-- [[Category:ArmA 3]] [[Category:ArmA 3 Modpack]] -->
+
// Alternate spellings
 +
{
 +
switch (_x) do {
 +
case "infantry": {_mods set [_foreachIndex, "inf"]};
 +
case "armour": {_mods set [_foreachIndex, "armor"]};
 +
case "motorized": {_mods set [_foreachIndex, "motor"]};
 +
case "artillery": {_mods set [_foreachIndex, "arty"]};
 +
case "engineer": {_mods set [_foreachIndex, "eng"]};
 +
case "unitair": {_mods set [_foreachIndex, "airunit"]};
 +
case "airvehicle": {_mods set [_foreachIndex, "airunit"]};
 +
case "unitland": {_mods set [_foreachIndex, "landunit"]};
 +
};
 +
} forEach _mods;
 +
 
 +
// Air unit markers
 +
if ("airunit" in _mods) then {
 +
if ("fixed" in _mods) then {
 +
REM(_mods,"fixed");
 +
};
 +
if (!("rotary" in _mods) && "attack" in _mods) then {
 +
REM(_mods,"attack");
 +
PUSH(_mods,"fattack");
 +
};
 +
if (!("rotary" in _mods) && "cargo" in _mods) then {
 +
REM(_mods,"cargo");
 +
PUSH(_mods,"fcargo");
 +
};
 +
if (!("rotary" in _mods) && "uav" in _mods) then {
 +
REM(_mods,"uav");
 +
PUSH(_mods,"fuav");
 +
};
 +
};
 +
</syntaxhighlight>
 +
 
 +
==CPP==
 +
<syntaxhighlight lang="cpp">
 +
// #define DEBUG_MODE_FULL
 +
#include "script_component.hpp"
 +
 
 +
PARAMS_4(_name,_unit,_type,_mods);
 +
DEFAULT_PARAM(4,_groupSize,-1);
 +
DEFAULT_PARAM(5,_scale,1);
 +
DEFAULT_PARAM(6,_visibleTo,nil);
 +
DEFAULT_PARAM(7,_text,"");
 +
DEFAULT_PARAM(8,_bft,false);
 +
 
 +
private ["_pos","_data"];
 +
 
 +
// Alternate spellings
 +
{
 +
switch (_x) do {
 +
case "infantry": {_mods set [_foreachIndex, "inf"]};
 +
case "armour": {_mods set [_foreachIndex, "armor"]};
 +
case "motorized": {_mods set [_foreachIndex, "motor"]};
 +
case "artillery": {_mods set [_foreachIndex, "arty"]};
 +
case "engineer": {_mods set [_foreachIndex, "eng"]};
 +
case "unitair": {_mods set [_foreachIndex, "airunit"]};
 +
case "airvehicle": {_mods set [_foreachIndex, "airunit"]};
 +
case "unitland": {_mods set [_foreachIndex, "landunit"]};
 +
};
 +
} forEach _mods;
 +
 
 +
// Air unit markers
 +
if ("airunit" in _mods) then {
 +
if ("fixed" in _mods) then {
 +
REM(_mods,"fixed");
 +
};
 +
if (!("rotary" in _mods) && "attack" in _mods) then {
 +
REM(_mods,"attack");
 +
PUSH(_mods,"fattack");
 +
};
 +
if (!("rotary" in _mods) && "cargo" in _mods) then {
 +
REM(_mods,"cargo");
 +
PUSH(_mods,"fcargo");
 +
};
 +
if (!("rotary" in _mods) && "uav" in _mods) then {
 +
REM(_mods,"uav");
 +
PUSH(_mods,"fuav");
 +
};
 +
};
 +
</syntaxhighlight>

Revision as of 15:25, 26 December 2014

{{#invoke:Message box|mbox}}

SQF

<syntaxhighlight lang="sqf"> // #define DEBUG_MODE_FULL

  1. include "script_component.hpp"

PARAMS_4(_name,_unit,_type,_mods); DEFAULT_PARAM(4,_groupSize,-1); DEFAULT_PARAM(5,_scale,1); DEFAULT_PARAM(6,_visibleTo,nil); DEFAULT_PARAM(7,_text,""); DEFAULT_PARAM(8,_bft,false);

private ["_pos","_data"];

// Alternate spellings { switch (_x) do { case "infantry": {_mods set [_foreachIndex, "inf"]}; case "armour": {_mods set [_foreachIndex, "armor"]}; case "motorized": {_mods set [_foreachIndex, "motor"]}; case "artillery": {_mods set [_foreachIndex, "arty"]}; case "engineer": {_mods set [_foreachIndex, "eng"]}; case "unitair": {_mods set [_foreachIndex, "airunit"]}; case "airvehicle": {_mods set [_foreachIndex, "airunit"]}; case "unitland": {_mods set [_foreachIndex, "landunit"]}; }; } forEach _mods;

// Air unit markers if ("airunit" in _mods) then { if ("fixed" in _mods) then { REM(_mods,"fixed"); }; if (!("rotary" in _mods) && "attack" in _mods) then { REM(_mods,"attack"); PUSH(_mods,"fattack"); }; if (!("rotary" in _mods) && "cargo" in _mods) then { REM(_mods,"cargo"); PUSH(_mods,"fcargo"); }; if (!("rotary" in _mods) && "uav" in _mods) then { REM(_mods,"uav"); PUSH(_mods,"fuav"); }; }; </syntaxhighlight>

CPP

<syntaxhighlight lang="cpp"> // #define DEBUG_MODE_FULL

  1. include "script_component.hpp"

PARAMS_4(_name,_unit,_type,_mods); DEFAULT_PARAM(4,_groupSize,-1); DEFAULT_PARAM(5,_scale,1); DEFAULT_PARAM(6,_visibleTo,nil); DEFAULT_PARAM(7,_text,""); DEFAULT_PARAM(8,_bft,false);

private ["_pos","_data"];

// Alternate spellings { switch (_x) do { case "infantry": {_mods set [_foreachIndex, "inf"]}; case "armour": {_mods set [_foreachIndex, "armor"]}; case "motorized": {_mods set [_foreachIndex, "motor"]}; case "artillery": {_mods set [_foreachIndex, "arty"]}; case "engineer": {_mods set [_foreachIndex, "eng"]}; case "unitair": {_mods set [_foreachIndex, "airunit"]}; case "airvehicle": {_mods set [_foreachIndex, "airunit"]}; case "unitland": {_mods set [_foreachIndex, "landunit"]}; }; } forEach _mods;

// Air unit markers if ("airunit" in _mods) then { if ("fixed" in _mods) then { REM(_mods,"fixed"); }; if (!("rotary" in _mods) && "attack" in _mods) then { REM(_mods,"attack"); PUSH(_mods,"fattack"); }; if (!("rotary" in _mods) && "cargo" in _mods) then { REM(_mods,"cargo"); PUSH(_mods,"fcargo"); }; if (!("rotary" in _mods) && "uav" in _mods) then { REM(_mods,"uav"); PUSH(_mods,"fuav"); }; }; </syntaxhighlight>