Template:Distance: Difference between revisions

From Baldur's Gate 3 Wiki
Jump to navigation Jump to search
No edit summary
(Use metric as basis.)
Line 1: Line 1:
<includeonly>{{SmallIcon|Range Icon.png}} {{#switch:{{{1|}}}
<includeonly>{{#lvardef: m | {{#switch: {{{1|}}}
| melee | touch = {{Distance/Transform|5}}
| melee | touch = 1.5
| reach = {{Distance/Transform|8}}
| reach = 2.5
| ranged = {{Distance/Transform|60}}
| ranged = 18
| short ranged = {{Distance/Transform|50}}
| short ranged = 15
| #default = {{#if: {{{m|}}} | {{{m}}}{{nbts}}m / {{{ft|{{color|red|Notice! Must include feet distance as well! {{Main namespace only|[[Category:Articles with incorrect usage of the Distance template]][[Category:Articles with errors]]}}}}}}}{{nbts}}ft <!-- Keeping for backward compatibility -->
| #default = {{{m|}}}
  | {{Distance/Transform|{{{ft}}}}} }}
}} }}{{SmallIcon|Range Icon.png}} {{#if: {{#lvar:m}}
| {{#lvar:m}}&#8239;m / {{m to ft | {{#lvar:m}} }}&#8239;ft
| ?&#8239;m / {{{ft|?}}}&#8239;ft {{color|red|(Distance not provided in metric!)}} {{Main namespace only|[[Category:Articles with incorrect usage of the Distance template]][[Category:Articles with errors]]}}
}}</includeonly><noinclude>
}}</includeonly><noinclude>
Usage: {{code|<nowiki>{{Distance|melee}}</nowiki>}}
Usage: {{code|<nowiki>{{Distance|melee}}</nowiki>}}
Line 23: Line 25:
Result: {{Distance|short ranged}}
Result: {{Distance|short ranged}}


Usage: {{code|<nowiki>{{Distance|m=X|ft=Y}}</nowiki>}}
Usage: {{code|<nowiki>{{Distance|m=1.5}}</nowiki>}}


Result: {{Distance|m=X|ft=Y}}
Result: {{Distance|m=1.5}}


Usage: {{code|<nowiki>{{Distance|ft=50}}</nowiki>}}
Usage: {{code|<nowiki>{{Distance|ft=50}}</nowiki>}}
Line 31: Line 33:
Result: {{Distance|ft=50}}
Result: {{Distance|ft=50}}


Usage: {{code|<nowiki>{{Distance|m=5}}</nowiki>}}
Game files use metric, and apply the calculation mentioned in [[Template:M to ft]] when the options are set to imperial. This is why the template expects a value in metric and refuses to apply the reverse transform, which may lead to unexpected results due to rounding.
 
Result: {{Distance|m=5}}
</noinclude>
</noinclude>

Revision as of 03:26, 8 April 2024

Usage: {{Distance|melee}}

Result: 1.5 m / 5 ft

Usage: {{Distance|reach}}

Result: 2.5 m / 8 ft

Usage: {{Distance|ranged}}

Result: 18 m / 60 ft

Usage: {{Distance|short ranged}}

Result: 15 m / 50 ft

Usage: {{Distance|m=1.5}}

Result: 1.5 m / 5 ft

Usage: {{Distance|ft=50}}

Result:  ? m / 50 ft (Distance not provided in metric!)

Game files use metric, and apply the calculation mentioned in Template:M to ft when the options are set to imperial. This is why the template expects a value in metric and refuses to apply the reverse transform, which may lead to unexpected results due to rounding.