Difference between revisions of "Template:Autoinfobox zkunit"

From Zero-K
Jump to navigation Jump to search
(First draft)
 
m (Fix)
Line 3: Line 3:
 
{{ Infobox zkunit
 
{{ Infobox zkunit
 
<!-- Required fields -->
 
<!-- Required fields -->
defname = {{{defname}}}
+
|defname = {{{defname}}}
name = {{{name|{{#invoke:UnitData|getData|{{{defname}}}|name}}}}}
+
|name = {{{name|{{#invoke:UnitData|getData|{{{defname}}}|name}}}}}
 
<!-- Optional fields -->
 
<!-- Optional fields -->
unitname =  
+
|unitname =  
description = {{{description|{{#invoke:UnitData|getData|{{{defname}}}|description}}}}}
+
|description = {{{description|{{#invoke:UnitData|getData|{{{defname}}}|description}}}}}
image = {{{image|}}}
+
|image = {{{image|}}}
icontype = {{{icontype|{{#invoke:UnitData|getData|{{{defname}}}|icontype}}}}}
+
|icontype = {{{icontype|{{#invoke:UnitData|getData|{{{defname}}}|icontype}}}}}
cost = {{{cost|{{#invoke:UnitData|getData|{{{defname}}}|cost}}}}}
+
|cost = {{{cost|{{#invoke:UnitData|getData|{{{defname}}}|cost}}}}}
hitpoints = {{{hitpoints|{{#invoke:UnitData|getData|{{{defname}}}|hitpoints}}}}}
+
|hitpoints = {{{hitpoints|{{#invoke:UnitData|getData|{{{defname}}}|hitpoints}}}}}
mass = {{{mass|{{#invoke:UnitData|getData|{{{defname}}}|mass}}}}}
+
|mass = {{{mass|{{#invoke:UnitData|getData|{{{defname}}}|mass}}}}}
movespeed = {{{mass|{{#invoke:UnitData|getData|{{{defname}}}|mass}}}}}
+
|movespeed = {{{mass|{{#invoke:UnitData|getData|{{{defname}}}|mass}}}}}
turnrate = {{{turnrate|{{#invoke:UnitData|getData|{{{defname}}}|turnrate}}}}}
+
|turnrate = {{{turnrate|{{#invoke:UnitData|getData|{{{defname}}}|turnrate}}}}}
energy = {{{energy|{{#invoke:UnitData|getData|{{{defname}}}|energy}}}}}
+
|energy = {{{energy|{{#invoke:UnitData|getData|{{{defname}}}|energy}}}}}
sight = {{{sight|{{#invoke:UnitData|getData|{{{defname}}}|sight}}}}}
+
|sight = {{{sight|{{#invoke:UnitData|getData|{{{defname}}}|sight}}}}}
sonar = {{{sonar|{{#invoke:UnitData|getData|{{{defname}}}|sonar}}}}}
+
|sonar = {{{sonar|{{#invoke:UnitData|getData|{{{defname}}}|sonar}}}}}
transportable = {{{transportable|{{#invoke:UnitData|getData|{{{defname}}}|transportable}}}}}
+
|transportable = {{{transportable|{{#invoke:UnitData|getData|{{{defname}}}|transportable}}}}}
altitude = {{{altitude|{{#invoke:UnitData|getData|{{{defname}}}|altitude}}}}}
+
|altitude = {{{altitude|{{#invoke:UnitData|getData|{{{defname}}}|altitude}}}}}
gridlink = {{{gridlink|{{#invoke:UnitData|getData|{{{defname}}}|gridlink}}}}}
+
|gridlink = {{{gridlink|{{#invoke:UnitData|getData|{{{defname}}}|gridlink}}}}}
  
abilities =
+
|abilities =
 
<!-- Get Template:Infobox zkability ### -->
 
<!-- Get Template:Infobox zkability ### -->
weapons =
+
|weapons =
 
<!-- Get Template:Infobox zkweapon -->
 
<!-- Get Template:Infobox zkweapon -->
 
}}
 
}}

Revision as of 20:35, 10 May 2024


Template documentation[view] [edit] [history] [purge]

This template uses Module:UnitData to autogenerate unit infoboxes, transcluding and filling in Template:Infobox zkunit data from Module:UnitData/data. Specific tags can be overridden by manually specifying them, if necessary.

Example usage:

{{Autoinfobox zkunit
|defname=striderdetriment
|name=Name override
}}

The module can also be invoked directly without this template to generate an infobox (note that output may not be identical in some cases; observed with automatic detection of buildpic on Reef):

{{#invoke:UnitData|printInfobox|defname=striderdetriment|name=Name override}}

When invoking from module, defname may be passed as an anonymous parameter instead.

For more information, see the module page.