Difference between revisions of "User:VKing/Sandbox"

From UOAF Codex
Jump to navigation Jump to search
Line 1: Line 1:
{{Mbox
+
<noinclude>{{Mbox
 
|text = This page is a sandbox for prototyping articles and testing syntax.
 
|text = This page is a sandbox for prototyping articles and testing syntax.
 
|type = notice
 
|type = notice
 
}}
 
}}
<!-- Edit below this line -->
+
<!-- Edit below this line --></noinclude>
==SQF==
+
==={{{title}}}===
<syntaxhighlight lang="sqf">
 
// #define DEBUG_MODE_FULL
 
#include "script_component.hpp"
 
  
PARAMS_1(_unit);
+
<div>
 
+
{| class="wikitable" style="width:100%;"
private ["_markerData","_markerArray","_killedType","_pos","_dummy"];
+
|-
 
+
|align=right style="width:150px;"| '''Author''' ||  {{{author}}}
[fnord] call BIS_fnc_arrayPop;
+
|-
 
+
|align=right| '''Echelon''' || {{{echelon}}}
_markerData = _unit getVariable QGVAR(markerData);
+
|-
_markerArray = _unit getVariable QGVAR(markerArray);
+
|align=right| '''Slots/Personnel''' || {{{slots}}}
_killedType = _unit getVariable QGVAR(killedType);
+
|-
_bft = _unit getVariable QGVAR(markerBFT);
+
|align=right| '''Era''' || {{{era}}}
 
+
|-
if (isNil "_markerData") exitWith {
+
|align=right | '''Download''' || {{{download}}}
TRACE_1("No markerData for unit",_unit);
+
|-
if (!isNil "_markerArray") exitWith {
+
|align=right | '''Sources''' || {{{sources}}}
_unit setVariable [QGVAR(markerArray),nil,true];
+
|-
};
+
|align=right| '''Description''' || <div class="mw-collapsible mw-collapsed" style="float:left;">{{{description}}}</div>
};
+
|}
if (isNil "_markerArray") exitWith {
+
</div>
TRACE_1("No markerArray for unit",_unit);
+
<noinclude>This template is for for use in any unit template articles/lists. Explanation will be added soon.</noinclude>
_unit setVariable [QGVAR(markerData),nil,true];
 
};
 
 
 
EXPLODE_7(_markerData,_name,_mods,_type,_size,_scale,_visibleTo,_text);
 
_pos = getPos _unit;
 
 
 
if (isNil "_killedType") then {
 
_killedType = GVAR(gKilledType);
 
};
 
TRACE_2("",_killedType,_bft);
 
</syntaxhighlight>
 
 
 
<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);
 
 
 
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 11:59, 11 January 2015

{{#invoke:Message box|mbox}}

{{{title}}}

Author {{{author}}}
Echelon {{{echelon}}}
Slots/Personnel {{{slots}}}
Era {{{era}}}
Download {{{download}}}
Sources {{{sources}}}
Description
{{{description}}}

This template is for for use in any unit template articles/lists. Explanation will be added soon.