Jump to content

Template:Module: Difference between revisions

From The Perfect Tower II
Cratorrex.rx (talk | contribs)
Reworked it, boss! (First Draft, adapted from Building)
Release 1d: module data and number format
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<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": {
"Image": {
"id": {
"label": "Image",
"label": "Module id",
"description": "The image of Module Type",
"description": "The module's id, as in the module database",
"example": "Offensive Module.png",
"example": "boost.neutral",
"type": "wiki-file-name",
"type": "string",
"required": true,
"suggested": true
"aliases": [
"image"
]
},
},
"Module Type": {
"name": {
"aliases": [
"label": "Module name",
"type"
"description": "The module's name in the game, instead of the id",
],
"example": "Anti-Neutral Projectiles",
"label": "Module Type",
"type": "string"
"description": "The type of module. (Offensive, Defensive, Utility, Special, Legendary)",
"example": "Offensive",
"type": "string",
"required": true
},
},
"Color": {
"view": {
"aliases": [
"label": "View",
"colour"
"description": "icon: the name in the text; compact: a card; full: a panel with the description, numbers and tags",
],
"suggestedvalues": ["icon", "compact", "full"],
"label": "Colour",
"default": "icon",
"description": "Colour of the Module Type (Off: #ec0800, Def: #009eff, Util: #fcff00, Ulti: #9f00ff, Spec: #a3a3a3, Leg: #ff8300)",
"type": "string"
"example": "#ec0800 / #009eff / #fcff00 / #9f00ff / #a3a3a3 / #ff8300",
"type": "string",
"suggested": true,
"default": "#000000"
},
},
"Tier": {
"text": {
"aliases": [
"label": "Text",
"maxTier",
"description": "Text to show instead of the module's name",
"max",
"type": "string"
"tier"
],
"label": "Maximum Tier",
"description": "The maximum tier for the module.",
"example": "250",
"type": "number",
"default": "250",
"required": true
},
},
"Description": {
"link": {
"aliases": [
"label": "Wiki page",
"desc"
"description": "Link the name to this wiki page instead of the module database",
],
"type": "wiki-page-name"
"label": "Description",
"description": "The Description / Information of the Module",
"example": "Lorem Ipsum gives +1 base statistics to Dolor Sit Amet. Does not work with Consectetur Adipiscing Elit.",
"type": "content",
"suggested": true
},
},
"Module Code": {
"1": {
"aliases": [
"label": "Category icon",
"code",
"description": "Without id or name: the category whose icon to show (Offensive, Defensive, Utility, Ultimate, Legendary, Special)",
"id"
"example": "Offensive",
],
"type": "string"
"label": "Module Code",
"description": "The internal code for the module.",
"example": "attack.basic / regeneration.relative / tower.absolute.zero",
"type": "string",
"suggested": true
},
},
"Name": {
"size": {
"aliases": [
"label": "Icon size",
"module"
"description": "Size of the category icon, as a MediaWiki image size",
],
"default": "x30px",
"label": "Module Name",
"type": "string"
"description": "The Module's Name.",
"example": "Daigoparry",
"type": "string",
"required": true
}
}
},
},
"description": "For adding a module icon to the page",
"paramOrder": ["id", "name", "view", "text", "link", "1", "size"]
"format": "inline",
"paramOrder": [
"Name",
"Image",
"Module Type",
"Color",
"Module Code",
"Tier",
"Description"
]
}
}
</templatedata>
</templatedata>
</noinclude>
</noinclude>
<includeonly>
{| class="wikitable"
!colspan="2"|<span style="font-weight:bold">{{{Name}}}</span>
|-
!colspan="2"|[[File:{{{Image|}}}|frameless]]
|-
! Module Type
| <span style="font-weight:bold;color:{{{color}}}">{{{type}}}</span>
|-
! Module Code
| {{{code}}}
|-
! Maximum Tier
| {{{Tier}}}
|-
! Description
| {{{Description}}}
|-
|}
[[Category:Modules]]
</includeonly>

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