Difference between revisions of "Template:BlockVolume"

From Space Engineers Wiki
Jump to: navigation, search
(BlockVolume template displays block dimensions and calculates its volume.)
 
m (Calculate 0.5)
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
 
{{#switch: {{{2|}}}
 
{{#switch: {{{2|}}}
  | small = {{#vardefineecho:blockwidth|{{#show: Large_Thruster |?swidth}}}}&times;{{#vardefineecho:blockheight|{{#show: Large_Thruster |?sheight}}}}&times;{{#vardefineecho:blockdepth|{{#show: Large_Thruster |?sdepth}}}} ({{#expr: {{#var:blockwidth}}*{{#var:blockheight}}*{{#var:blockdepth}}*0.5 }}&nbsp;m<sup>3</sup>)
+
  | small = {{#vardefineecho:blockwidth|{{#show: Large_Thruster |?swidth}}}}&times;{{#vardefineecho:blockheight|{{#show: Large_Thruster |?sheight}}}}&times;{{#vardefineecho:blockdepth|{{#show: Large_Thruster |?sdepth}}}} ({{#expr: {{#var:blockwidth}}*{{#var:blockheight}}*{{#var:blockdepth}}*0.125 }}&nbsp;m<sup>3</sup>)
  | large = {{#vardefineecho:blockwidth|{{#show: Large_Thruster |?lwidth}}}}&times;{{#vardefineecho:blockheight|{{#show: Large_Thruster |?lheight}}}}&times;{{#vardefineecho:blockdepth|{{#show: Large_Thruster |?ldepth}}}} ({{#expr: {{#var:blockwidth}}*{{#var:blockheight}}*{{#var:blockdepth}}*2.5 }}&nbsp;m<sup>3</sup>)
+
  | large = {{#vardefineecho:blockwidth|{{#show: Large_Thruster |?lwidth}}}}&times;{{#vardefineecho:blockheight|{{#show: Large_Thruster |?lheight}}}}&times;{{#vardefineecho:blockdepth|{{#show: Large_Thruster |?ldepth}}}} ({{#expr: {{#var:blockwidth}}*{{#var:blockheight}}*{{#var:blockdepth}}*15.625 }}&nbsp;m<sup>3</sup>)
 
}}
 
}}
 
</includeonly><noinclude>
 
</includeonly><noinclude>

Revision as of 15:06, 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)