Difference between revisions of "Module:UnitData/doc"
(Created page with "This module is used to autogenerate unit infoboxes by drawing data from Module:UnitData/data. The intent is to ease updating of unit infoboxes on the wiki; ideally, only t...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | <includeonly>:'''''[[Module:UnitData/doc|Documentation]]'''''</includeonly> | ||
This module is used to autogenerate unit infoboxes by drawing data from [[Module:UnitData/data]]. The intent is to ease updating of unit infoboxes on the wiki; ideally, only the one data page needing to be changed every release. The concept is taken from e.g. the [https://library-of-ruina.fandom.com/wiki/Module:CombatCardData Combat Card Data module] on the ''Library of Ruina'' Wiki. | This module is used to autogenerate unit infoboxes by drawing data from [[Module:UnitData/data]]. The intent is to ease updating of unit infoboxes on the wiki; ideally, only the one data page needing to be changed every release. The concept is taken from e.g. the [https://library-of-ruina.fandom.com/wiki/Module:CombatCardData Combat Card Data module] on the ''Library of Ruina'' Wiki. | ||
Line 9: | Line 10: | ||
}} | }} | ||
</pre> | </pre> | ||
+ | |||
+ | The module can also be invoked directly to generate an infobox (note that output may not be identical in some cases; observed with automatic detection of buildpic on [[Reef]]): | ||
+ | <pre> | ||
+ | {{#invoke:UnitData|printInfobox|defname=striderdetriment|name=Name override}} | ||
+ | </pre> | ||
+ | When invoking from module, <code>defname</code> may be passed as an anonymous parameter instead. | ||
+ | |||
+ | See also [[Module:WeaponData]], which is used to generate the weapon infoboxes within the unit infoboxes. | ||
== Data page == | == Data page == | ||
{{Module:UnitData/data/doc}} | {{Module:UnitData/data/doc}} |
Latest revision as of 20:23, 11 May 2024
This module is used to autogenerate unit infoboxes by drawing data from Module:UnitData/data. The intent is to ease updating of unit infoboxes on the wiki; ideally, only the one data page needing to be changed every release. The concept is taken from e.g. the Combat Card Data module on the Library of Ruina Wiki.
This module is currently used with Template:Autoinfobox zkunit as follows:
{{Autoinfobox zkunit |defname=striderdetriment |name=Name override }}
The module can also be invoked directly 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.
See also Module:WeaponData, which is used to generate the weapon infoboxes within the unit infoboxes.
Data page
Module:UnitData/data is a central store of data used by Module:UnitData to automatically populate unit infoboxes.
The page is a Lua table written to the local file temp/unitStats.lua
by the Wiki Data Export (dbg_wiki_export.lua
) widget in Zero-K. This widget should be run once each update and the data page on the wiki replaced accordingly. It should not be necessary to edit the data manually.