Template:PerkSearch: Difference between revisions

From Against the Storm Official Wiki
m (→‎= With unique ID: fixed title)
(deprecated)
Tag: Replaced
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
</includeonly><noinclude>
</includeonly><noinclude>


Generates a table showing perks. Use this wherever you need to show one or more [[Perks]] or [[Cornerstones]]. Does not include Forest Mystery effects or penalties from Glade Events.
{{c|Red|'''IMPORTANT''' This template is now deprecated. Please use [[Template:Perks]] instead.}}
 
== Overview ==
 
Create a concise, sortable table using game data to show perks. The table shows the name of the perk, its icon, with a colored border similar to the in-game border corresponding to rarity, spells out the rarity (so it can be sorted on), its in-game long description of its effect, and where to find it.
 
The name of the perk displayed links to its page on the wiki.
 
== Parameters ==
 
The template has three modes: ID mode, name mode, and search mode. When using search mode, you can specify the search term and, if needed, filter on a particular source or rarity.
 
{| class="wikitable"
! Parameter !! string !! Description
|-
| id || string || The unique identifier of a perk. If you specify the id, you get a table with exactly that one perk.
|-
| name || string || The name of one or more perks. Perks with similar effects but that differ in their magnitude share names. (For example, "Nets" can be +1 or +2 to Meat.) If you specify the name, you get a table with one or several perks with that name.
|-
| search || string || A case-insensitive simple string match. If you specify a search term, you get a table with one or many perks whose names or descriptions contain that text.
|-
| source || string || See below for options. Filters the search results to only show perks from this source. Has no effect if you specify id or name.
|-
| rarity || string || See below for options. Filters the search results to only show perks of this rarity. Has no effect if you specify id or name.
|-
| display || "list" || If <code>display=list</code> is present at the end of the template call, it overrides the default use of a wikitable to display the recipe. Instead, it will produce a list of perks' names and small icons, each on their own line, without any additional information. Useful for populating larger tables or between paragraphs where displaying the entire recipe isn't relevant.
|}
 
== Examples ==
 
=== With unique ID ===
 
To display one perk when you know it's unique ID, you can call the template directly, using an unnamed parameter, and it will be interpreted the same as if you wrote <code>id=</code>
 
<pre>{{PerkSearch|Fedora Hat}}</pre>
 
Yields:
 
{{PerkSearch|Fedora Hat}}
 
 
=== With a name ===
 
Several perks can have the same name, but will have different modifier values. You'll see several perks in the table.
 
<pre>{{PerkSearch|name=Bigger Barrels}}</pre>
 
Yields:
 
{{PerkSearch|name=Bigger Barrels}}
 
=== With a search term ===
 
You can search all the text in the names and descriptions and get all of the perks that match. This is useful when finding perks "related" to something, like a resource or a building. You might get a long table back!
 
<pre>{{PerkSearch|search=Biscuits}}</pre>
 
Yields:
 
{{PerkSearch|search=Biscuits}}
 
You can also add filtering based on the source or the rarity. For example, if you only want Cornerstones that mention vegetables, you can do this:
 
<pre>{{PerkSearch|search=vegetables|source=Cornerstone}}</pre>
 
{{PerkSearch|search=vegetables|source=Cornerstone}}
 
 
Or if you want only Legendary perks that mention Amber, you can do this too:
 
<pre>{{PerkSearch|search=amber|rarity=Legendary}}</pre>
 
Yields:
 
{{PerkSearch|search=amber|rarity=Legendary}}
 
 
Finally, you can combine source and rarity filtering.
 
<pre>{{PerkSearch|search=villager|source=Cornerstone|rarity=Epic}}</pre>
 
Yields:
 
{{PerkSearch|search=villager|source=Cornerstone|rarity=Epic}}
 
 
Because of this search capability, a search term of ''e'' (as of version 0.63 with no expected changes for 1.0) will return every perk, because only the perk Storm Shield does ''not'' have an ''e'' in its description, but it does in its name. See [[Perks]] to see the result.
 
== Errors ==
 
If you provide an empty id, name, or search string, the template will return a simple error message.
 
'''{{PerkSearch|id=}}'''
 
 
If you provide an id or a name that doesn't exist, you'll be told that nothing was found.
 
'''{{PerkSearch|id=abcdef}}'''
 
'''{{PerkSearch|name=abcdef}}'''
 
 
If you provide a search term that returns no results, or apply a filter that results in nothing left, you'll be told that nothing was found.
 
<pre>{{PerkSearch|search=Coats|source=Cornerstone}}</pre>
 
Yields:
 
'''{{PerkSearch|search=Coats|source=Cornerstone}}'''

Latest revision as of 03:48, 10 May 2024


IMPORTANT This template is now deprecated. Please use Template:Perks instead.