Difference between revisions of "Template:BlockVolume"

From Space Engineers Wiki
Jump to: navigation, search
m (Added parameter volumeonly, code cleanup)
m (Whitespace cleanup)
Line 1: Line 1:
<includeonly>
+
<includeonly>{{#vardefine:blockwidth | {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = lwidth | small = swidth}}}}}}
{{#vardefine:blockwidth | {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = lwidth | small = swidth}}}}}}
 
 
{{#vardefine:blockheight| {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = lheight | small = sheight}}}}}}
 
{{#vardefine:blockheight| {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = lheight | small = sheight}}}}}}
 
{{#vardefine:blockdepth | {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = ldepth | small = sdepth}}}}}}
 
{{#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}}}}}}
 
{{#vardefine:blockvolume | {{#expr: {{#var:blockwidth}} * {{#var:blockheight}} * {{#var:blockdepth}} * {{#switch:{{{2}}} | large = 15.625 | small = 0.125}}}}}}
{{#if:{{{volumeonly|}}} | {{#var:blockvolume}} | {{#var:blockwidth}}&times;{{#var:blockheight}}&times;{{#var:blockdepth}} ({{#var:blockvolume}}&nbsp;m<sup>3</sup>)}}
+
{{#if:{{{volumeonly|}}} | {{#var:blockvolume}} | {{#var:blockwidth}}&times;{{#var:blockheight}}&times;{{#var:blockdepth}} ({{#var:blockvolume}}&nbsp;m<sup>3</sup>)}}</includeonly><noinclude>
</includeonly><noinclude>
 
  
 
Displays block dimensions and calculates its volume.
 
Displays block dimensions and calculates its volume.

Revision as of 16:59, 27 March 2020


Displays block dimensions and calculates its volume.

Usage:
{{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.