User:PSGarak/Sandbox/Scaling

From Fallen London Wiki

<!-- Parse input ranges like "+70 CP, down to +14 CP" into numeric parameters like y_initial = 70, r = -56. -->{{#vardefine:y_initial|{{#invoke:String|match|{{{Output range}}}|pattern=%d+|match=1}} }}<!-- -->{{#vardefine:r|{{#expr:{{#invoke:String|match|{{{Output range}}}|pattern=%d+|match=-1}} - {{#var:y_initial}} }} }}<!-- -->{{#vardefine:dir|{{#ifexpr:{{#var:r}} > 0|up|down}} }}<!-- This text appears in-line where the Template is invoked. -->from {{{Output range}}}, depending on {{IL|{{{Condition}}}|Appearance={{{Condition alias|{{{Condition}}}}}}}}<!-- The ref tag locates the rest of the text into a footnote, placed by default at the bottom of the page. -->{{#tag:ref|{{{Effect}}} uses [[Logistic Scaling]] to {{#ifeq:{{#var:dir}}|up|increase|decrease}} with higher values of {{IL|{{{Condition}}}|Appearance={{{Condition alias|{{{Condition}}}}}}}}, using the following parameters: {{#ifexpr:{{#var:y_initial}} > 0|* Offset '''''C''''' is {{#var:y_initial}}}} * Output range '''''R''''' is {{#var:r}} * Inflection point '''''I''''' is when {{{Condition alias|{{{Condition}}}}}} = {{{midpoint}}} * Scaling factor '''''k''''' is {{{k}}} The table below summarizes possible values: {{SCurveTable |Condition = {{{Condition}}} |Condition alias = {{{Condition alias|{{{Condition}}}}}} |Effect = {{{Effect}}} |xmin = {{#explode:{{{Input range|0-1}}}|-|0}} |xmax = {{#explode:{{{Input range|0-1}}}|-|1}} |height = {{#var:r}} |y_offset = {{#var:y_initial}} |midpoint = {{{midpoint}}} |k = {{{k}}} |Round = {{{Round|yes}}} |compact = {{{Round|no}}} }}}}