Template talk:Calculate

Rework suggestion
I'd like your opinions on reworking this template to use named parameters instead of the generic ones we are currently using (v1, v2, ...). Imo with the current template it is often very hard to understand (especially for newer editors) what the calculation actualy does. My suggestion would be to replace the current  with descriptive parameters like.

With this change a calculation like this:

would turn into this:

which is much easier to understand without having to look up what the individual values are.

The disadvantage would be that it would slightly decrease page-load times. I tested it with 40 usages each and with the new template took a bit longer to load: 100.00% 227.326      1 -total 55.59% 126.368     40 User:Litzsch/Sandbox3 40.80%  92.754     40 Template:Calc What are your opinions on this? -- Litzsch 23:00, 24 February 2018 (UTC)


 * How about we go a step further and leave out the x=x parts at the end completely, and make it automatically call the values based on which trait is being given? It would make it even simplier to use.
 * So instead of
 * It would just be
 * So instead of putting some custom name for the variables, they would require to match the actual trait text.
 *  Bu3ny  (talk) 00:02, 25 February 2018 (UTC)
 * So instead of putting some custom name for the variables, they would require to match the actual trait text.
 *  Bu3ny  (talk) 00:02, 25 February 2018 (UTC)


 * I'm not sure if that's possible without affecting the performance heavily. This would require first looping through all traits, values, value tal, value aghs, value aghs tal and checking individually if they exist. Instead of using #show 2 times it would require using it 40 times in the case of Paralyzing Cask (I don't think #ask works in scribunto but I'll try it tomorrow).
 * Also I don't think it's possible to find out in which ability the template is used (The only way I can think of would be loading the page text and manually parsing it, which would once again heavily impact performance).
 * The third problem I see is that including the #show in the template might limit it's usefulness, as it would prevent manually entering the values if necessary.
 * EDIT: Another thing I just remembered is that not all values are called through #show (for example talents) so that would have to be accounted for as well. -- Litzsch 00:22, 25 February 2018 (UTC)


 * Scrap that idea then. I personally would keep it with v1/v2 then, because it's cleaner.  Bu3ny  (talk) 01:24, 25 February 2018 (UTC)


 * Ok I played around with #ask in scribunto for a bit and it should be possible to choose a trait by its name. However this would require the hero and the ability name in addition to the trait text . Also there would have to be a way to differentiate between the value, the value tal, the value aghs and the value aghs tal parameters.
 * Another possibility would be just putting the actual values directly in the calc . This approach could get even more unreadable than the current one though as soon as #show gets involved so it's probably not a good idea. -- Litzsch  13:53, 26 February 2018 (UTC)

Template malfunctions with talents
The template shows errors when putting in talent values with the template:Show template.

This

results in this

It works if you use, instead of the Show template.
 *  Bu3ny  (talk) 10:51, 12 August 2018 (UTC)