Difference between revisions of "User:DedMazday/test4"
Line 1: | Line 1: | ||
− | {{#if: {{{volume|}}}|{{#if: {{{ | + | <includeonly>{{Infobox|width=280 |
+ | |name={{Dict/part name|{{#if: {{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}}} | ||
+ | |file={{{file|}}} | ||
+ | |hovertext={{Infobox/Part/Dict|Image}} | ||
+ | |lines= | ||
+ | <!-- Type --> | ||
+ | {{Infobox/Line|{{#if: {{Infobox/Part/roles|{{{type|}}}|{{{role|}}}}}|'''{{Infobox/Part/roles|{{{type|}}}|{{{role|}}}}}'''}} <span style{{=}}"font-size:smaller; white-space:normal;">{{Dict|by}} {{#if: {{{type|}}}{{{role|}}}|<br/>}}{{Infobox/Part/Manufacturer entry|{{Infobox/Part/ManufacturerUntranslated|{{#if: {{{manufacturer|}}}|{{{manufacturer}}}|?}}}}|{{Infobox/Part/Manufacturer|{{#if: {{{manufacturer|}}}|{{{manufacturer}}}|?}}}}}}{{#if: {{{manufacturer2|}}}| | ||
+ | <!-- Type --> | ||
+ | {{Dict|and}} {{Infobox/Part/Manufacturer entry|{{Infobox/Part/ManufacturerUntranslated|{{#if: {{{manufacturer2|}}}|{{{manufacturer2}}}|?}}}}|{{Infobox/Part/Manufacturer|{{#if: {{{manufacturer2|}}}|{{{manufacturer2}}}|?}}}}}}}}</span>|style=text-align: center}}{{#if: {{{size|}}}|<br/> | ||
+ | <!-- Manufacturer --> | ||
+ | {{Infobox/Line|[[Radial size{{if lang}}|{{Infobox/Part/Dict|Size}}]]|<span style{{=}}"white-space:normal;">{{Radial size|{{{size}}}}}{{#if: {{{size2|}}}|, {{Radial size|{{{size2}}}}}}}{{#if: {{{size3|}}}|, {{Radial size|{{{size3}}}}}}}</span>}}}} | ||
+ | <!-- Cost --> | ||
+ | {{Infobox/Line|{{Dict|Cost}}|{{Formatnum|{{{costs}}}|2}} {{Mark|fund}}|{{#if: {{{lf|}}}{{{ox|}}}{{{mp|}}}{{{sf|}}}{{{xg|}}}{{{ia|}}}{{{or|}}}{{{ab|}}}|{{Formatnum|{{#expr: {{{costs}}}-(({{{lf|0}}})*0.8+({{#if: {{{ox|}}}|{{{ox}}}|{{#if: {{{lf|}}}|{{{lf}}}*11/9|0}}}})*0.18+({{{mp|0}}})*1.2+({{{sf|0}}})*0.6+({{{xg|0}}})*4+({{{ia|0}}})*0+({{{or|0}}})*0.02+({{{ab|0}}})*0.5)}}|2}} {{Mark|fund}}}} | ||
+ | |type1={{Infobox/Part/Dict|Total}} | ||
+ | |type2={{Infobox/Part/Dict|Dry}}}} | ||
+ | <!-- Mass --> | ||
+ | {{Infobox/Line|{{Infobox/Part/Dict|Mass}}|{{Formatnum|{{#expr: {{{mass}}}+({{{lf|0}}})*0.005+({{#if: {{{ox|}}}|{{{ox}}}|{{#if: {{{lf|}}}|{{{lf}}}*11/9|0}}}})*0.005+({{{mp|0}}})*0.004+({{{sf|0}}})*0.0075+({{{xg|0}}})*0.0001+({{{ia|0}}})*0.005+({{{or|0}}})*0.01+({{{ab|0}}})*0.001}}| {{#ifexpr: {{{mass}}} < 0.04 | 5 | 2 }} }} {{Dict|t}} {{{mass note|}}}{{#ifeq: {{lc:{{{physics insignificant}}}}}|y|{{#tag:ref|{{Infobox/Part/Dict|Massless}}|name="phyinsig"|group="{{{nref|N}}}"}}}}|{{#if: {{{lf|}}}{{{ox|}}}{{{mp|}}}{{{sf|}}}{{{xg|}}}{{{ia|}}}{{{or|}}}{{{ab|}}}|{{Formatnum|{{{mass}}}| {{#ifexpr: {{{mass}}} < 0.04 | 5 | 2 }} }} {{Dict|t}}}} | ||
+ | |type1={{Infobox/Part/Dict|Total}} | ||
+ | |type2={{Infobox/Part/Dict|Dry}}}} | ||
+ | <!-- Drag --> | ||
+ | {{Infobox/Line|{{Infobox/Part/Dict|Drag}}|{{{drag}}} {{{drag note|}}}{{#ifeq: {{lc:{{{physics insignificant}}}}}|y|{{#tag:ref|{{Infobox/Part/Dict|Massless}}|name="phyinsig"|group="{{{nref|N}}}"}}}}}} | ||
+ | <!-- Max. Temp. --> | ||
+ | {{Infobox/Line|{{Infobox/Part/Dict|Temp}}|{{{temp}}} {{Dict|K}}}} | ||
+ | <!-- Volume --> | ||
+ | {{Infobox/Line|{{Infobox/Part/Dict|Volume}}|{{#if: {{{volume|}}}|{{#ifeq: {{{volume|}}}|-1|{{Dict|none}}|{{{volume}}} {{Dict|l}}}}|?}}}} | ||
+ | <!-- Stacking Capacity --> | ||
+ | {{#if: {{{stacking capacity|}}}|{{Infobox/Line|{{Infobox/Part/Dict|Stacking capacity}}|{{{stacking capacity}}} {{Dict|units}}}}|}} | ||
+ | <!-- Impact Tolerance --> | ||
+ | {{Infobox/Line|{{Infobox/Part/Dict|Tolerance}}|{{{tolerance}}} {{Dict|m}}/{{Dict|s}}}} | ||
+ | <!-- Research --> | ||
+ | {{Infobox/Line|{{Infobox/Part/Dict|Research}}|{{#if: {{{research|}}}|{{#if: {{Infobox/Part/ricon|{{{research}}}}}|[[{{Infobox/Part/ricon| | ||
+ | {{{research}}}}}|24x24px|link=Technology tree{{if lang}}#{{{research}}}]] }}[[Technology tree{{if lang}}#{{{research}}}|{{Dict/sci node|{{{research}}}}}]]|{{Dict|Unknown}}}}}} | ||
+ | <!-- Unlock cost --> | ||
+ | {{Infobox/Line|{{Infobox/Part/Dict|Unlock}}|{{Formatnum|{{{unlock cost}}}}} {{Mark|fund}}}} | ||
+ | <!-- Since version --> | ||
+ | {{Infobox/Line|{{Dict|Since}}|{{#if: {{{since|}}}|{{version|{{{since}}}|}}|{{Dict|Unknown}}}}}} | ||
+ | <!-- Part configuration --> | ||
+ | {{Infobox/Line|{{Infobox/Part/Dict|Config}}|{{#if: {{{part|}}}<!-- | ||
+ | -->|style="word-break:break-all;" {{!}} {{#switch: {{lc:{{{dlc|}}}}}<!-- | ||
+ | -->|mh=[[MakingHistory/Parts/{{#if: {{{parent|}}}|{{{parent}}}/}}{{{part}}}/{{{filename}}}|{{{filename}}}]]<!-- | ||
+ | -->|bg=[[Serenity/Parts/{{#if: {{{parent|}}}|{{{parent}}}/}}{{{part}}}/{{{filename}}}|{{{filename}}}]]<!-- | ||
+ | -->|#default={{#if: {{{parent|}}}{{{type|}}}|[[Parts/{{#if: {{{parent|}}}|{{{parent}}}|{{#switch: {{lc:{{{type|}}}}}<!-- | ||
+ | -->|cs|fan|fr|hs|int|let|nc|win=Aero<!-- | ||
+ | -->|car|cit=Cargo<!-- | ||
+ | -->|cm|cp|pod|rw|sas=Command<!-- | ||
+ | -->|ft|str=CompoundParts<!-- | ||
+ | -->|air|dec|epl|sep=Coupling<!-- | ||
+ | -->|ant2|gen2|pan2|sen2=DeployedScience<!-- | ||
+ | -->|bat|gen|pan=Electrical<!-- | ||
+ | -->|lfe|mpe|srb|je|ie=Engine<!-- | ||
+ | -->|dra|lft|mpt|xgt=FuelTank<!-- | ||
+ | -->|tel=Misc<!-- | ||
+ | -->|pro=Propellers<!-- | ||
+ | -->|con|dri|fc|ot|sca=Resources<!-- | ||
+ | -->|cyl|eng|hin|pco|rot|ser=Robotics<!-- | ||
+ | -->|arm|lab|sen|sto=Science<!-- | ||
+ | -->|ada|grp|ste=Structural<!-- | ||
+ | -->|rad=Thermal<!-- | ||
+ | -->|ant|cb|chu|claw|dp|fla|hab|lad|leg|les|lig|rcs|sb=Utility<!-- | ||
+ | -->|gea|rov=Wheel<!-- | ||
+ | -->|#default=<!-- | ||
+ | -->}}}}/{{{part}}}/{{{filename}}}|{{{filename}}}]]|<abbr title="Parameter missing">{{{part}}}</abbr>[[Category:Infobox/Part with missing parameters]]}}<!-- | ||
+ | -->}}|{{Infobox/Part/Dict|Unknown}}[[Category:Infobox/Part with missing parameters]] | ||
+ | }}}}{{#if: {{{more|}}}|<br/> | ||
+ | {{{more|}}}}} | ||
+ | |notes={{{notes|}}}{{#if: {{{nref|}}}{{#ifeq: {{lc:{{{physics insignificant}}}}}|y|1}}|{{#tag:references||group="{{{nref|N}}}"}}}} | ||
+ | }}</includeonly><noinclude> | ||
+ | <!-- Infobox exemple --> | ||
+ | <!-- {{Infobox/Part --> | ||
+ | {{User:DedMazday/test4 | ||
+ | |file=TVR-400L Stack Quad-Adapter.png | ||
+ | |type=ada | ||
+ | |size=large | ||
+ | |size2=small | ||
+ | |size3=tiny | ||
+ | |manufacturer=OMB | ||
+ | |costs=800 | ||
+ | |mass=0.2 | ||
+ | |volume=25 | ||
+ | |stacking capacity=4 | ||
+ | |drag=0.3 | ||
+ | |temp=3400 | ||
+ | |tolerance=12 | ||
+ | |research=Meta-Materials | ||
+ | |unlock cost=1200 | ||
+ | |since=0.21 | ||
+ | |filename=part.cfg | ||
+ | |part=adapterLargeSmallQuad | ||
+ | |more={{Infobox/Part/adapter | ||
+ | |out=4 | ||
+ | }} | ||
+ | }} | ||
+ | |||
+ | == Usage == | ||
+ | {{Data template|Box}} | ||
+ | |||
+ | == Parameters == | ||
+ | {{Infobox/Part/Parameters}} | ||
+ | |||
+ | If a mandatory parameter is missing [[:Category:Infobox/Part with missing parameters]] will be added. | ||
+ | |||
+ | === Configuration file === | ||
+ | With the new folder structure since {{version|0.20}} the part config file must be placed at ''Parts/{{{parent}}}/{{{part}}}/{{{filename}}}''. The {{Tl|Part config}} template should be used in the part configuration pages. For some parts the actual <tt>parent</tt> differs from the <tt>type</tt>. For those cases <tt>parent</tt> overrides the <tt>type</tt>-based parent definition. One example is the [[Vernor Engine]], because it's a [[RCS]] engine but it's definition is in ''Engine'' although the other two RCS engines are in ''Utility''. | ||
+ | |||
+ | === More parameter === | ||
+ | To add additional fields the {{{more}}} parameter should be used with {{Tl|Infobox/Part/Line}} or {{Tl|Infobox/Line}}. It is preferred to use one of the [[:Category:Infobox/Part modules|modules]]. | ||
+ | |||
+ | === Manufacturer === | ||
+ | To add a manufacturer, it has to be added to the template {{Tl|Infobox/Part/Manufacturer}} and to {{Tl|Infobox/Part/ManufacturerUntranslated}}. | ||
+ | |||
+ | == Types == | ||
+ | For different types of parts this template allows to set the <tt>type</tt> parameter. The type will automatically set <tt>{{{role}}}</tt> and <tt>{{{parent}}}</tt> though they can be manually overwritten. The following values are supported: | ||
+ | |||
+ | {{Infobox/Part/Types}} | ||
+ | |||
+ | If a part uses more than one type, for example the [[R.A.P.I.E.R. Engine]], the type parameter is usually omitted and each subtemplate should use a header from {{Tl|Infobox/Part/title}}. | ||
+ | |||
+ | Additionally test subjects can use {{Tl|Infobox/Part/test subject}}. | ||
+ | |||
+ | === Roles === | ||
+ | Prior to the module system "roles" where used, but have been abandoned because they are not flexible enough. Currently only {{Tl|Infobox/Part/Strut}} is the only role template still used. | ||
+ | |||
+ | == Template == | ||
+ | <pre>{{Infobox/Part | ||
+ | |name= | ||
+ | |file= | ||
+ | |type= | ||
+ | |role= | ||
+ | |size= | ||
+ | |size2= | ||
+ | |size3= | ||
+ | |manufacturer= | ||
+ | |manufacturer2= | ||
+ | |costs= | ||
+ | |mass= | ||
+ | |volume= | ||
+ | |stacking capacity= | ||
+ | |lf= | ||
+ | |ox= | ||
+ | |mp= | ||
+ | |sf= | ||
+ | |xg= | ||
+ | |ia= | ||
+ | |or= | ||
+ | |ab= | ||
+ | |drag= | ||
+ | |temp= | ||
+ | |tolerance= | ||
+ | |research= | ||
+ | |unlock cost= | ||
+ | |since= | ||
+ | |dlc= | ||
+ | |filename= | ||
+ | |part= | ||
+ | |parent= | ||
+ | |physics insignificant= | ||
+ | |notes= | ||
+ | |nref= | ||
+ | |more= | ||
+ | }}</pre> | ||
+ | |||
+ | == Example == | ||
+ | Example used on this page: | ||
+ | |||
+ | <pre>{{Infobox/Part | ||
+ | |file=TVR-400L Stack Quad-Adapter.png | ||
+ | |type=ada | ||
+ | |size=large | ||
+ | |size2=small | ||
+ | |size3=tiny | ||
+ | |manufacturer=OMB | ||
+ | |costs=800 | ||
+ | |mass=0.2 | ||
+ | |drag=0.3 | ||
+ | |temp=3400 | ||
+ | |tolerance=12 | ||
+ | |research=Meta-Materials | ||
+ | |unlock cost=1200 | ||
+ | |since=0.21 | ||
+ | |filename=part.cfg | ||
+ | |part=adapterLargeSmallQuad | ||
+ | |more={{Infobox/Part/adapter | ||
+ | |out=4 | ||
+ | }} | ||
+ | }}</pre> | ||
+ | |||
+ | == Translation == | ||
+ | When using this template, most of it is translated automatically. To translate this template or one of the subtemplates, go to the {{Tl|Infobox/Part/Dict}} template. | ||
+ | |||
+ | === Manufacturer === | ||
+ | To add a translation for a manufacturer's name, add it to {{Tl|Infobox/Part/Manufacturer}} (use the {{Tl|lang}} template). '''Do not translate manufacturer names in the template {{Tl|Infobox/Part/ManufacturerUntranslated}}'''. | ||
+ | |||
+ | [[Category:Infobox templates]] | ||
+ | [[Category:Translating templates]]</noinclude> |
Revision as of 13:59, 8 July 2024
Contents
Usage
To avoid adding the information for each language this templates should be reused and with the suggested subpage name /Box. The Templates help page contains additional information how to implement reusing. All page which use template directly should add the {{Data template used}} note.
Parameters
Name | Optional | Description | Default |
---|---|---|---|
Parameters of {{Infobox/Part}} | |||
name | Yes | Name of the part, which can be found in the localization file. Uses {{Dict/part name}} to translate names. | {{BASEPAGENAME}} |
file | Yes | Filename to image of the part. | File:Image needed.svg |
size | Yes | Radial size of the part (uses {{Radial Size}}). | Not set/Hidden |
size2 | Yes | Second radial size of the part (uses {{Radial Size}}). | Not set/Hidden |
size3 | Yes | Third radial size of the part (uses {{Radial Size}}). | Not set/Hidden |
manufacturer | Yes | Manufacturer of the part. If set linked to the category of this name (see also Category:Manufacturers). Automatically uses {{Infobox/Part/Manufacturer}} and {{Infobox/Part/Manufacturer entry}} on it. | Not set/Hidden |
manufacturer2 | Yes | Second manufacturer of the part. | Not set/Hidden |
costs | No | Cost of the part, which is usually given in the part.cfg. | |
mass | No | Mass of the part, which is usually given in the part.cfg. | |
drag | No | Drag of the part. By different values, add minimum_drag first and then maximum_drag | |
temp | No | Temperature resistance of the part, which is usually given in the part.cfg. | |
tolerance | No | Impact tolerance of the part, which is usually given in the part.cfg. | |
research | Yes | Research node required for this part. Uses {{Dict/sci node}} to translate names. | Unknown |
unlock cost | No | Cost to unlock the part, which is usually given in the part.cfg. | |
since | Yes | Version the part first appeared in. It will be used in {{version}}. | Unknown |
dlc | Yes | Name of the dlc. Used for link to cfg-entry in wiki. Can be:
|
Not Set |
filename | No | The filename (with extension) of the part.cfg | |
part | No | Name of the part folder. Used for link to cfg-entry in wiki. It will create a link to Parts/{{{parent}}}/{{{part}}}/part.cfg. |
If a mandatory parameter is missing Category:Infobox/Part with missing parameters will be added.
Configuration file
With the new folder structure since version 0.20 the part config file must be placed at Parts/{{{parent}}}/{{{part}}}/{{{filename}}}. The {{Part config}} template should be used in the part configuration pages. For some parts the actual parent differs from the type. For those cases parent overrides the type-based parent definition. One example is the Vernor Engine, because it's a RCS engine but it's definition is in Engine although the other two RCS engines are in Utility.
More parameter
To add additional fields the {{{more}}} parameter should be used with {{Infobox/Part/Line}} or {{Infobox/Line}}. It is preferred to use one of the modules.
Manufacturer
To add a manufacturer, it has to be added to the template {{Infobox/Part/Manufacturer}} and to {{Infobox/Part/ManufacturerUntranslated}}.
Types
For different types of parts this template allows to set the type parameter. The type will automatically set {{{role}}} and {{{parent}}} though they can be manually overwritten. The following values are supported:
If a part uses more than one type, for example the R.A.P.I.E.R. Engine, the type parameter is usually omitted and each subtemplate should use a header from {{Infobox/Part/title}}.
Additionally test subjects can use {{Infobox/Part/test subject}}.
Roles
Prior to the module system "roles" where used, but have been abandoned because they are not flexible enough. Currently only {{Infobox/Part/Strut}} is the only role template still used.
Template
{{Infobox/Part |name= |file= |type= |role= |size= |size2= |size3= |manufacturer= |manufacturer2= |costs= |mass= |volume= |stacking capacity= |lf= |ox= |mp= |sf= |xg= |ia= |or= |ab= |drag= |temp= |tolerance= |research= |unlock cost= |since= |dlc= |filename= |part= |parent= |physics insignificant= |notes= |nref= |more= }}
Example
Example used on this page:
{{Infobox/Part |file=TVR-400L Stack Quad-Adapter.png |type=ada |size=large |size2=small |size3=tiny |manufacturer=OMB |costs=800 |mass=0.2 |drag=0.3 |temp=3400 |tolerance=12 |research=Meta-Materials |unlock cost=1200 |since=0.21 |filename=part.cfg |part=adapterLargeSmallQuad |more={{Infobox/Part/adapter |out=4 }} }}
Translation
When using this template, most of it is translated automatically. To translate this template or one of the subtemplates, go to the {{Infobox/Part/Dict}} template.
Manufacturer
To add a translation for a manufacturer's name, add it to {{Infobox/Part/Manufacturer}} (use the {{lang}} template). Do not translate manufacturer names in the template {{Infobox/Part/ManufacturerUntranslated}}.