Difference between revisions of "Template:Infobox main"
Arcangelus (talk | contribs) (Somewhat naive optimization of the template. I just Grouped the headings with related stats. EX: If the thing doesn't require a Mineable header, do not ask for the related stats again. As a side effect, it also removes the weird "Expression error: Unexpected < operator." present on some of the examples (#3, 5-8).) |
|||
Line 168: | Line 168: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important'>Fuel</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important'>Fuel</p> | ||
<dl> | <dl> | ||
− | |||
− | |||
{{#if: {{{fuel filter|}}} | | {{#if: {{{fuel filter|}}} | | ||
{{#if: {{#var:setProperty}} | {{#set:Fuel Filter = {{{fuel filter|}}} }} }} | {{#if: {{#var:setProperty}} | {{#set:Fuel Filter = {{{fuel filter|}}} }} }} | ||
Line 186: | Line 184: | ||
;<abbr title="Units of Fuel Consumed per Day/Charge">Consumption Rate</abbr> | ;<abbr title="Units of Fuel Consumed per Day/Charge">Consumption Rate</abbr> | ||
:{{{fuel consumption rate|}}} | :{{{fuel consumption rate|}}} | ||
+ | }} | ||
+ | |||
}} | }} | ||
Line 193: | Line 193: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important'>Ore</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important'>Ore</p> | ||
<dl> | <dl> | ||
− | |||
− | |||
{{#if: {{{mineable thing|}}} | | {{#if: {{{mineable thing|}}} | | ||
{{#if: {{#var:setProperty}} | {{#set:Mineable Thing = {{{mineable thing|}}} }} }} | {{#if: {{#var:setProperty}} | {{#set:Mineable Thing = {{{mineable thing|}}} }} }} | ||
Line 215: | Line 213: | ||
;Vein Size | ;Vein Size | ||
:{{{mineable scatter lump size range|}}} | :{{{mineable scatter lump size range|}}} | ||
+ | }} | ||
+ | |||
}} | }} | ||
Line 222: | Line 222: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Building</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Building</p> | ||
<dl> | <dl> | ||
− | |||
{{#if: {{{size|}}} | {{#vardefine: size | {{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{{size|}}}|}}|×| × }}|*| × }}|x| × }}|ˣ| × }}|+| +}} }} | {{#if: {{{size|}}} | {{#vardefine: size | {{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{{size|}}}|}}|×| × }}|*| × }}|x| × }}|ˣ| × }}|+| +}} }} | ||
Line 431: | Line 430: | ||
;Move Speed Factor | ;Move Speed Factor | ||
:{{%| {{{speed|}}} }} | :{{%| {{{speed|}}} }} | ||
+ | }} | ||
+ | |||
}} | }} | ||
Line 438: | Line 439: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Mechanoid</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Mechanoid</p> | ||
<dl> | <dl> | ||
− | |||
{{#if: {{{EMP resistance|}}} | | {{#if: {{{EMP resistance|}}} | | ||
Line 469: | Line 469: | ||
:{{--|{{%| {{{repair energy cost|}}} }}}} / 100 {{HP}} | :{{--|{{%| {{{repair energy cost|}}} }}}} / 100 {{HP}} | ||
}} | }} | ||
+ | |||
+ | }} | ||
+ | |||
<!-- 4. APPAREL --> | <!-- 4. APPAREL --> | ||
Line 475: | Line 478: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>{{#ifeq: {{{type|}}} | Gear | Apparel| Armor}}</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>{{#ifeq: {{{type|}}} | Gear | Apparel| Armor}}</p> | ||
<dl> | <dl> | ||
− | |||
{{#if: {{{insulationcold|}}} | | {{#if: {{{insulationcold|}}} | | ||
Line 552: | Line 554: | ||
| #default = | | #default = | ||
}} | }} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{#if: {{{coverage|}}} | | {{#if: {{{coverage|}}} | | ||
Line 572: | Line 567: | ||
}} | }} | ||
− | <!-- 5. PAWN STATS --> | + | }} |
− | <!-- Animal Health ---> | + | |
− | {{#if: {{{combatPower|}}} {{{movespeed|}}} {{{massyoung|}}} {{{massjuvenile|}}} {{{massadult|}}} {{{healthscale|}}} {{{bodysize|}}} {{{ridingspeed|}}} {{{hungerrate|}}} {{{diet|}}} {{{lifespan|}}} {{{manhunter|}}} {{{manhuntertame|}}} {{{trainable|}}} {{{wildness|}}} {{{petness|}}} {{{predator|}}} {{{roamMtb|}}} {{{nuzzleMtb|}}} {{{maturityage|}}} {{{juvenileage|}}} {{{psychic sensitivity|}}} {{{toxic resistance|}}} {{{toxic environment resistance|}}} | | + | {{#if: {{{lifestage|}}} | <!-- Was below the switch and above coverage. Taken outside "Appeal" as the Biomutation lance seems to use it. --> |
− | </dl>{{clear}} | + | {{#if: {{#var:setProperty}} | {{#set:Lifestage = {{{lifestage|}}} }} }} |
− | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Pawn Stats</p> | + | ;Lifestage |
− | <dl> | + | :{{{lifestage|}}} |
+ | }} | ||
+ | |||
+ | |||
+ | <!-- 5. PAWN STATS --> | ||
+ | <!-- Animal Health ---> | ||
+ | {{#if: {{{combatPower|}}} {{{movespeed|}}} {{{massyoung|}}} {{{massjuvenile|}}} {{{massadult|}}} {{{healthscale|}}} {{{bodysize|}}} {{{ridingspeed|}}} {{{hungerrate|}}} {{{diet|}}} {{{lifespan|}}} {{{manhunter|}}} {{{manhuntertame|}}} {{{trainable|}}} {{{wildness|}}} {{{petness|}}} {{{predator|}}} {{{roamMtb|}}} {{{nuzzleMtb|}}} {{{maturityage|}}} {{{juvenileage|}}} {{{psychic sensitivity|}}} {{{toxic resistance|}}} {{{toxic environment resistance|}}} | | ||
+ | </dl>{{clear}} | ||
+ | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Pawn Stats</p> | ||
+ | <dl> | ||
{{#ifeq: {{{type|}}} | Animals | {{#if: {{#var:setProperty}} | {{#set:Type = {{{type2|}}} }} }} }} | {{#ifeq: {{{type|}}} | Animals | {{#if: {{#var:setProperty}} | {{#set:Type = {{{type2|}}} }} }} }} | ||
Line 604: | Line 608: | ||
:{{{bodysize|}}} | :{{{bodysize|}}} | ||
− | + | <!-- Moved outside as this is always used. There is no performance difference. --> | |
{{#vardefine:MassAdult | {{#expr: 60 * {{{bodysize}}} }} }} | {{#vardefine:MassAdult | {{#expr: 60 * {{{bodysize}}} }} }} | ||
{{#if: {{#var:setProperty}} | {{#set:Mass - Adult = {{#var:MassAdult}} }} }} | {{#if: {{#var:setProperty}} | {{#set:Mass - Adult = {{#var:MassAdult}} }} }} | ||
+ | {{#vardefine:PackCapacity | {{#expr: {{{bodysize|}}} * 35 }} }} | ||
+ | |||
+ | {{#ifeq: {{{type|}}} | Mechanoid | | ||
;Mass | ;Mass | ||
:{{#var:MassAdult}} kg | :{{#var:MassAdult}} kg | ||
− | |||
− | |||
{{#if: {{#var:setProperty}} | {{#set:Pack Capacity = {{#var:PackCapacity}} }} }} | {{#if: {{#var:setProperty}} | {{#set:Pack Capacity = {{#var:PackCapacity}} }} }} | ||
;Pack Capacity | ;Pack Capacity | ||
Line 619: | Line 624: | ||
{{#ifeq: {{{type|}}} | Entity | | {{#ifeq: {{{type|}}} | Entity | | ||
− | |||
− | |||
;Mass | ;Mass | ||
:{{#var:MassAdult}} kg | :{{#var:MassAdult}} kg | ||
− | |||
| | | | ||
<!-- Most animal babies are 0.2 the size of the adults, but birds are 0.1 --> | <!-- Most animal babies are 0.2 the size of the adults, but birds are 0.1 --> | ||
Line 640: | Line 642: | ||
:{{#var:MassJuvenile}} kg | :{{#var:MassJuvenile}} kg | ||
− | |||
− | |||
;Mass - Adult | ;Mass - Adult | ||
:{{#var:MassAdult}} kg | :{{#var:MassAdult}} kg | ||
{{#ifeq: {{lc:{{{packanimal|}}} }} | true | | {{#ifeq: {{lc:{{{packanimal|}}} }} | true | | ||
− | |||
{{#if: {{#var:setProperty}} | {{#set:Pack Capacity = {{#var:PackCapacity}} }} }} | {{#if: {{#var:setProperty}} | {{#set:Pack Capacity = {{#var:PackCapacity}} }} }} | ||
;Pack Capacity | ;Pack Capacity | ||
Line 660: | Line 659: | ||
:{{#var:CarryingCapacity}} kg | :{{#var:CarryingCapacity}} kg | ||
}} | }} | ||
− | |||
− | |||
− | |||
}} | }} | ||
Line 821: | Line 817: | ||
{{#if: {{{livesin_icesheet|}}} | {{#if: {{#var:setProperty}} | {{#set:Lives In Ice Sheet = true }} }} }} | {{#if: {{{livesin_icesheet|}}} | {{#if: {{#var:setProperty}} | {{#set:Lives In Ice Sheet = true }} }} }} | ||
{{#if: {{{livesin_seaice|}}} | {{#if: {{#var:setProperty}} | {{#set:Lives In Sea Ice = true }} }} }} | {{#if: {{{livesin_seaice|}}} | {{#if: {{#var:setProperty}} | {{#set:Lives In Sea Ice = true }} }} }} | ||
+ | }} | ||
<!-- 6. PRODUCTION --> | <!-- 6. PRODUCTION --> | ||
Line 827: | Line 824: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Production</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Production</p> | ||
<dl> | <dl> | ||
− | |||
{{#ifexpr: {{{meatyield|1}}} * {{{basemeatamount|1}}} | {{#ifexpr: {{{meatyield|1}}} * {{{basemeatamount|1}}} | ||
Line 950: | Line 946: | ||
}} | }} | ||
+ | }} | ||
<!-- 7. INGESTION --> | <!-- 7. INGESTION --> | ||
Line 956: | Line 953: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Ingestion</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Ingestion</p> | ||
<dl> | <dl> | ||
− | |||
{{#if: {{{nutrition|}}} | | {{#if: {{{nutrition|}}} | | ||
Line 1,011: | Line 1,007: | ||
:{{ticks| {{{ingestion time|}}} }} | :{{ticks| {{{ingestion time|}}} }} | ||
}} | }} | ||
− | + | }} | |
<!-- 8. STAT MODIFIERS (for Materials) --> | <!-- 8. STAT MODIFIERS (for Materials) --> | ||
Line 1,018: | Line 1,014: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Stat Modifiers</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Stat Modifiers</p> | ||
<dl> | <dl> | ||
− | |||
{{#if: {{{beauty factor|}}} | | {{#if: {{{beauty factor|}}} | | ||
Line 1,120: | Line 1,115: | ||
;Rest Effectiveness | ;Rest Effectiveness | ||
:×{{{rest effectiveness factor|}}} | :×{{{rest effectiveness factor|}}} | ||
+ | }} | ||
}} | }} | ||
Line 1,127: | Line 1,123: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Mechanitor</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Mechanitor</p> | ||
<dl> | <dl> | ||
− | |||
{{#if: {{{mech bandwidth|}}} | | {{#if: {{{mech bandwidth|}}} | | ||
Line 1,175: | Line 1,170: | ||
;Work Speed Offset | ;Work Speed Offset | ||
:{{+|{{%| {{{mech work speed offset|}}} }}}} | :{{+|{{%| {{{mech work speed offset|}}} }}}} | ||
+ | }} | ||
}} | }} | ||
Line 1,182: | Line 1,178: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Medical</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Medical</p> | ||
<dl> | <dl> | ||
− | |||
{{#if: {{{medical potency base|}}} | | {{#if: {{{medical potency base|}}} | | ||
Line 1,195: | Line 1,190: | ||
:{{%| {{{medical quality max|}}} }} | :{{%| {{{medical quality max|}}} }} | ||
}} | }} | ||
− | + | }} | |
<!-- 10. PLANT STATS --> | <!-- 10. PLANT STATS --> | ||
Line 1,202: | Line 1,197: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Plant Stats</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Plant Stats</p> | ||
<dl> | <dl> | ||
− | |||
{{#if: {{{grow days|}}} | | {{#if: {{{grow days|}}} | | ||
Line 1,260: | Line 1,254: | ||
}} | }} | ||
− | {{#if: {{{fertility sensitivity|}}} | | + | {{#if: {{{fertility sensitivity|}}} | <!-- Combined, due to prior redundant condition --> |
{{#if: {{#var:setProperty}} | {{#set:Fertility Sensitivity = {{{fertility sensitivity|}}} }} }} | {{#if: {{#var:setProperty}} | {{#set:Fertility Sensitivity = {{{fertility sensitivity|}}} }} }} | ||
;Fertility Sensitivity | ;Fertility Sensitivity | ||
:{{%| {{{fertility sensitivity|}}} }} | :{{%| {{{fertility sensitivity|}}} }} | ||
− | |||
− | |||
{{#if: {{#var:setProperty}} | {{#set:Min Grow Light = {{{min grow light|0.5}}} }} }} | {{#if: {{#var:setProperty}} | {{#set:Min Grow Light = {{{min grow light|0.5}}} }} }} | ||
;Min light to grow | ;Min light to grow | ||
Line 1,277: | Line 1,269: | ||
{{#if: {{#pos:{{{sowTags|}}}|Hydroponic}} | {{#if: {{#var:setProperty}} | {{#set:Harvest Yield Per Day (280) = {{#expr: {{{yield|}}}/( ({{{grow days|}}}/0.54167) / (((2.8-1)*{{{fertility sensitivity|}}}) + 1)) round 2}} }} }} }} | {{#if: {{#pos:{{{sowTags|}}}|Hydroponic}} | {{#if: {{#var:setProperty}} | {{#set:Harvest Yield Per Day (280) = {{#expr: {{{yield|}}}/( ({{{grow days|}}}/0.54167) / (((2.8-1)*{{{fertility sensitivity|}}}) + 1)) round 2}} }} }} }} | ||
}} }} }} | }} }} }} | ||
+ | }} | ||
<!-- WEAPONS --> | <!-- WEAPONS --> | ||
− | <!-- 11. RANGED COMBAT --> | + | <!-- 11. RANGED COMBAT --> <!-- "Damage type" removed from this IF because it requires a defined "damage" field to be set. Replaced with "mode". --> |
− | {{#if: {{{ | + | {{#if: {{{mode|}}} {{{damage|}}} {{{armorPenetration|}}} {{{warmup|}}} {{{cooldown|}}} {{{range|}}} {{{minrange|}}} {{{accuracy|}}} {{{accuracyTouch|}}} {{{accuracyShort|}}} {{{accuracyMedium|}}} {{{accuracyLong|}}} {{{velocity|}}} {{{burst|}}} {{{burstTicks|}}} {{{missRadius|}}} {{{blastRadius|}}} {{{DPS|}}} {{{stoppingPower|}}} | |
</dl>{{clear}} | </dl>{{clear}} | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Ranged Combat</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Ranged Combat</p> | ||
<dl> | <dl> | ||
− | |||
{{#if: {{{mode|}}} | | {{#if: {{{mode|}}} | | ||
Line 1,389: | Line 1,381: | ||
:{{#var:maximumDPS}} | :{{#var:maximumDPS}} | ||
}} | }} | ||
− | |||
{{#if: {{{stoppingPower|}}} | | {{#if: {{{stoppingPower|}}} | | ||
Line 1,395: | Line 1,386: | ||
;<abbr title="Ability of a weapon to 'stagger' targets, slowing them down for a short while. Larger values allow the weapon to stagger targets with bigger body sizes.">Stopping power</abbr> | ;<abbr title="Ability of a weapon to 'stagger' targets, slowing them down for a short while. Larger values allow the weapon to stagger targets with bigger body sizes.">Stopping power</abbr> | ||
:{{{stoppingPower|}}} | :{{{stoppingPower|}}} | ||
+ | }} | ||
}} | }} | ||
+ | <!-- 12. MELEE COMBAT --> <!-- Reduced IF as some of these make no sense if the previous ones aren't defined.--> | ||
+ | {{#if: {{{attack1label|}}}{{{attack1labelNoLocation|}}}{{{attack1dmg|}}}{{{attack1ap|}}}{{{attack1type|}}}{{{attack1part|}}}{{{attack1cool|}}}<!-- | ||
+ | -->{{{attack2label|}}}{{{attack2labelNoLocation|}}}{{{attack2dmg|}}}{{{attack2ap|}}}{{{attack2type|}}}{{{attack2part|}}}{{{attack2cool|}}}<!-- | ||
+ | -->{{{attack3label|}}}{{{attack3labelNoLocation|}}}{{{attack3dmg|}}}{{{attack3ap|}}}{{{attack3type|}}}{{{attack3part|}}}{{{attack3cool|}}}<!-- | ||
+ | -->{{{attack4label|}}}{{{attack4labelNoLocation|}}}{{{attack4dmg|}}}{{{attack4ap|}}}{{{attack4type|}}}{{{attack4part|}}}{{{attack4cool|}}}<!-- | ||
+ | -->{{{attack5label|}}}{{{attack5labelNoLocation|}}}{{{attack5dmg|}}}{{{attack5ap|}}}{{{attack5type|}}}{{{attack5part|}}}{{{attack5cool|}}}<!-- | ||
+ | -->{{{attack6label|}}}{{{attack6labelNoLocation|}}}{{{attack6dmg|}}}{{{attack6ap|}}}{{{attack6type|}}}{{{attack6part|}}}{{{attack6cool|}}}<!-- | ||
+ | -->{{{attack7label|}}}{{{attack7labelNoLocation|}}}{{{attack7dmg|}}}{{{attack7ap|}}}{{{attack7type|}}}{{{attack7part|}}}{{{attack7cool|}}}<!-- | ||
+ | -->{{{meleeattack1dmg|}}}{{{meleeattack1type|}}}{{{meleeattack1part|}}}{{{meleeattack1cool|}}} {{{MeleeWeaponAverageDPS|}}} {{{MeleeWeaponAverageAP|}}}| | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</dl>{{clear}} | </dl>{{clear}} | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Melee Combat</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Melee Combat</p> | ||
<dl> | <dl> | ||
− | |||
− | <!-- Animal Melee Combat --> | + | <!-- Animal Melee Combat // This increments depth by 1. I deem the -2500 Preprocessor visited node count, -3000 Post-expand include size, and -100 template size worth it. --> |
{{#if: {{{attack1dmg|}}}{{{attack1type|}}}{{{attack1part|}}}{{{attack1cool|}}} | | {{#if: {{{attack1dmg|}}}{{{attack1type|}}}{{{attack1part|}}}{{{attack1cool|}}} | | ||
{{#if: {{#var:setProperty}} | {{#set:Attack 1 Label = {{{attack1label|}}} }} }} | {{#if: {{#var:setProperty}} | {{#set:Attack 1 Label = {{{attack1label|}}} }} }} | ||
Line 1,575: | Line 1,566: | ||
− | {{#if: {{#varexists: Attack1DPS}} | | + | {{#if: {{#varexists: Attack1DPS}} | <!-- Defined on the "attack1" block.--> |
{{#vardefine:MobAverageDPS|{{#expr:0.62*{{True Melee DPS Calculator|{{#var:Name}} }} }} }}{{#if: {{#var:setProperty}} | {{#set:Mob Average DPS = {{#var:MobAverageDPS}} }} }} | {{#vardefine:MobAverageDPS|{{#expr:0.62*{{True Melee DPS Calculator|{{#var:Name}} }} }} }}{{#if: {{#var:setProperty}} | {{#set:Mob Average DPS = {{#var:MobAverageDPS}} }} }} | ||
;Average {{DPS}} | ;Average {{DPS}} | ||
:{{#var:MobAverageDPS}} | :{{#var:MobAverageDPS}} | ||
+ | }} | ||
}} | }} | ||
Line 1,682: | Line 1,674: | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Creation</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important; margin: 0.5em 0 0.5em !important'>Creation</p> | ||
<dl> | <dl> | ||
− | |||
− | {{#if: {{{production facility 1|}}} | {{#if: {{#var:setProperty}} | {{#set:Production Facility 1 = {{{production facility 1| | + | {{#if: {{{production facility 1|}}} | <!-- Compressed --> |
− | {{#if: {{{production facility 2|}}} | {{#if: {{#var:setProperty}} | {{#set:Production Facility 2 = {{{production facility 2|}}} }} }} }} | + | {{#if: {{#var:setProperty}} | {{#set:Production Facility 1 = {{{production facility 1|}}} }} }} |
− | {{#if: {{{production facility 3|}}} | {{#if: {{#var:setProperty}} | {{#set:Production Facility 3 = {{{production facility 3|}}} }} }} }} | + | {{#if: {{{production facility 2|}}} | {{#if: {{#var:setProperty}} | {{#set:Production Facility 2 = {{{production facility 2|}}} }} }} }} |
− | {{#if: {{{production facility 4|}}} | {{#if: {{#var:setProperty}} | {{#set:Production Facility 4 = {{{production facility 4|}}} }} }} }} | + | {{#if: {{{production facility 3|}}} | {{#if: {{#var:setProperty}} | {{#set:Production Facility 3 = {{{production facility 3|}}} }} }} }} |
− | + | {{#if: {{{production facility 4|}}} | {{#if: {{#var:setProperty}} | {{#set:Production Facility 4 = {{{production facility 4|}}} }} }} }} | |
;Crafted At | ;Crafted At | ||
− | : | + | :{{Icon Small|{{{production facility 1|}}}|{{#switch:{{lc:{{{production facility 1|}}} }}|butcher spot|crafting spot|campfire|fermenting barrel|nutrient paste dispenser=16|#default=32}} }}{{#if:{{{production facility 2|}}}| / {{Icon Small|{{{production facility 2|}}}|{{#switch:{{lc:{{{production facility 2|}}} }}|butcher spot|crafting spot|campfire|fermenting barrel|nutrient paste dispenser=16|#default=32}} }} }}{{#if:{{{production facility 3|}}}| / {{Icon Small|{{{production facility 3|}}}|{{#switch:{{lc:{{{production facility 3|}}} }}|butcher spot|crafting spot|campfire|fermenting barrel|nutrient paste dispenser=16|#default=32}} }} }}{{#if:{{{production facility 4|}}}| / {{Icon Small|{{{production facility 4|}}}|{{#switch:{{lc:{{{production facility 4|}}} }}|butcher spot|crafting spot|campfire|fermenting barrel|nutrient paste dispenser=16|#default=32}} }} }} |
}} | }} | ||
+ | <!-- Research section --> | ||
{{#if: {{#vardefineecho:research|{{{research|}}} }} | {{#vardefine:research1|{{ucfirst:{{#explode:{{#var:research}}|,|0}} }} }}{{#vardefine:research2|{{ucfirst:{{#explode:{{#var:research}}|,|1}} }} }}{{#vardefine:research3|{{ucfirst:{{#explode:{{#var:research}}|,|2}} }} }}{{#vardefine:research4|{{ucfirst:{{#explode:{{#var:research}}|,|3}} }} }}{{#vardefine:research5|{{ucfirst:{{#explode:{{#var:research}}|,|4}} }} }} | {{#if: {{#vardefineecho:research|{{{research|}}} }} | {{#vardefine:research1|{{ucfirst:{{#explode:{{#var:research}}|,|0}} }} }}{{#vardefine:research2|{{ucfirst:{{#explode:{{#var:research}}|,|1}} }} }}{{#vardefine:research3|{{ucfirst:{{#explode:{{#var:research}}|,|2}} }} }}{{#vardefine:research4|{{ucfirst:{{#explode:{{#var:research}}|,|3}} }} }}{{#vardefine:research5|{{ucfirst:{{#explode:{{#var:research}}|,|4}} }} }} | ||
{{#if: {{#var:setProperty}} | {{#set: | {{#if: {{#var:setProperty}} | {{#set: | ||
Line 1,829: | Line 1,821: | ||
-->|}}<!-- | -->|}}<!-- | ||
-->}} | -->}} | ||
− | + | }} | |
<!-- 14. ABILITY --> | <!-- 14. ABILITY --> | ||
Line 1,893: | Line 1,885: | ||
}} | }} | ||
− | <!-- Containment --> | + | <!-- 14.5 Containment --> |
{{#if: {{{containment strength|}}} {{{containment offset|}}} {{{containment factor|}}} {{{minimum containment strength|}}} {{{anomaly knowledge|}}} {{{anomaly knowledge offset|}}} {{{knowledge category|}}} {{{study interval|}}} {{{gets cold containment bonus|}}} {{{min monolith level|}}} {{{min monolith level for study|}}} {{{requires holding platform|}}} {{{requires imprisonment|}}} {{{base escape interval MTB days|}}} | | {{#if: {{{containment strength|}}} {{{containment offset|}}} {{{containment factor|}}} {{{minimum containment strength|}}} {{{anomaly knowledge|}}} {{{anomaly knowledge offset|}}} {{{knowledge category|}}} {{{study interval|}}} {{{gets cold containment bonus|}}} {{{min monolith level|}}} {{{min monolith level for study|}}} {{{requires holding platform|}}} {{{requires imprisonment|}}} {{{base escape interval MTB days|}}} | | ||
</dl>{{clear}} | </dl>{{clear}} | ||
<p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important'>Containment</p> | <p class='subheading' style='height: 1em !important; padding: 0.25em 0 0.5em !important'>Containment</p> | ||
<dl> | <dl> | ||
− | |||
{{#if: {{{containment strength|}}} | | {{#if: {{{containment strength|}}} | | ||
Line 1,984: | Line 1,975: | ||
;Escape Interval | ;Escape Interval | ||
:{{MTB}} {{{base escape interval MTB days|}}} days | :{{MTB}} {{{base escape interval MTB days|}}} days | ||
+ | }} | ||
}} | }} | ||
Revision as of 19:05, 14 January 2025
This page has been suggested for recoding. Reason: 1) Doesn't play nice with skins - font color changes, but not background. Background either needs to be transparent or use color from skin. 2) Equip delay (see tag on that page). You can help RimWorld Wiki by improving it. |
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
This section is a stub. You can help RimWorld Wiki by expanding it. Reason: Parity with available parameters and documentation (List & Table). |
- 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)
Parameter List
Parameter Table
Parameter | Dependencies | Type/Unit | Property / Stat | Description | Expandxml-tag / hierarchy |
---|
Deprecated positional parameters
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.
Examples
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. |