Template:Distance: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
m (Use nbsp.)
(Cleanup.)
 
Line 1: Line 1:
<includeonly>{{#lvardef: m | {{#switch: {{{1|}}}
<includeonly>{{SmallIcon|Range Icon.png}} {{#switch: {{{1|}}}
| melee | touch = 1.5
| melee | touch = 1.5&#8239;m / 5&#8239;ft
| reach = 2.5
| reach = 2.5&#8239;m / 8&#8239;ft
| ranged = 18
| ranged = 18&#8239;m / 60&#8239;ft
| short ranged = 15
| short ranged = 15&#8239;m / 50&#8239;ft
| #default = {{{m|}}}
| #default = {{#if: {{{m|}}}
}} }}{{SmallIcon|Range Icon.png}}&nbsp;{{#if: {{#lvar:m}}
  | {{{m}}}&#8239;m / {{m to ft | {{{m}}} }}&#8239;ft
| {{#lvar:m}}&#8239;m / {{m to ft | {{#lvar:m}} }}&#8239;ft
  | {{#expr: {{{ft|0}}} * 3 / 10 }}&#8239;m / {{{ft|0}}}&#8239;ft {{color|red|(ERROR: Distance not in metric!)}} {{Main namespace only|[[Category:Articles with incorrect usage of the Distance template]][[Category:Articles with errors]]}}
| ?&#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>}}

Latest revision as of 04:22, 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: 15 m / 50 ft (ERROR: Distance not 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.