Difference between revisions of "Template:Ctl"

From Tales of Maj'Eyal
Jump to: navigation, search
(Adjusted parameter order and added some documentation)
(Note on unsupported mastery override. Also reduced code examples to lower case for easier typing.)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{{2}}}–{{{3}}}<sup>[[Scaling#cTL|cTL:{{{1}}}{{#if:{{{4|}}}|,{{{4}}}|}}]]</sup>
+
<includeonly><onlyinclude>{{{2}}}–{{{3}}}<sup>[[Scaling#cTL|cTL:{{{1}}}{{#if:{{{4|}}}|,{{{4}}}|}}]]</sup></onlyinclude></includeonly>
  
<noinclude>
 
 
[[Category:Templates]]
 
[[Category:Templates]]
  
Line 8: Line 7:
 
This template is used to denote talent parameters that scale by the [[Scaling#cTL|combatTalentLimit]] function.
 
This template is used to denote talent parameters that scale by the [[Scaling#cTL|combatTalentLimit]] function.
  
The template accepts up to four parameters, corresponding to those in the LUA code: limit, low, high, raw. It is assumed that these parameters will be fed to the template in the order specified above.
+
The template accepts up to four parameters, corresponding to those in the LUA code: ''limit, low, high, raw''. It is assumed that these parameters will be fed to the template in the order specified above.
  
 
The first three parameters are required, but the last one is optional.
 
The first three parameters are required, but the last one is optional.
 +
 +
Note that the LUA function also accepts another parameter for mastery. If an override value is provided for mastery, then it will have to be described by separate text and is not supported by this template.
  
 
===Basic Example===
 
===Basic Example===
Line 16: Line 17:
 
If the LUA code calls for
 
If the LUA code calls for
  
  self:combatTalentLimit(t, 0, 24, 20)
+
  self:combatTalentLimit(t, 10, 2, 5)
  
 
then one should invoke the template in wiki markup with
 
then one should invoke the template in wiki markup with
  
<pre>{{CTL|0|24|20}}</pre>
+
<pre>{{ctl|10|2|5}}</pre>
  
 
which will produce the following text
 
which will produce the following text
  
  {{CTL|0|24|20}}
+
  {{ctl|10|2|5}}
  
===Remember Percentage Signs===
+
Note that any percentage signs must be inserted manually with the parameters.
 
+
Take care to insert percentage signs where appropriate, as the LUA code frequently adjusts the numbers only for the talent description. A typical talent parameter that should actually be shown as a percentage may, for example, be coded as
+
 
+
<pre>self:combatTalentLimit(t, 100, 27, 55)</pre>
+
 
+
with the percentage sign only added later, so you should enter the percentage signs into the template manually as
+
 
+
<pre>{{CTL|100%|27|55%}}</pre>
+
 
+
to produce
+
 
+
{{CTL|100%|27|55%}}
+
  
 
===Using Raw Talent Level===
 
===Using Raw Talent Level===
Line 44: Line 33:
 
If the LUA code calls for using raw talent levels as  
 
If the LUA code calls for using raw talent levels as  
  
<pre>self:combatTalentLimit(t, 100, 27, 55, true)</pre>
+
<pre>self:combatTalentLimit(t, 10, 2, 5, true)</pre>
 
+
then simply insert the text ''raw'' as the fourth parameter like so
+
  
<pre>{{CTL|100%|27|55%|raw}}</pre>
+
then simply insert the text ''raw'' as the fourth parameter as follows
  
which will render as
+
<pre>{{ctl|10|2|5|raw}}</pre>
  
{{CTL|100%|27|55%|raw}}
+
which will produce
  
</noinclude>
+
{{ctl|10|2|5|raw}}

Latest revision as of 21:12, 15 October 2021


Introduction

This template is used to denote talent parameters that scale by the combatTalentLimit function.

The template accepts up to four parameters, corresponding to those in the LUA code: limit, low, high, raw. It is assumed that these parameters will be fed to the template in the order specified above.

The first three parameters are required, but the last one is optional.

Note that the LUA function also accepts another parameter for mastery. If an override value is provided for mastery, then it will have to be described by separate text and is not supported by this template.

Basic Example

If the LUA code calls for

self:combatTalentLimit(t, 10, 2, 5)

then one should invoke the template in wiki markup with

{{ctl|10|2|5}}

which will produce the following text

2–5cTL:10

Note that any percentage signs must be inserted manually with the parameters.

Using Raw Talent Level

If the LUA code calls for using raw talent levels as

self:combatTalentLimit(t, 10, 2, 5, true)

then simply insert the text raw as the fourth parameter as follows

{{ctl|10|2|5|raw}}

which will produce

2–5cTL:10,raw