Jump to content

Template:Module: Difference between revisions

From The Perfect Tower II
Archercatneo4 (talk | contribs)
No edit summary
Release 1d: module data and number format
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[File:{{{Info}}} Module.png|{{{Info}}}|{{{size|x30px}}}|alt={{{Info}}} Module]]<noinclude>
{{#if:{{{id|}}}{{{name|}}}|{{#invoke:ModuleView|main}}|[[File:{{{1}}} Module.png|{{{1}}}|{{{size|x30px}}}|alt={{{1}}} Module]]}}<noinclude>
Shows a module from the game. With <code>id</code> or <code>name</code>, the facts come from the game's own data and update with every game version, so nobody has to copy them by hand. Without them, it shows a category icon, as before.
 
{| class="wikitable"
! Code !! Shows
|-
| <code><nowiki>{{Module|id=boost.neutral}}</nowiki></code> || {{Module|id=boost.neutral}}
|-
| <code><nowiki>{{Module|name=Stampede|view=compact}}</nowiki></code> || {{Module|name=Stampede|view=compact}}
|-
| <code><nowiki>{{Module|Offensive|size=30px}}</nowiki></code> || {{Module|Offensive|size=30px}}
|}
 
<pre>{{Module|id=stampede.goats|view=full}}</pre>
{{Module|id=stampede.goats|view=full}}
 
A module's id is in the [https://www.perfecttower2.com/tools/modules/ module database]: open the module, and the id is the part of the address after <code>#</code>. Names work too, in any case. A module the game doesn't have shows "Unknown module" and puts the page in [[:Category:Pages with unknown modules]].
 
<templatedata>
<templatedata>
{
{
"description": "A module from the game: its name, a card or a full panel, from the game's own data. Without id or name, a category icon.",
"format": "inline",
"params": {
"params": {
"Info": {
"id": {
"label": "Type",
"label": "Module id",
"description": "The type (offensive, defensive, utility, ultimate, special)",
"description": "The module's id, as in the module database",
"example": "boost.neutral",
"type": "string",
"suggested": true
},
"name": {
"label": "Module name",
"description": "The module's name in the game, instead of the id",
"example": "Anti-Neutral Projectiles",
"type": "string"
},
"view": {
"label": "View",
"description": "icon: the name in the text; compact: a card; full: a panel with the description, numbers and tags",
"suggestedvalues": ["icon", "compact", "full"],
"default": "icon",
"type": "string"
},
"text": {
"label": "Text",
"description": "Text to show instead of the module's name",
"type": "string"
},
"link": {
"label": "Wiki page",
"description": "Link the name to this wiki page instead of the module database",
"type": "wiki-page-name"
},
"1": {
"label": "Category icon",
"description": "Without id or name: the category whose icon to show (Offensive, Defensive, Utility, Ultimate, Legendary, Special)",
"example": "Offensive",
"example": "Offensive",
"type": "string",
"type": "string"
"required": true
},
},
"size": {
"size": {
"label": "Size",
"label": "Icon size",
"description": "Size of the icon, as a standard Mediawiki image size",
"description": "Size of the category icon, as a MediaWiki image size",
"example": "30px",
"default": "x30px",
"type": "string",
"type": "string"
"default": "x30px"
}
}
},
},
"description": "For adding a module icon to the page",
"paramOrder": ["id", "name", "view", "text", "link", "1", "size"]
"format": "inline"
}
}
</templatedata>
</templatedata>
</noinclude>
</noinclude>

Latest revision as of 20:38, 6 October 2026

[[File:{{{1}}} Module.png|{{{1}}}|x30px|alt={{{1}}} Module]] Shows a module from the game. With id or name, the facts come from the game's own data and update with every game version, so nobody has to copy them by hand. Without them, it shows a category icon, as before.

Code Shows
{{Module|id=boost.neutral}} Anti-Neutral Projectiles
{{Module|name=Stampede|view=compact}}
Offensive · Active · Max tier 250
Spawns a horde of goats that roams perpendicular to the direction between the tower and the casting point. Goats deal air damage based on the max. hp of an enemy upon contact.
{{Module|Offensive|size=30px}} Offensive Module
{{Module|id=stampede.goats|view=full}}
Stampedestampede.goatsOffensiveActive
Spawns a horde of goats that roams perpendicular to the direction between the tower and the casting point. Goats deal air damage based on the max. hp of an enemy upon contact.Goats might jump over enemies without touching them!
Max tier250
Levels per tier100
Base price1E8100 M
Price per level1E8100 M
TargetGround
damageairground

A module's id is in the module database: open the module, and the id is the part of the address after #. Names work too, in any case. A module the game doesn't have shows "Unknown module" and puts the page in Category:Pages with unknown modules.

A module from the game: its name, a card or a full panel, from the game's own data. Without id or name, a category icon.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Module idid

The module's id, as in the module database

Example
boost.neutral
Stringsuggested
Module namename

The module's name in the game, instead of the id

Example
Anti-Neutral Projectiles
Stringoptional
Viewview

icon: the name in the text; compact: a card; full: a panel with the description, numbers and tags

Suggested values
icon compact full
Default
icon
Stringoptional
Texttext

Text to show instead of the module's name

Stringoptional
Wiki pagelink

Link the name to this wiki page instead of the module database

Page nameoptional
Category icon1

Without id or name: the category whose icon to show (Offensive, Defensive, Utility, Ultimate, Legendary, Special)

Example
Offensive
Stringoptional
Icon sizesize

Size of the category icon, as a MediaWiki image size

Default
x30px
Stringoptional