Template:ShipInfobox: Difference between revisions

Infobox updated using the portable infobox migration tool
Undo revision 124740 by Emptylord (talk) That used an outdated draft, there were subsequent changes made to this template.
Line 1: Line 1:
<infobox theme="portInfobox">
<onlyinclude>
<title><default>{{PAGENAME}}</default></title>
{{#infoboxbuilder:
<image source="image"><default>Placeholder.png</default></image>
| 0:Theme = eInfobox
<group>
| 0:CustomModule = Module:ShipInfobox
    <header>Faction Specific</header>
 
    <data source="factionreq"><label>Faction</label><format>[[{{{factionreq}}}]]</format></data>
| 1:Type = Title
    <data source="factionrank">
| 1:Label = NULL
        <label>Rank Required</label>
| 1:Value = {{PAGENAME}}
        <format>{{#if: {{{factionreq|}}} | {{{factionrank}}} }}</format>
 
    </data>
| 2:Type = MainImage
</group>
| 2:Label = NULL
<group>
| 2:Value = [[File:{{{image|Placeholder.png}}}|306px]]
    <header>Default version</header>
 
    <data source="manufacturer"><label>Manufacturer</label><format>[[{{{manufacturer}}}]]</format><default>---</default></data>
| 3:Type = Header
    <data source="dimensions"><label>Dimensions</label></data>
| 3:Label = NULL
    <data source="type"><label>Type</label></data>
| 3:Value = Overview
    <data source="cost">
 
        <label>Cost</label>
| 4:Type = Line
        <format>{{{cost}}} CR</format>
| 4:Label = Manufacturer
        <!--
| 4:Value = {{#if:{{{manufacturer|}}}|[[{{{manufacturer|}}}]]|}}
        TODO: strip commas in {{{cost}}} and reformat to use commas.
 
        FormatNum.commavalue(field.Value:gsub(',',''))
| 5:Type = Line
        -->
| 5:Label = Years Produced
        <default>---</default>
| 5:Value = {{{yearsproduced|}}}
    </data>
 
    <data source="cost">
| 6:Type = Line
        <label>Insurance</label>
| 6:Label = Type
        <format>{{formatnum: {{#expr: trunc({{formatnum: {{{cost|}}}|R}}*0.05)}} }} CR</format>
| 6:Value = {{{type|}}}
            <!-- 5% of cost integer -->
 
        </data>
| 7:Type = Line
    <data source="topspeed"><label>Top Speed</label><format>{{{topspeed}}} m/s</format><default>---</default></data>
| 7:Label = Cost
    <data source="boostspeed"><label>Boost Speed</label><format>{{{boostspeed}}} m/s</format><default>---</default></data>
| 7:ValueMethod = FormatCost
    <data source="manoeuvrability"><label>Manoeuvrability</label><default>---</default></data>
| 7:Unit = CR
    <data source="shields"><label>Shields</label><format>{{{shields}}} MJ</format><default>---</default>
| 7:Value = {{{cost|}}}
        <!--
 
        TODO: strip commas in {{{cost}}} and reformat to use commas.
| 8:Type = Line
        FormatNum.commavalue(field.Value:gsub(',',''))
| 8:Label = Insurance
        -->
| 8:ValueMethod = Insurance
    </data>
| 8:Cost = {{{cost|}}}
    <data source="armour"><label>Armour</label><default>---</default></data>
| 8:Value = NULL
    <data source="hullmass"><label>Hull Mass</label><format>{{{hullmass}}} t</format><default>---</default></data>
 
    <data source="cargocapacity"><label>Cargo Capacity</label><format>{{{cargocapacity}}} t</format><default>---</default></data>
| 9:Type  = Line
    <data source="fuelcapacity"><label>Fuel Capacity</label><format>{{{fuelcapacity}}} t</format><default>---</default></data>
| 9:Label = Faction
    <data source="jumprange"><label>Unladen Jump Range</label><format>{{{jumprange}}} ly</format><default>x</default></data>
| 9:Value = {{{factionreq|}}}
    <data source="landingpad"><label>Landing Pad Size</label><default>---</default></data>
| 9:ValueMethod = Factionreq
    <data>
 
        <label>Hardpoints</label>
| 10:Type = Line
        <default>{{#if: {{{utility|}}} | {{{utility}}}× Utility {{plural: {{{utility}}} | Mount | Mounts}} <br/> }}{{#if: {{{small|}}} | {{{small}}}× Small {{plural: {{{small}}} | Hardpoint | Hardpoints}} <br/> }}{{#if: {{{medium|}}} | {{{medium}}}× Medium {{plural: {{{medium}}} | Hardpoint | Hardpoints}} <br/> }}{{#if: {{{large|}}} | {{{large}}}× Large {{plural: {{{large}}} | Hardpoint | Hardpoints}} <br/> }}{{#if: {{{huge|}}} | {{{huge}}}× Huge {{plural: {{{huge}}} | Hardpoint | Hardpoints}} <br/> }}</default>
| 10:Label = Faction Rank
        </data>
| 10:Value = {{{factionrank|}}}
    <data><label>Internals</label><default>{{#if: {{{size1|}}} | {{{size1}}}× Size 1 {{plural: {{{size1}}} | Compartment | Compartments}} <br/> }}{{#if: {{{size2|}}} | {{{size2}}}× Size 2 {{plural: {{{size2}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size3|}}} | {{{size3}}}× Size 3 {{plural: {{{size3}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size4|}}} | {{{size4}}}× Size 4 {{plural: {{{size4}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size5|}}} | {{{size5}}}× Size 5 {{plural: {{{size5}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size6|}}} | {{{size6}}}× Size 6 {{plural: {{{size6}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size7|}}} | {{{size7}}}× Size 7 {{plural: {{{size7}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size8|}}} | {{{size8}}}× Size 8 {{plural: {{{size8}}} | Compartment | Compartments }} <br/> }}{{#if: {{{reservedic|}}} | {{{reservedic}}} }}</default>
| 10:Requirement = {{{factionreq|}}}
        </data>
 
    </group>
| 11:Type  = Line
<group>
| 11:Label = Expansion
    <header>Maximum/Upgraded versions</header>
| 11:Value = {{{expansionreq|}}}
<data source="maxjumprange"><label>Jump Range</label><format>{{{maxjumprange}}} ly</format></data>
 
<data source="maxtopspeed"><label>Top Speed</label><format>{{{maxtopspeed}}} m/s</format></data>
| 12:Type = Header
<data source="maxboostspeed"><label>Top Boost</label><format>{{{maxboostspeed}}} m/s</format></data>
| 12:Label = NULL
<data source="maxcargocapacity"><label>Cargo Capacity</label><format>{{{maxcargocapacity}}} t</format><!-- TODO: Lua Function --></data>
| 12:Value = Default Specifications
</group>
 
<group>
| 13:Type = Line
    <header>Ship values</header>
| 13:Label = Landing Pad Size
    <data source="masslock"><label>Mass lock factor</label></data>
| 13:Value = {{{landingpad|}}}
</group>
 
</infobox><noinclude>
| 14:Type = Line
For the default version:
| 14:Label = Dimensions
| 14:Value = {{{dimensions|}}}
 
| 15:Type = Line
| 15:Label = Pilot Seats
| 15:Value = {{{seats|}}}
 
| 16:Type = Line
| 16:Label = Multicrew
| 16:Value = {{{multicrew|}}}
 
| 17:Type = Line
| 17:Label = Fighter Hangar
| 17:Value = {{{fighterhangar|}}}
 
| 18:Type = Line
| 18:Label = Hull Mass
| 18:ValueMethod = Quantify
| 18:Unit = t
| 18:Value = {{{hullmass|}}}
 
| 19:Type = Line
| 19:Label = Mass Lock Factor
| 19:Value = {{{masslock|}}}
 
| 20:Type = Line
| 20:Label = Armour
| 20:Value = {{{armour|}}}
 
| 21:Type = Line
| 21:Label = Armour Hardness
| 21:Value = {{{armourhardness|}}}
 
| 22:ValueMethod = FormatCost
| 22:Unit = MJ
| 22:Type = Line
| 22:Label = Shields
| 22:Value = {{{shields|}}}
 
| 23:Type = Line
| 23:Label = Manoeuvrability
| 23:Value = {{{manoeuvrability|}}}
 
| 24:Type = Line
| 24:Label = Top Speed
| 24:ValueMethod = Quantify
| 24:Unit = m/s
| 24:Value = {{{topspeed|}}}
 
| 25:Type = Line
| 25:Label = Boost Speed
| 25:ValueMethod = Quantify
| 25:Unit = m/s
| 25:Value = {{{boostspeed|}}}
 
| 26:Type = Line
| 26:Label = Unladen Jump Range
| 26:ValueMethod = Quantify
| 26:Unit = ly
| 26:Default = x
| 26:Value = {{{jumprange|}}}
 
| 27:Type = Line
| 27:Label = Cargo Capacity
| 27:ValueMethod = Quantify
| 27:Unit = t
| 27:Value = {{{cargocapacity|}}}
 
| 28:Type = Line
| 28:Label = Fuel Capacity
| 28:ValueMethod = Quantify
| 28:Unit = t
| 28:Value = {{{fuelcapacity|}}}
 
| 29:Type = Line
| 29:Label = Hardpoints
| 29:ValueMethod = Hardpoints
| 29:Utility = {{{utility|}}}
| 29:S = {{{small|}}}
| 29:M = {{{medium|}}}
| 29:L = {{{large|}}}
| 29:H = {{{huge|}}}
| 29:Value = NULL
 
| 30:Type = Line
| 30:Label = Internals
| 30:ValueMethod = Internals
| 30:S1 = {{{size1|}}}
| 30:S2 = {{{size2|}}}
| 30:S3 = {{{size3|}}}
| 30:S4 = {{{size4|}}}
| 30:S5 = {{{size5|}}}
| 30:S6 = {{{size6|}}}
| 30:S7 = {{{size7|}}}
| 30:S8 = {{{size8|}}}
| 30:Reserved = {{{reservedic|}}}
| 30:Value = NULL
 
| 31:Type = Header
| 31:Label = NULL
| 31:Value = Maximum Non-Engineered Specs
 
| 32:Type = Line
| 32:Label = Top Speed
| 32:ValueMethod = Quantify
| 32:Unit = m/s
| 32:Value = {{{maxtopspeed|}}}
 
| 33:Type = Line
| 33:Label = Boost Speed
| 33:ValueMethod = Quantify
| 33:Unit = m/s
| 33:Value = {{{maxboostspeed|}}}
 
| 34:Type = Line
| 34:Label = Unladen Jump Range
| 34:ValueMethod = Quantify
| 34:Unit = ly
| 34:Value = {{{maxjumprange|}}}
 
| 35:Type = Line
| 35:Label = Cargo Capacity
| 35:ValueMethod = MaxCargo
| 35:Unit = t
| 35:Cargo = {{{maxcargocapacity|}}}
| 35:S1 = {{{size1|}}}
| 35:S2 = {{{size2|}}}
| 35:S3 = {{{size3|}}}
| 35:S4 = {{{size4|}}}
| 35:S5 = {{{size5|}}}
| 35:S6 = {{{size6|}}}
| 35:S7 = {{{size7|}}}
| 35:S8 = {{{size8|}}}
| 35:Value = {{{maxcargocapacity|}}}{{{size1|}}}{{{size2|}}}{{{size3|}}}{{{size4|}}}{{{size5|}}}{{{size6|}}}{{{size7|}}}{{{size8|}}}
}}</onlyinclude>
<noinclude>
The blank version of this template is as follows:
<pre style="width: 300px">
<pre style="width: 300px">
{{ShipInfobox
{{ShipInfobox
| image              =  
| image              =  
| manufacturer        =  
| manufacturer        =  
| dimensions          =  
| yearsproduced      =  
| type                =  
| type                =  
| cost                =  
| cost                =  
| factionreq          =
| factionrank        =
| expansionreq        =
| landingpad          =
| dimensions          =
| seats              =
| multicrew          =
| fighterhangar      =
| hullmass            =
| masslock            =
| armour              =
| armourhardness      =
| shields            =
| manoeuvrability    =
| topspeed            =  
| topspeed            =  
| boostspeed          =  
| boostspeed          =  
| manoeuvrability    =
| jumprange          =  
| shields            =
| armour              =
| hullmass            =  
| cargocapacity      =  
| cargocapacity      =  
| fuelcapacity        =  
| fuelcapacity        =  
| jumprange          =
| landingpad          =
| utility            =  
| utility            =  
| small              =  
| small              =  
Line 94: Line 239:
| size7              =  
| size7              =  
| size8              =  
| size8              =  
}}
</pre>
Add the following text for faction requirements:
<pre style="width: 300px">
| factionreq          =
| factionrank        =
</pre>
Add the following text for reserved Internal Compartments.  Please follow the format used by the other Internal Compartments (as shown below):
<pre style="width: 300px">
| reservedic          =  
| reservedic          =  
</pre>
:;Format: #x Size ? Module
:;Example: 1x Size 6 Cargo Rack
Maximum/Upgraded version
<pre style="width: 300px">
| maxjumprange        =
| maxtopspeed        =  
| maxtopspeed        =  
| maxboostspeed      =  
| maxboostspeed      =  
| maxcargocapacity    =  
| maxjumprange        =  
}}
</pre>
</pre>
:;maxjumprange: This is the lightest possible ship version with the highest Fuel Tank available
:;maxcargocapacity: This is completed automatically if there are internal compartments
Mass lock factor
<pre style="width: 300px">
| masslock            =
</pre>
:;masslock: The mass lock factor of the ship, useful in combat
</noinclude>
</noinclude>