Difference between revisions of "Template:Stat Factors Table"

From RimWorld Wiki
Jump to navigation Jump to search
(Now table head will display limit if that column is limited)
Line 4: Line 4:
 
-->{{#vardefine: skillBase | {{Q|{{#var: statName}}|Skill Base Factor}} }}<!--
 
-->{{#vardefine: skillBase | {{Q|{{#var: statName}}|Skill Base Factor}} }}<!--
 
-->{{#vardefine: skillBonus | {{Q|{{#var: statName}}|Skill Bonus Factor}} }}<!--
 
-->{{#vardefine: skillBonus | {{Q|{{#var: statName}}|Skill Bonus Factor}} }}<!--
-->{{#vardefine: capName | {{ucfirst:{{{2|Manipulation}}}}} }}<!--
+
-->{{#vardefine: capName | {{ucfirst:{{{2|{{#switch: 1
 +
<!-- If a cap isn't defined, is there an uncapped capacity-->
 +
| {{#ifeq: {{Q|{{#var: statName}}|Manipulation Limit}} | - |1|0}}    = Manipulation
 +
| {{#ifeq: {{Q|{{#var: statName}}|Sight Limit}} | - |1|0}}            = Sight
 +
| {{#ifeq: {{Q|{{#var: statName}}|Moving Limit}} | - |1|0}}          = Moving
 +
| {{#ifeq: {{Q|{{#var: statName}}|Talking Limit}} | - |1|0}}          = Talking
 +
| {{#ifeq: {{Q|{{#var: statName}}|Hearing Limit}} | - |1|0}}          = Hearing
 +
| {{#ifeq: {{Q|{{#var: statName}}|Eating Limit}} | - |1|0}}          = Eating
 +
| {{#ifeq: {{Q|{{#var: statName}}|Consciousness Limit}} | - |1|0}}    = Consciousness
 +
| {{#ifeq: {{Q|{{#var: statName}}|Blood Pumping Limit}} | - |1|0}}    = Blood Pumping
 +
| {{#ifeq: {{Q|{{#var: statName}}|Breathing Limit}} | - |1|0}}        = Breathing
 +
| {{#ifeq: {{Q|{{#var: statName}}|Metabolism Limit}} | - |1|0}}      = Metabolism
 +
| {{#ifeq: {{Q|{{#var: statName}}|Blood Filtration Limit}} | - |1|0}} = Blood Filtration
 +
| {{#ifeq: {{Q|{{#var: statName}}|Pain Limit}}| - |1|0}}            = Pain
 +
<!-- If no, is there an a capacity with limit > 100%-->
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Manipulation Limit}} > 1|1|0}}    = Manipulation
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Sight Limit}} > 1|1|0}}            = Sight
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Moving Limit}} > 1|1|0}}          = Moving
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Talking Limit}} > 1|1|0}}          = Talking
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Hearing Limit}} > 1|1|0}}          = Hearing
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Eating Limit}} > 1|1|0}}          = Eating
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Consciousness Limit}} > 1|1|0}}    = Consciousness
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Blood Pumping Limit}} > 1|1|0}}    = Blood Pumping
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Breathing Limit}} > 1|1|0}}        = Breathing
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Metabolism Limit}} > 1|1|0}}      = Metabolism
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Blood Filtration Limit}} > 1|1|0}} = Blood Filtration
 +
| {{#ifexpr: {{Q|{{#var: statName}}|Pain Limit}} > 1|1|0}}            = Pain
 +
<!--Is there any capacity -->
 +
| {{#if: Manipulation Importance|1|0}}    = Manipulation
 +
| {{#if: Sight Importance|1|0}}            = Sight
 +
| {{#if: Moving Importance|1|0}}          = Moving
 +
| {{#if: Talking Importance|1|0}}          = Talking
 +
| {{#if: Hearing Importance|1|0}}          = Hearing
 +
| {{#if: Eating Importance|1|0}}          = Eating
 +
| {{#if: Consciousness Importance|1|0}}    = Consciousness
 +
| {{#if: Blood Pumping Importance|1|0}}    = Blood Pumping
 +
| {{#if: Breathing Importance|1|0}}        = Breathing
 +
| {{#if: Metabolism Importance|1|0}}      = Metabolism
 +
| {{#if: Blood Filtration Importance|1|0}} = Blood Filtration
 +
| {{#if: Pain Importance|1|0}}            = Pain
 +
| #default = default
 +
}}
 +
}}}
 +
}} }}{{#ifeq:{{#var:capName}}|default|{{#vardefine: resultCols | 1 }}|<!-- If default, then no capacity is defined, only skill. Therefore, skip everything else capacity related.
 
-->{{#vardefine: capImportance | {{Q|{{#var: statName}}|{{#var: capName}} Importance}} }}<!--
 
-->{{#vardefine: capImportance | {{Q|{{#var: statName}}|{{#var: capName}} Importance}} }}<!--
 
-->{{#vardefine: capLimit | {{Q|{{#var: statName}} | {{#var: capName}} Limit | 99999999}} }}<!--
 
-->{{#vardefine: capLimit | {{Q|{{#var: statName}} | {{#var: capName}} Limit | 99999999}} }}<!--
Line 13: Line 56:
 
| {{#expr: {{#var: capLimit}} <= 1.5 }}      = {{#vardefine: resultCols | 3 }} {{#vardefine: column3Limit | {{%|{{#var: capLimit}}}}+ }}
 
| {{#expr: {{#var: capLimit}} <= 1.5 }}      = {{#vardefine: resultCols | 3 }} {{#vardefine: column3Limit | {{%|{{#var: capLimit}}}}+ }}
 
| {{#expr: {{#var: capLimit}} > 1.5 }}    = {{#vardefine: resultCols | 3 }} {{#vardefine: column3Limit | 150% }}
 
| {{#expr: {{#var: capLimit}} > 1.5 }}    = {{#vardefine: resultCols | 3 }} {{#vardefine: column3Limit | 150% }}
}}<!--
+
}}}}<!--
 
-->{| class = "wikitable" width="180" style="text-align: center;"
 
-->{| class = "wikitable" width="180" style="text-align: center;"
 
! rowspan={{#ifeq: {{#var: resultCols}} | 1 | 1 | 2}} | {{Q|{{#var: statName}}|Skill}} Skill Level
 
! rowspan={{#ifeq: {{#var: resultCols}} | 1 | 1 | 2}} | {{Q|{{#var: statName}}|Skill}} Skill Level

Revision as of 05:21, 25 April 2022

Documentation icon Template documentation[view] [edit] [history] [purge]

This template generates a table of values for a stat for the full range of skill levels, as well as showing the effect of gains in a single capacity at the 100%, 125%, and 150% levels.

If the effect of the capacity is limited, then the table will only display the columns with new information, and the column headers will be replaced to demonstrate that they only apply to

This template is dependent on Template:Stat Factors Table Row.

PLEASE NOTE: This table is not suitable for every stat page. Anything with multiple controlling capacities (i.e. capacities maximums above 100%) will not be properly represented, and the template is completely incompatible with post factored statistics. It is not feasible to create detection metrics for every single stat variant, so the editor applying the template must use it correctly. Please also read the notes and limitations below.

Notes

Planned features

These features are planned to be added in the future.

  • Currently does not account for different common values for capacities.

Features under consideration

These are under consideration as to how and whether to implement them. Direct any thoughts/opinions/feedback to User: Harakoni

  • Currently(?) does not account for Global Work Speed

Known limitations

These are unlikely to change due to the format/concept of the template.

  • Does not account for multi-skill stats.
  • Does not account for multi-capacity stats.

Parameters

The first parameter (if present) will specify which stat to generate the template for. If absent, {{PAGENAME}} will be used.

The second parameter (if present) will specify which capacity to generate the template for. If absent, it will attempt to select the most important capacity, and if none are detected, it will default to only showing the skill table.

Parameters l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20 are used to manually set values where they are not skill derived.

Example usage

{{Stat Factors Table}}

on the Butchery Efficiency page would produce:

Cooking Skill Level Butchery Efficiency
100% Manipulation 125% Manipulation 150% Manipulation
0 75%91.88% 108.75%
1 77.5%94.94% 112.38%
2 80%98% 116%
3 82.5%101.06% 119.62%
4 85%104.13% 123.25%
5 87.5%107.19% 126.88%
6 90%110.25% 130.5%
7 92.5%113.31% 134.13%
8 95%116.38% 137.75%
9 97.5%119.44% 141.37%
10 100%122.5% 145%
11 102.5%125.56% 148.62%
12 105%128.63% 152.25%
13 107.5%131.69% 155.87%
14 110%134.75% 159.5%
15 112.5%137.81% 163.12%
16 115%140.88% 166.75%
17 117.5%143.94% 170.38%
18 120%147% 174%
19 122.5%150.06% 177.63%
20 125%153.13% 181.25%
{{Stat Factors Table|Foraged Food Amount}}

on any page would produce:

Plants Skill Level Foraged Food Amount
100% Sight 125% Sight 150% Sight
0 0%0% 0%
1 9%11.03% 13.05%
2 18%22.05% 26.1%
3 27%33.08% 39.15%
4 36%44.1% 52.2%
5 45%55.13% 65.25%
6 54%66.15% 78.3%
7 63%77.18% 91.35%
8 72%88.2% 104.4%
9 81%99.23% 117.45%
10 90%110.25% 130.5%
11 99%121.28% 143.55%
12 108%132.3% 156.6%
13 117%143.33% 169.65%
14 126%154.35% 182.7%
15 135%165.38% 195.75%
16 144%176.4% 208.8%
17 153%187.43% 221.85%
18 162%198.45% 234.9%
19 171%209.48% 247.95%
20 180%220.5% 261%

Example when limit is 100%:

{{Stat Factors Table|Arrest Success Chance}}

it produces:

Social Skill Level Arrest Success Chance
0 6000%
1 6000%
2 6000%
3 6000%
4 6000%
5 6000%
6 6000%
7 6000%
8 6000%
9 6000%
10 6000%
11 6000%
12 6000%
13 6000%
14 6000%
15 6000%
16 6000%
17 6000%
18 6000%
19 6000%
20 6000%

Example when limit is >100% but <125%: Note: Research Speed is not an appropriate use of the template, as it relies equally on two different capacities, however, at the time of writing no compatible example of an inter-column limit exists:

{{Stat Factors Table|Research Speed }}

on any page would produce:

Intellectual Skill Level Research Speed
100% Manipulation 110%+ Manipulation
0 8%8.4%
1 19.5%20.48%
2 31%32.55%
3 42.5%44.63%
4 54%56.7%
5 65.5%68.78%
6 77%80.85%
7 88.5%92.93%
8 100%105%
9 111.5%117.08%
10 123%129.15%
11 134.5%141.23%
12 146%153.3%
13 157.5%165.38%
14 169%177.45%
15 180.5%189.53%
16 192%201.6%
17 203.5%213.68%
18 215%225.75%
19 226.5%237.83%
20 238%249.9%

Example when skills have to be specifically defined:

{{Stat Factors Table|Plant Harvest Yield|l0=0.60|l1=0.70|l2=0.75|l3=0.80|l4=0.85|l5=0.90|l6=0.95|l7=0.98|l8=1.00|l9=1.01|l10=1.02|l11=1.03|l12=1.04|l13=1.05|l14=1.06|l15=1.07|l16=1.08|l17=1.09|l18=1.10|l19=1.12|l20=1.13}}

it produces:

Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).Lua error in Module:Stat_Factors_Table at line 33: attempt to perform arithmetic on local 'LV' (a string value).
Plants Skill Level Plant Harvest Yield
100% Manipulation 125% Manipulation 150% Manipulation