Difference between revisions of "Template:Infobox main"
m (Concatenated nested ifs with switch) |
|||
(90 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{{#vardefine:Name|{{{name|{{BASEPAGENAME}}}}}}} | + | <includeonly>{{#vardefine:Name|{{{name|{{BASEPAGENAME}}}}}}} <div class="infobox float:right; {{#if:{{{1|}}}|{{#switch:{{{1}}}|<!-- |
− | <div class="infobox float:right; {{#if:{{{1|}}}|{{#switch:{{{1}}}|<!-- | ||
--> animal = c_08 |<!-- | --> animal = c_08 |<!-- | ||
--> plant = c_14 |<!-- | --> plant = c_14 |<!-- | ||
Line 12: | Line 11: | ||
<p class="heading">{{#var:Name}}</p> | <p class="heading">{{#var:Name}}</p> | ||
<div class="wrapper"> | <div class="wrapper"> | ||
− | <div class="image_wrapper" title="{{#var:Name}}">[[File:{{{image|{{#var:Name}}}}}|{{{imagesize|}}}|link={{#var:Name}}|{{#var:Name}}]]</div> | + | <div class="image_wrapper" title="{{#var:Name}}">[[File:{{{image|{{#var:Name}}}}}|{{{imagesize|250px}}}|link={{#var:Name}}|{{#var:Name}}]]</div> |
<p class="text-center" style="display:block; font-size:89%; padding: .5em;">{{#if:{{{description|}}}|{{{description|}}}{{#set:Description = {{{description|}}}}}}}</p>{{#set:Image = [[File:{{{image|{{#var:Name}}.png}}}]]}} | <p class="text-center" style="display:block; font-size:89%; padding: .5em;">{{#if:{{{description|}}}|{{{description|}}}{{#set:Description = {{{description|}}}}}}}</p>{{#set:Image = [[File:{{{image|{{#var:Name}}.png}}}]]}} | ||
---- | ---- | ||
Line 44: | Line 43: | ||
:{{{deterioration|}}}}} | :{{{deterioration|}}}}} | ||
+ | <!-- If market value defined, use that, else, if possible, calculate the value and use that instead but make a note that it is calculated.--> | ||
{{#if: {{{marketvalue|}}}|{{#set: Market Value Base = {{{marketvalue|}}} }} | {{#if: {{{marketvalue|}}}|{{#set: Market Value Base = {{{marketvalue|}}} }} | ||
;Market Value | ;Market Value | ||
− | :{{Market Value | {{{marketvalue|}}}}} {{Icon Small|silver}} }} | + | :{{Market Value | {{{marketvalue|}}}}} {{Icon Small|silver}} | {{#if: {{{resource 1|}}}| {{#if: {{{work to make|}}} | {{#ifeq: {{{resource 1|}}} | Stuff | | {{#set: Market Value Base = {{Market Value Calculator}} }} {{#set: Calculated Market Value = True }} |
+ | ;Market Value | ||
+ | :{{Market Value | {{Market Value Calculator}}}} {{Icon Small|silver}} {{H:title|link=no|This value is automatically calculated by the wiki and may not be correct|<sup>[Note]</sup>}} }} }} }} | ||
+ | }} | ||
{{#if: {{{beauty|}}}|{{#set:Beauty Base = {{{beauty|}}} }} | {{#if: {{{beauty|}}}|{{#set:Beauty Base = {{{beauty|}}} }} | ||
Line 77: | Line 80: | ||
;{{H:title|link=no|See Apparel for how this is applied|Insulation Factor - Heat}} | ;{{H:title|link=no|See Apparel for how this is applied|Insulation Factor - Heat}} | ||
:{{{insulationheatfactor|}}}x }} | :{{{insulationheatfactor|}}}x }} | ||
+ | |||
+ | {{#if: {{{armorsharp|}}}|{{#set:Armor - Sharp = {{{armorsharp|}}} }} | ||
+ | ;Armor - Sharp | ||
+ | :{{{armorsharp|}}}%}} | ||
{{#if: {{{armorblunt|}}}|{{#set:Armor - Blunt= {{{armorblunt|}}} }} | {{#if: {{{armorblunt|}}}|{{#set:Armor - Blunt= {{{armorblunt|}}} }} | ||
;Armor - Blunt | ;Armor - Blunt | ||
:{{{armorblunt|}}}%}} | :{{{armorblunt|}}}%}} | ||
− | |||
− | |||
− | |||
− | |||
{{#if: {{{armorheat|}}}|{{#set:Armor - Heat = {{{armorheat|}}} }} | {{#if: {{{armorheat|}}}|{{#set:Armor - Heat = {{{armorheat|}}} }} | ||
;Armor - Heat | ;Armor - Heat | ||
:{{{armorheat|}}}%}} | :{{{armorheat|}}}%}} | ||
+ | |||
+ | {{#if: {{{armorsharpfactor|}}}|{{#set:Armor Factor - Sharp = {{{armorsharpfactor|}}} }} | ||
+ | ;Armor Factor - Sharp | ||
+ | :{{{armorsharpfactor|}}}}} | ||
{{#if: {{{armorbluntfactor|}}}|{{#set:Armor Factor - Blunt= {{{armorbluntfactor|}}} }} | {{#if: {{{armorbluntfactor|}}}|{{#set:Armor Factor - Blunt= {{{armorbluntfactor|}}} }} | ||
;Armor Factor - Blunt | ;Armor Factor - Blunt | ||
:{{{armorbluntfactor|}}}}} | :{{{armorbluntfactor|}}}}} | ||
− | |||
− | |||
− | |||
− | |||
{{#if: {{{armorheatfactor|}}}|{{#set:Armor Factor - Heat = {{{armorheatfactor|}}} }} | {{#if: {{{armorheatfactor|}}}|{{#set:Armor Factor - Heat = {{{armorheatfactor|}}} }} | ||
Line 109: | Line 112: | ||
;Coverage | ;Coverage | ||
:{{{coverage|}}}}} | :{{{coverage|}}}}} | ||
+ | |||
+ | {{#if: {{{layer|}}}|{{#set:layer= {{{layer|}}} }} | ||
+ | ;Layer | ||
+ | :{{{layer|}}}}} | ||
<!-- All pawns (animals, humanoids, mechanoids) --> | <!-- All pawns (animals, humanoids, mechanoids) --> | ||
Line 120: | Line 127: | ||
{{#if: {{{massyoung|{{{massadult|}}}}}}|{{#set:Mass - Young= {{{massyoung|{{#expr:{{{massadult}}}/5}}}}} }} | {{#if: {{{massyoung|{{{massadult|}}}}}}|{{#set:Mass - Young= {{{massyoung|{{#expr:{{{massadult}}}/5}}}}} }} | ||
;Mass - Young | ;Mass - Young | ||
− | :{{{massyoung|{{#expr:{{{massadult}}}/5}}}}}kg}} | + | :{{{massyoung|{{#expr:{{{massadult}}}/5}}}}} kg}} |
{{#if: {{{massjuvenlie|{{{massadult|}}}}}}|{{#set:Mass - Juvenile= {{{massjuvenile|{{#expr:{{{massadult}}}/2}}}}} }} | {{#if: {{{massjuvenlie|{{{massadult|}}}}}}|{{#set:Mass - Juvenile= {{{massjuvenile|{{#expr:{{{massadult}}}/2}}}}} }} | ||
;Mass - Juvenile | ;Mass - Juvenile | ||
− | :{{{massjuvenlie|{{#expr:{{{massadult}}}/2}}}}}kg}} | + | :{{{massjuvenlie|{{#expr:{{{massadult}}}/2}}}}} kg}} |
{{#if: {{{massadult|}}}|{{#set:Mass - Adult= {{{massadult|}}} }} | {{#if: {{{massadult|}}}|{{#set:Mass - Adult= {{{massadult|}}} }} | ||
;Mass - Adult | ;Mass - Adult | ||
− | :{{{massadult|}}}kg}} | + | :{{{massadult|}}} kg}} |
{{#if: {{{attack1dmg|}}}{{{attack1type|}}}{{{attack1part|}}}{{{attack1cool|}}}| | {{#if: {{{attack1dmg|}}}{{{attack1type|}}}{{{attack1part|}}}{{{attack1cool|}}}| | ||
Line 216: | Line 223: | ||
{{#ifeq: {{{type|}}} | Animals | | {{#ifeq: {{{type|}}} | Animals | | ||
{{#vardefine: MeatName | {{{meatname | {{#var:Name}} meat}}} }} | {{#vardefine: MeatName | {{{meatname | {{#var:Name}} meat}}} }} | ||
− | {{#vardefine: LeatherName | {{{leathername | {{#var:Name}} leather}}} }} | + | {{#vardefine: LeatherName | {{{leathername | {{#var:Name}} leather}}} }} |
{{#if: {{{is exotic species|}}}|{{#set: Is Exotic Species = true}}|{{#set: Is Exotic Species = false}}}}| | {{#if: {{{is exotic species|}}}|{{#set: Is Exotic Species = true}}|{{#set: Is Exotic Species = false}}}}| | ||
}} | }} | ||
− | {{#if: {{{bodysize|}}}| | + | {{#if: {{#var:LeatherName }}| |
− | + | {{#set: Leather Name = {{#var:LeatherName}}}} }} | |
+ | |||
+ | |||
+ | {{#if: {{{bodysize|}}}|{{#set:Body Size = {{{bodysize|}}} }} | ||
+ | ;Body Size | ||
+ | :{{{bodysize|}}} | ||
− | + | {{#if:{{#var:MeatName}}|{{#vardefine: MeatYield | {{{meatyield | {{#expr: 90 * {{{bodysize}}} round 0}}}}} }} | |
{{#set: Meat Yield = {{#var: MeatYield}} }} | {{#set: Meat Yield = {{#var: MeatYield}} }} | ||
;Meat Yield | ;Meat Yield | ||
− | :{{#var: MeatYield}} [[Meat|{{lc:{{#var:MeatName}}}}]] | + | :{{#var: MeatYield}} [[Meat|{{lc:{{#var:MeatName}}}}]]}} |
{{#vardefine: CarryingCapacity | {{#expr: 75 * {{{bodysize|}}} round0}} }} | {{#vardefine: CarryingCapacity | {{#expr: 75 * {{{bodysize|}}} round0}} }} | ||
Line 235: | Line 247: | ||
<!-- Use leatheryield when set, otherwise (incorrectly in some cases) assume 30 * bodysize --> | <!-- Use leatheryield when set, otherwise (incorrectly in some cases) assume 30 * bodysize --> | ||
<!-- See Property:Leather_Yield for details --> | <!-- See Property:Leather_Yield for details --> | ||
− | + | {{#if:{{#var:LeatherName}}|{{#vardefine: LeatherYield | {{{leatheryield | {{#expr: 30 * {{{bodysize}}} round 0}} }}} }} | |
{{#set: Leather Yield = {{#var: LeatherYield}} }} | {{#set: Leather Yield = {{#var: LeatherYield}} }} | ||
;Leather Yield | ;Leather Yield | ||
:{{#var: LeatherYield}} [[{{#var: LeatherName}}|{{lc:{{#var: LeatherName}}}}]] }} | :{{#var: LeatherYield}} [[{{#var: LeatherName}}|{{lc:{{#var: LeatherName}}}}]] }} | ||
+ | |||
+ | {{#vardefine: FilthRate | {{#expr: 1.25 * {{{bodysize|}}} * {{#if: {{{petness|}}}|{{#expr: 1 - {{{petness|}}} }}|1}} round2}} }} | ||
+ | {{#set: Animal Filth Rate = {{#var: FilthRate}} }} | ||
+ | ;{{H:title|link=no|The average amount of filth produced on constructed floors per 1000 cells walked by this creature.|Filth Rate}} | ||
+ | :{{#var: FilthRate}} | ||
+ | }} | ||
{{#if: {{{manhunter|}}}|{{#set:Turn Manhunter Chance When Attacked = {{{manhunter|}}} }} | {{#if: {{{manhunter|}}}|{{#set:Turn Manhunter Chance When Attacked = {{{manhunter|}}} }} | ||
Line 249: | Line 267: | ||
{{#if: {{{hungerrate|}}}|{{#set:Base Hunger Rate = {{{hungerrate|}}} }} | {{#if: {{{hungerrate|}}}|{{#set:Base Hunger Rate = {{{hungerrate|}}} }} | ||
− | ;Hunger Rate | + | ;{{H:title|link=no|Nutrition lost per day.|Hunger Rate}} |
:{{#expr: {{{hungerrate|}}} * 1.6 round2}} }} | :{{#expr: {{{hungerrate|}}} * 1.6 round2}} }} | ||
Line 271: | Line 289: | ||
}} | }} | ||
− | {{#if: {{{ | + | {{#if: {{{wildness|}}}|{{#set:Wildness = {{{wildness|}}} }} |
+ | ;{{H:title|link=no|Wilder creatures are naturally more difficult to tame, train, and handle.|Wildness}} | ||
+ | :{{#expr: {{{wildness|}}} * 100 round0}}% | ||
+ | |||
+ | {{#vardefine: MinHandlingSkill | | ||
+ | {{#ifexpr: | ||
+ | {{{wildness|}}} < .2|0 | ||
+ | |{{#ifexpr: {{{wildness|}}} < .45|1 | ||
+ | |{{#ifexpr: {{{wildness|}}} < .55|4 | ||
+ | |{{#ifexpr: {{{wildness|}}} < .75|5 | ||
+ | |{{#ifexpr: {{{wildness|}}} < .8|7 | ||
+ | |{{#ifexpr: {{{wildness|}}} < .9|8 | ||
+ | |{{#ifexpr: {{{wildness|}}} < .97|9 | ||
+ | |10}} }} }} }} }} }} }} }} | ||
+ | {{#set:Minimum Handling Skill = {{#var: MinHandlingSkill}} }} | ||
+ | {{#ifeq: {{#var: MinHandlingSkill}}|0|| | ||
;{{H:title|link=no|This creature cannot be tamed, trained, or commanded by anyone with less than this skill in animals.|Minimum Handling Skill}} | ;{{H:title|link=no|This creature cannot be tamed, trained, or commanded by anyone with less than this skill in animals.|Minimum Handling Skill}} | ||
− | :{{ | + | :{{#var: MinHandlingSkill}} }} |
+ | }} | ||
− | {{#if: {{{ | + | {{#if: {{{petness|}}}|{{#set: Petness = {{{petness|}}} }} }} |
− | |||
− | |||
{{#ifeq: {{{predator|}}}|true|{{#set:Is Predator = true}}|}} | {{#ifeq: {{{predator|}}}|true|{{#set:Is Predator = true}}|}} | ||
Line 293: | Line 325: | ||
{{#if: {{{wool|}}}| | {{#if: {{{wool|}}}| | ||
{{#set: Wool Amount = {{{wool|}}}}} | {{#set: Wool Amount = {{{wool|}}}}} | ||
− | {{#vardefine: WoolName | {{{ | + | {{#vardefine: WoolName | {{{woolname | {{#var:Name}} wool}}} }} |
+ | {{#set: Wool Name = {{#var:WoolName}}}} | ||
;Wool Amount | ;Wool Amount | ||
:{{{wool|}}} [[{{#var: WoolName}}|{{lc:{{#var: WoolName}}}}]] | :{{{wool|}}} [[{{#var: WoolName}}|{{lc:{{#var: WoolName}}}}]] | ||
Line 304: | Line 337: | ||
{{#if: {{{nuzzleMtb|}}}|{{#set: Nuzzle Mtb Hours = {{{nuzzleMtb|}}} }} | {{#if: {{{nuzzleMtb|}}}|{{#set: Nuzzle Mtb Hours = {{{nuzzleMtb|}}} }} | ||
− | ; | + | ;{{H:title|link=no|How often an animal will nuzzle friendly colonists, on average.|Nuzzle Interval}} |
− | + | {{#ifexpr: {{{nuzzleMtb|}}} <= 24 | |
− | + | |{{#switch: {{{nuzzleMtb|}}} | |
− | + | |24 = :1 day | |
+ | |1 = :1 hour | ||
+ | |#default = :{{{nuzzleMtb|}}} hours}} | ||
+ | |:{{#expr: {{{nuzzleMtb|}}} / 24 round1}} days}} }} | ||
+ | |||
{{#if: {{{eggsmin|}}}|{{#set: Eggs Per Clutch Minimum = {{{eggsmin|}}} }} | {{#if: {{{eggsmin|}}}|{{#set: Eggs Per Clutch Minimum = {{{eggsmin|}}} }} | ||
Line 320: | Line 357: | ||
{{#if: {{{eggs_avg|}}}|{{#set: Eggs Per Clutch Average = {{{eggs_avg|}}} }} }} | {{#if: {{{eggs_avg|}}}|{{#set: Eggs Per Clutch Average = {{{eggs_avg|}}} }} }} | ||
+ | |||
+ | {{#if: {{{eggs_unfertilized|}}}|{{#set: Can Lay Unfertilized Eggs = {{{eggs_unfertilized|}}} }} | ||
+ | ;Can Lay Unfertilized Eggs | ||
+ | :{{{eggs_unfertilized|}}} }} | ||
{{#if: {{{gestation|}}}|{{#set: Gestation Period Days = {{{gestation|}}} }} | {{#if: {{{gestation|}}}|{{#set: Gestation Period Days = {{{gestation|}}} }} | ||
Line 336: | Line 377: | ||
;Maturity Age | ;Maturity Age | ||
:{{{maturityage|}}} }} | :{{{maturityage|}}} }} | ||
+ | |||
+ | {{#if: {{{min comfortable temperature|}}}|{{#set: Min Comfortable Temperature = {{{min comfortable temperature|}}} }} | ||
+ | {{#if: {{{max comfortable temperature|}}}|{{#set: Max Comfortable Temperature = {{{max comfortable temperature|}}} }} | ||
+ | ;Comfortable Temp Range | ||
+ | :{{{min comfortable temperature|}}}°C - {{{max comfortable temperature|}}}°C}} | ||
+ | }} | ||
{{#if: {{{livesin_aridshrubland|}}}|{{#set: Lives in Arid Shrubland = true}} }} | {{#if: {{{livesin_aridshrubland|}}}|{{#set: Lives in Arid Shrubland = true}} }} | ||
Line 374: | Line 421: | ||
{{#if: {{{material amount|}}}{{{material name|}}}|{{#set:Material Amount = {{{material amount|}}} }} {{#set:Material Name= {{{material name|}}} }} | {{#if: {{{material amount|}}}{{{material name|}}}|{{#set:Material Amount = {{{material amount|}}} }} {{#set:Material Name= {{{material name|}}} }} | ||
;Materials | ;Materials | ||
− | :{{icon|{{lc:{{{material name|buildingmat}}}}}|{{{material amount|}}}|16 | + | :[[Category:Resource Update Needed]]{{icon|{{lc:{{{material name|buildingmat}}}}}|{{{material amount|}}}|16 |
}}{{#if: {{{material 2 amount|}}}{{{material 2 name|}}}| | }}{{#if: {{{material 2 amount|}}}{{{material 2 name|}}}| | ||
{{#set:Material 2 Amount = {{{material 2 amount|}}} }} {{#set:Material 2 Name= {{{material 2 name|}}} }} | {{#set:Material 2 Amount = {{{material 2 amount|}}} }} {{#set:Material 2 Name= {{{material 2 name|}}} }} | ||
Line 429: | Line 476: | ||
:{{{mode|}}}}} | :{{{mode|}}}}} | ||
− | + | ||
− | {{#if: {{{damage type|}}}|{{#set:Damage Type = {{{damage type|} | + | {{#if: {{{damage type|}}}|{{#set:Damage Type = {{{damage type|}}} }} |
;Dmg Type | ;Dmg Type | ||
− | :{{{damage type| | + | :{{{damage type|}}} }} |
+ | {{#if: {{{damage|}}}| | ||
<!--the following determines if the item is a melee weapon, else assumes it's ranged, then sets relevant property--> | <!--the following determines if the item is a melee weapon, else assumes it's ranged, then sets relevant property--> | ||
Line 504: | Line 552: | ||
:{{{meleeattack4part|Body part?}}}<br>{{{meleeattack4dmg|?}}} dmg ({{{meleeattack4type|type?}}})<br>{{{meleeattack4cool|0}}} seconds cooldown <br>{{{meleeattack4ap|0}}}% armor penetration}} | :{{{meleeattack4part|Body part?}}}<br>{{{meleeattack4dmg|?}}} dmg ({{{meleeattack4type|type?}}})<br>{{{meleeattack4cool|0}}} seconds cooldown <br>{{{meleeattack4ap|0}}}% armor penetration}} | ||
− | {{#if: {{{MeleeWeaponAverageDPS|}}}| | + | |
+ | {{#if: {{{MeleeWeaponAverageDPS|}}}|{{#set:MeleeDPS= {{{MeleeWeaponAverageDPS|}}} }} | ||
;Melee Average DPS | ;Melee Average DPS | ||
:{{{MeleeWeaponAverageDPS|}}} }} | :{{{MeleeWeaponAverageDPS|}}} }} | ||
− | {{#if: {{{MeleeWeaponAverageAP|}}}| | + | {{#if: {{{MeleeWeaponAverageAP|}}}|{{#set:MeleeAP= {{{MeleeWeaponAverageAP|}}} }} |
;Melee Average AP | ;Melee Average AP | ||
:{{{MeleeWeaponAverageAP|}}}%}} | :{{{MeleeWeaponAverageAP|}}}%}} | ||
Line 531: | Line 580: | ||
---------- Line to separate the mess above from the other stuff below ---------- --> | ---------- Line to separate the mess above from the other stuff below ---------- --> | ||
− | {{#if: {{{armorPenetration|}}}| | + | {{#if: {{{armorPenetration|}}}|{{#set:ArmorPenetration= {{{armorPenetration|}}} }} |
;Armor penetration | ;Armor penetration | ||
:{{{armorPenetration|}}}%}} | :{{{armorPenetration|}}}%}} | ||
Line 603: | Line 652: | ||
{{#if: {{{buy|}}}| | {{#if: {{{buy|}}}| | ||
;Buy | ;Buy | ||
− | :{{{buy|}}}}} | + | :{{{buy|}}}[[Category:Resource Update Needed]]}} |
{{#if:{{{sell|}}}| | {{#if:{{{sell|}}}| | ||
Line 618: | Line 667: | ||
{{#if: {{{resources to make|}}}| | {{#if: {{{resources to make|}}}| | ||
;Resources to make | ;Resources to make | ||
− | :{{{resources to make|}}} | + | :{{{resources to make|}}} [[Category:Resource Update Needed]] |
+ | }} | ||
+ | |||
+ | {{#if: {{{stuff tags|}}}|{{#set:Stuff Tags = {{{stuff tags}}}}} | ||
+ | ;{{H:title|link=no|The types of resource that can be substituted for the generic resource type|Stuff tags}} | ||
+ | :{{{stuff tags|}}} | ||
}} | }} | ||
+ | |||
+ | {{#if: {{{resource 1|}}}|{{#set:Resource 1 = {{{resource 1|}}} }}}} | ||
+ | {{#if: {{{resource 2|}}}|{{#set:Resource 2 = {{{resource 2|}}} }}}} | ||
+ | {{#if: {{{resource 3|}}}|{{#set:Resource 3 = {{{resource 3|}}} }}}} | ||
+ | {{#if: {{{resource 4|}}}|{{#set:Resource 4 = {{{resource 4|}}} }}}} | ||
+ | {{#if: {{{resource 5|}}}|{{#set:Resource 5 = {{{resource 5|}}} }}}} | ||
+ | {{#if: {{{resource 6|}}}|{{#set:Resource 6 = {{{resource 6|}}} }}}} | ||
+ | {{#if: {{{resource 1 amount|}}}|{{#set:Resource 1 Amount = {{{resource 1 amount|}}} }}}} | ||
+ | {{#if: {{{resource 2 amount|}}}|{{#set:Resource 2 Amount = {{{resource 2 amount|}}} }}}} | ||
+ | {{#if: {{{resource 3 amount|}}}|{{#set:Resource 3 Amount = {{{resource 3 amount|}}} }}}} | ||
+ | {{#if: {{{resource 4 amount|}}}|{{#set:Resource 4 Amount = {{{resource 4 amount|}}} }}}} | ||
+ | {{#if: {{{resource 5 amount|}}}|{{#set:Resource 5 Amount = {{{resource 5 amount|}}} }}}} | ||
+ | {{#if: {{{resource 6 amount|}}}|{{#set:Resource 6 Amount = {{{resource 6 amount|}}} }}}} | ||
+ | |||
+ | {{#if: {{{resource 1|}}}| | ||
+ | ;Resources to make | ||
+ | :{{#ifeq: Stuff | {{{resource 1|}}} |{{Icon|buildingmat}}|{{Icon Small|{{{resource 1|}}}|16}}}} {{{resource 1 amount|}}} {{#if: {{{resource 2|}}}| + {{Icon Small|{{{resource 2|}}}|16}} {{{resource 2 amount|}}}|}} {{#if: {{{resource 3|}}}| + {{Icon Small|{{{resource 3|}}}|16}} {{{resource 3 amount|}}}|}}{{#if: {{{resource 4|}}}| + {{Icon Small|{{{resource 4|}}}|16}} {{{resource 4 amount|}}}|}}{{#if: {{{resource 5|}}}| + {{Icon Small|{{{resource 5|}}}|16}} {{{resource 5 amount|}}}|}}{{#if: {{{resource 6|}}}| + {{Icon Small|{{{resource 6|}}}|16}} {{{resource 6 amount|}}}|}} | ||
+ | |}} | ||
+ | |||
+ | <!---If resource 1 is set to stuff, but theres no stuff tags, make note of it---> | ||
+ | {{#ifeq: Stuff | {{{resource 1|}}} | {{#if: {{{stuff tags|}}}| | | ||
+ | ;{{H:title|link=no|The types of resource that can be substituted for the generic resource type|Stuff tags}} | ||
+ | :<span style="color:red">'''ERROR: NO STUFF TAGS'''</span> | ||
+ | }} | ||
+ | |}} | ||
{{#if: {{{deconstruct yield|}}}| | {{#if: {{{deconstruct yield|}}}| | ||
Line 627: | Line 706: | ||
<br style="clear: both; height: 0px;" /> | <br style="clear: both; height: 0px;" /> | ||
− | </dl></div></div> | + | </dl></div></div></includeonly><noinclude> |
− | </includeonly> | + | {{documentation}}</noinclude><!-- Add categories and interwikis to the /doc subpage, not here! --> |
− | <noinclude> | ||
− | {{documentation}} | ||
− | |||
− | </noinclude> |
Latest revision as of 02:49, 18 January 2021
Contents
Intro
Template:Infobox main Is the core of what powers the SemanticMediaWiki database of rimworld objects. Since the template is so complex, it's worth taking a step back and summarizing what this template does:
- Takes in facts: On each page which describes an in-game object, we call
{{infobox main | ...}}
, where...
is a very long list of parameters describing the object in question, including its name, type, the cost to make it, and a bunch of other things - Rendering an infobox: This template takes those parameters and presents them in a nice looking infobox on the right side of the page. If you add a param
|marketvalue = 200
, this template will add a line to the infobox showing the market value annotated with a silver icon. Cool! - Setting SMW properties: The real magic comes from this templates ability to also set SMW properties. If the
|marketvalue = 200
param is present, this template will also set a SMW property 'Market Value Base' equal to 200 for whatever page the infobox was called on.
As an example, say there was an Page called "Foo" for an in-game object with the same name. In-game, a foo has a market value of 200. When you invoke {{infobox main | ... | marketvalue = 200 | ...
, this template will set the 'Market Value Base' property of the 'Foo' page to 200.
These properties can then be retrieved using a snippet like {{#show:Foo|?Market Value Base}}
. You can browse the properties for a given page by clicking the "Browse properties" link on the left side of the page. For an example, see Special:Browse/:Duster
Positional parameters
This template also takes one (and only one -- all others are ignored) positional parameter that specifies the type of infobox styling to use (primarily: to set the color of the infobox based on object type)
Usage
- Everything is optional for the template to function; however, relevant sections should be filled in for the sake of completeness. The information displayed is dependent on which category is used, and will not be displayed unless a value is provided.
- You can add a "name" and "image". Fill these values if the PAGENAME macro is not adequate (if the page name has a disambig qualifier for example)
{{infobox main |animal/plant/weapon/area/structure/production/security/furniture (used to set color theme) |additional styles (optional) |name = Title of the infobox. Defaults to current page name if not specified. |image = Picture name.(jpg/png)| variables such as size, alt text (optional) |description = Short description of the item. Recommended to use the description from the in-game info page. |type = use for main category |type2 = use for subcategory (optional) |placeable = Yes/No |rotatable = Yes/No |size = two values, separated by | - (1|2) |beauty = use for beauty |flammability = how quickly it burns. format: in decimals(vb:0.8) , displayed as % vb(80%) |market value = the amount of currency the item is worth |mass base = mass in kilograms - DO NOT USE FOR ANIMALS |hp = the amount of damage an object can take; use for objects with hit points <!-- All pawns (animals, humanoids, mechanoids) --> |movespeed = base movement speed |attack1dmg = base damage of first attack <meleeDamageBaseAmount> |attack1type = damage type of first attack <meleeDamageDef> |attack1part = body part of first attack <linkedBodyPartsGroup> |attack1cool = cooldown of first attack (in ticks) <defaultCooldownTicks> |attack1stun = stun applied with first attack, if any (in stun damage, 20 ticks per point) <extraMeleeDamages> |attack2dmg = as above for second attack |attack2type = as above for second attack |attack2part = as above for second attack |attack2cool = as above for second attack |attack2stun = as above for second attack |attack3dmg = as above for third attack |attack3type = as above for third attack |attack3part = as above for third attack |attack3cool = as above for third attack |attack3stun = as above for third attack |attack4dmg = as above for fourth attack |attack4type = as above for fourth attack |attack4part = as above for fourth attack |attack4cool = as above for fourth attack |attack4stun = as above for fourth attack |bodysize = required in order to calculate meat yield, leather yields, and carrying capacity |leathername = use only if leather, skin, or fur is dropped when butchered |massyoung = the mass of an animal when young |massjuvenile = the mass of an animal when juvenile |massadult = the mass of an animal when adult <!--Apparel and Armor--> |armorblunt = blunt armor rating for non-material dependent Apparel and Armor |armorsharp = sharp armor rating for non-material dependent Apparel and Armor |armorheat = heat armor rating for non-material dependent Apparel and Armor |armorbluntfactor = blunt armor multiplier for material dependent Apparel and Armor |armorsharpfactor = sharp armor multiplier for material dependent Apparel and Armor |armorheatfactor = heat armor multiplier for material dependent Apparel and Armor |painshockthreshold = increase in pain shock threshold |insulationheat = base heat tolerance modifier |insulationcold = base cold tolerance modifier |insulationheatfactor = base heat tolerance for material dependent Apparel and Armor |insulationcoldfactor = base cold tolerance for material dependent Apparel and Armor |coverage = coverage provided by the item |layer = the layer the item occupies on the pawn <!-- Animals only --> |manhunter = chance to turn manhunter when attacked (0.00 - 1.00) |manhuntertame = chance to turn manhunter on a failed taming attempt (0.00 - 1.00) |hungerrate = base hunger rate |diet = carnivorous/herbivorous/omnivorous/dendrovorous/carnivorous and ovivorous/omnivorous and ovivorous |lifespan = life expectancy |trainable = none/simple/intermediate/advanced |handleskill = minimum handling skill |wildness = wildness level of creature |milk = amount of milk produced |milktime = milking interval (days) |wool = wool amount |sheartime = shearing interval |eggsmin = eggs per clutch minimum |eggsmax = eggs per clutch maximum |eggtime = egg laying interval |eggs_avg = eggs per clutch average |gestation = gestation period (days) (must either be a number or N/A) |offspring = offspring per birth (Do not use for egg-laying animals) |maturityage = age of maturity |livesin_aridshrubland = true or <omit> |livesin_borealforest = true or <omit> |livesin_desert = true or <omit> |livesin_extremedesert = true or <omit> |livesin_icesheet = true or <omit> |livesin_temperateforest = true or <omit> |livesin_tropicalrainforest = true or <omit> |livesin_tundra = true or <omit> |predator = true or <omit> |meatyield = amount of meat yielded when butchered. ONLY specify this parameter for animal defs that explicitly specify a MeatAmount property in the XML (currently Thrumbo, Centipede, and Scyther)! |meatname = name of meat given when butchered. Defaults to "x meat" when not defined. |woolname = name of wool given when sheared. Defaults to "x wool" when not defined. <!-- Plants --> |time = number of days to grow |yield = how much food given when harvested |wood = how much wood given when harvested <!-- Buildings--> |power = power generated. Format: + 3600 or - 150 |facility = multi-analyzer/tool cabinet/vitals monitor (name of facility that this production station links to for improved efficiency) |material amount = amount of materials needed to build it, has to be the one that varies |material name= only needed if not [steel,stone,wood,plasteel...]; |material 2 amount = amount of second material |material 2 name= name of second material (for icon) |material 3 amount = amount of third material |material 3 name= name of third material (for icon) |material 4 amount = amount of fourth material |material 4 name= name of fourth material (for icon) <!-- Furniture --> |comfort = how much comfort it gives when using |cover effectiveness = how effective the object is when used for cover. |sell price multiplier = a multiplier on the price at which you can sell items. |terrain requirement = light, medium or heavy terrain requirements to place object. |work to build = the base amount of work it takes to build a structure, once all materials are gathered. |work to uninstall = the amount of work it takes to uninstall a structure. |immunity gain speed factor = how fast a pawn acquires immunity while using object |rest effectiveness = how quickly rest gets restored <!-- All Weapons --> |class = neolithic/modern/advanced/mechanoid |damage = Base weapon damage |cooldown = use for cooldown time of weapon (in ticks) |mode = Melee/Single-Shot/Burst |warmup = How long it takes to aim (in ticks). Set to 0 if melee weapon. |damage type= The type of damage: Blunt - Scharp - Heat - Electric - Toxic ,if it has damage it wil get Sharp automaticly <!-- Ranged Weapons Only --> |burst = Shots per burst. Set to 1 for single-shot weapons. |burstticks = Time between bursts (in ticks) |range = Weapon range |minrange = Minimum weapon range AKA forced-miss range |missRadius = Missed shots are forced to land within this radius of the target |area = Explosive area (in squares) |velocity = use for projectile velocity |accuracyTouch = use for touch accuracy |accuracyShort = use for short range accuracy |accuracyMedium = use for medium range accuracy |accuracyLong = use for long range accuracy |accuracyAvg = use for average accuracy: note that this value has to be calculated and cannot be obtained simply by taking the mean of the above accuracies |blastRadius = use for blast radius of explosive weapons <!-- Melee Weapons Only --> |meleeattack1dmg = base damage of first attack <meleeDamageBaseAmount> |meleeattack1type = damage type of first attack <meleeDamageDef> |meleeattack1part = body part of first attack <linkedBodyPartsGroup> |meleeattack1cool = cooldown of first attack (in seconds) <defaultCooldownTicks> |meleeattack1ap = armor penetration of first attack |meleeattack2dmg = as above for second attack |meleeattack2type = as above for second attack |meleeattack2part = as above for second attack |meleeattack2cool = as above for second attack |meleeattack2ap = as above for second attack |meleeattack3dmg = as above for third attack |meleeattack3type = as above for third attack |meleeattack3part = as above for third attack |meleeattack3cool = as above for third attack |meleeattack3ap = as above for fourth attack |meleeattack4dmg = as above for fourth attack |meleeattack4type = as above for fourth attack |meleeattack4part = as above for fourth attack |meleeattack4cool = as above for fourth attack |meleeattack4ap = as above for fourth attack |MeleeWeaponAverageDPS = average melee DPS of the weapon |MeleeWeaponAverageAP = average melee armor penetration of the weapon <!-- Miscellaneous --> |resources to make = amount of resources to build or craft this item. Format using {{icon|metal|75}} or similar (more info at Template:Icon) |deconstruct yield = amount of resources returned when this item is deconstructed or smelted. Format using {{icon|metal|75}} or similar (more info at Template:Icon) <!-- Deprecated parameters --> |work to build = merged with work to make |minimum skill = minimum skill level required to build or craft something -- was never consistently applied |buy = Amount of resource to buy or build this item. Format: {{icon|metal|75}} (More info at Template:Icon) -- replaced with resources to make |sell = Amount of resource to sell or deconstruct this item. Format: {{icon|cloth|18}} (More info at Template:Icon) -- replaced with deconstruct yield |info = Removed and replaced with description =. |walkSpeed = Superseded by moveSpeed |speed = Superseded by moveSpeed |accuracy = Superseded by accuracyTouch, accuracyShort, accuracyMedium, and accuracyLong. |DPS = Removed. Now calculated automatically. |healthscale = Unused. Would determine hit points for each body part. |armorelectric = Not currently used. |armorpoison = Not currently used. |eggs_avg10 = Previously average per month. Game now uses seasons and template automatically calculates value. |mobdamage = Superseded by attack1dmg |mobdamagetype = Superseded by attack1type |mobdamage2 = As above, for second attack |mobdamagetype2 = As above, for second attack |mobdamage3 = As above for, third attack |mobdamagetype3 = As above, for third attack }}
Deprecated positional paramters
This template used to take in up to 4 positional parameters, often accomplish relatively hacky things. As of now this template only takes ONE positional parameter -- all others are ignored.
- (still in use)
- DEPRECATED: Extra CSS class to be applied to the infobox div.
- DEPRECATED: Used to be extra params passed to the image layout in the infobox. Superseded by the imagesize= param
- DEPRECATED: Overly clever use of the size parameter. The usual format is |size = X|Y. This then gets transformed into x * y. BUT it only works if you have 3 positional parameters prior to the first param.
Example #1
Muffalo
"A large herding herbivore descended from buffalo and adapted for some exotic environment. Peaceful unless disturbed."
- Move Speed
- 3.6
- Damage
- 10
- Damage Type
- blunt
- Body Size
- 2.0
- Meat Yield
- 180 muffalo meat
- Carrying Capacity
- 150
- Leather Yield
- 60 muffalo leather
- Filth Rate
- 2.5
- Manhunter Chance
- 1.25%
- Diet
- herbivorous
- Life Expectancy
- 15
- Trainable Intelligence
- intermediate
- Wildness
- 50%
- Minimum Handling Skill
- 4
- Milk Amount
- 6
- Milking Interval
- 4 days
- Wool Amount
- 100 muffalo wool
- Shearing Interval
- 60 days
- Gestation Period
- 60 days
- Offspring Per Birth
- 1
- Maturity Age
- 3+
{{infobox main|animal| |name = Muffalo |image = Animal Muffalo side.png|200px{{!}}Muffalo |description = "A large herding herbivore descended from buffalo and adapted for some exotic environment. Peaceful unless disturbed." |type = Animals |type2 = Wild |bodysize = 2.0 |healthscale = 1.75 |movespeed = 3.6 |mobdamage = 10 |mobdamagetype = blunt |mobdamageaverage = 10 |leathername = muffalo leather |woolname = muffalo wool |wool = 100 |sheartime = 60 |milk = 6 |milktime = 4 |manhunter = 0.0125 |hungerrate = |diet = herbivorous |trainable = intermediate |wildness = 0.5 |handleskill = 3 |gestation = 60 |lifespan = 15 |offspring = 1 |maturityage = 3+ |marketvalue = 500 |livesin_aridshrubland = true |livesin_borealforest = true |livesin_icesheet = true |livesin_temperateforest = true |livesin_tundra = true }}
Example #2
Autopistol
"An ancient pattern blowback-operated self-loading pistol. It lacks stopping power and range, but is quick to fire."
{{infobox main|weapon|pull-left |name = Autopistol |image = Autopistol.png|Autopistol |type = Equipment{{!}}Equipment |type2 = Weapons{{!}}Weapons |description = "An ancient pattern blowback-operated self-loading pistol. It lacks stopping power and range, but is quick to fire." |class = Modern |damage = 9 |range = 24 |accuracyTouch = 91 |accuracyShort = 71 |accuracyMedium = 50 |accuracyLong = 32 |mode = Single-Shot |warmup = 54 |cooldown = 40 |burst = 1 |DPS = DPS |velocity = 55 |marketvalue = 200 }}
The above documentation is transcluded from Template:Infobox main/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |