Bulbapedia talk:Project Moves and Abilities: Difference between revisions

Line 608: Line 608:
::Anyways, I tested this function for the current [[:Template:MoveInfobox|MoveInfobox template]], simply by adding it to the ''includeonly'' tags. This will automatically categorize the move if and only if the power field is an integer. Thus, values such as "-" and "Varies" and "<nowiki>{{tt|420|88 in gen VII}}</nowiki>" would not be counted for.
::Anyways, I tested this function for the current [[:Template:MoveInfobox|MoveInfobox template]], simply by adding it to the ''includeonly'' tags. This will automatically categorize the move if and only if the power field is an integer. Thus, values such as "-" and "Varies" and "<nowiki>{{tt|420|88 in gen VII}}</nowiki>" would not be counted for.
::<code><nowiki>{{#iferror: {{#ifexpr: {{{power}}} > 0}}||[[Category: Moves with a power of {{{power}}}]]}}</nowiki></code>
::<code><nowiki>{{#iferror: {{#ifexpr: {{{power}}} > 0}}||[[Category: Moves with a power of {{{power}}}]]}}</nowiki></code>
::I know that because of this, moves with notes due to inter-generation changes will not be affected. One solution is to slightly change the MoveInfobox template so that power and notes regarding power are separate fields, so that the parser function can eventually work for all moves with a numeric power. This can be done cleanly, since moves without notes on their power will be unaffected, and moves that need to be changed will not look different until manually changed. [[User:TehPerson|TehPerson]] ([[User talk:TehPerson|talk]]) 14:58, 17 July 2015 (UTC)
::I know that because of this, moves with notes due to inter-generation changes will not be affected. One solution is to slightly change the MoveInfobox template so that power and notes regarding power are separate fields, so that the parser function can eventually work for all moves with a numeric power. This can be done cleanly, since moves without notes on their power will be unaffected, and moves that need to be changed will not look different until manually changed.  
::The code for doing so is simply <code>{{#if:{{{power note|}}}|{{tt|*|{{{power note}}}}}}}</code>, placed right after where the base power should appear.
::The same can also be done for accuracy, simply replacing all instances of "power" with "accuracy."
::[[User:TehPerson|TehPerson]] ([[User talk:TehPerson|talk]]) 14:58, 17 July 2015 (UTC)