Difference between revisions of "Template:BlockVolume"
From Space Engineers Wiki
Vox Serico (talk | contribs) m (Replaced placeholders with parameters) |
Vox Serico (talk | contribs) m (Added parameter volumeonly, code cleanup) |
||
Line 1: | Line 1: | ||
− | <includeonly>{{# | + | <includeonly> |
− | + | {{#vardefine:blockwidth | {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = lwidth | small = swidth}}}}}} | |
− | + | {{#vardefine:blockheight| {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = lheight | small = sheight}}}}}} | |
− | }}</includeonly><noinclude> | + | {{#vardefine:blockdepth | {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = ldepth | small = sdepth}}}}}} |
+ | {{#vardefine:blockvolume | {{#expr: {{#var:blockwidth}} * {{#var:blockheight}} * {{#var:blockdepth}} * {{#switch:{{{2}}} | large = 15.625 | small = 0.125}}}}}} | ||
+ | {{#if:{{{volumeonly|}}} | {{#var:blockvolume}} | {{#var:blockwidth}}×{{#var:blockheight}}×{{#var:blockdepth}} ({{#var:blockvolume}} m<sup>3</sup>)}} | ||
+ | </includeonly><noinclude> | ||
+ | |||
Displays block dimensions and calculates its volume. | Displays block dimensions and calculates its volume. | ||
Line 11: | Line 15: | ||
<pre>{{BlockVolume|Large Thruster|large}}</pre> | <pre>{{BlockVolume|Large Thruster|large}}</pre> | ||
Gives {{BlockVolume|Large Thruster|large}} | Gives {{BlockVolume|Large Thruster|large}} | ||
+ | <pre>{{BlockVolume|Large Thruster|large|volumeonly=yes}}</pre> | ||
+ | Gives {{BlockVolume|Large Thruster|large|volumeonly=yes}} | ||
</noinclude> | </noinclude> |
Revision as of 16:58, 27 March 2020
Displays block dimensions and calculates its volume.
{{BlockVolume|Block name|size}}
Where Block name is the page of the block and size is small or large for respective the block size.
{{BlockVolume|Large Thruster|small}}
Gives ×× (Expression error: Unexpected * operator. m3)
{{BlockVolume|Large Thruster|large}}
Gives ×× (Expression error: Unexpected * operator. m3)
{{BlockVolume|Large Thruster|large|volumeonly=yes}}
Gives Expression error: Unexpected * operator.