Difference between revisions of "Template:BlockVolume"

From Space Engineers Wiki
Jump to: navigation, search
m (Corrected 0.5 and 2.5 multipliers to their cubes)
m (Replaced placeholders with parameters)
Line 1: Line 1:
<includeonly>
+
<includeonly>{{#switch: {{{2|}}}
{{#switch: {{{2|}}}
+
  | small = {{#vardefineecho:blockwidth|{{#show: {{{1|}}}|?swidth}}}}&times;{{#vardefineecho:blockheight|{{#show: {{{1|}}}|?sheight}}}}&times;{{#vardefineecho:blockdepth|{{#show: {{{1|}}}|?sdepth}}}} ({{#expr: {{#var:blockwidth}}*{{#var:blockheight}}*{{#var:blockdepth}}*0.125 }}&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: {{{1|}}}|?lwidth}}}}&times;{{#vardefineecho:blockheight|{{#show: {{{1|}}}|?lheight}}}}&times;{{#vardefineecho:blockdepth|{{#show: {{{1|}}}|?ldepth}}}} ({{#expr: {{#var:blockwidth}}*{{#var:blockheight}}*{{#var:blockdepth}}*15.625 }}&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>
 
 
Displays block dimensions and calculates its volume.
 
Displays block dimensions and calculates its volume.
  

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