Difference between revisions of "Template:Infobox/Part"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (Made it possible to translate the research node.)
m (Documented how to translate.)
Line 74: Line 74:
  
 
=== Manufacturer ===
 
=== Manufacturer ===
The template {{Tl|Infobox/Part/Manufacturer}} is a template to quickly add a manufacturer.
+
To add a manufacturer, it has to be added to the template {{Tl|Infobox/Part/Manufacturer}} and to {{Tl|Infobox/Part/ManufacturerUntranslated}}. 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}}'''.  
  
 
== Types ==
 
== Types ==
Line 359: Line 360:
  
 
== Translation ==
 
== Translation ==
 +
When using this template, most of it is translated automatically. To have a full translation of it, here's what needs to be done additionally :
 +
* '''Title translation''': Use the ''name'' parameter and a {{Tl|lang}} template to display the translated name of the part.
 +
* '''Research translation''': '''Do not translate the ''research'' parameter''. To translate the research, use the ''research page'' parameter. Here's an example, translating ''General Construction'' to french.
 +
 +
<code>
 +
|research=General Construction
 +
</code>
 +
 +
<code><nowiki>
 +
|research page={{lang|en=General Construction|fr=General Construction/fr{{!}}Construction générale}}
 +
</nowiki></code>
 +
 +
''Note to the translation of manufacturer names'': Manufacturer names are translated automatically. If some translations are not available in your language, you may add them to the {{Tl|Infobox/Part/Manufacturer}} template. '''Do not translate manufacturer names in {{Tl|Infobox/Part/ManufacturerUntranslated}}'''.
 +
 +
 +
 
To translate this template or one of the subtemplates see also [[Kerbal_Space_Program_Wiki:Translation#Templates|this article]].
 
To translate this template or one of the subtemplates see also [[Kerbal_Space_Program_Wiki:Translation#Templates|this article]].
  

Revision as of 10:51, 31 May 2019

Infobox
Part image
Adapter by
O.M.B. Demolition Enterprises

Radial size Large, Small, Tiny
Cost (total) 800.00 Funds
Mass (total) 0.20 t
Drag 0.3
Max. Temp. 3400 K
Volume  ?
Impact Tolerance 12 m/s
Research Meta-materials.png Meta-Materials
Unlock cost 0 Funds
Since version 0.21
Part configuration [[Parts/Structural/adapterLargeSmallQuad/{{{filename}}}|{{{filename}}}]]
Outgoing connectors 4

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
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
type No Type of the part. Automatically defines the role and parent parameter.
role Yes Role of the part. Overrides the type parameter. {{type}}
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.
lf Yes Amount of Liquid Fuel on that part in units. Only used for wet mass/dry costs calculation. 0
ox Yes Amount of Oxidizer on that part in units. Only used for wet mass/dry costs calculation. 0
mp Yes Amount of Monopropellant on that part in units. Only used wet mass/dry costs calculation. 0
sf Yes Amount of Solid Fuel on that part in units. Only used for wet mass/dry costs calculation. 0
xg Yes Amount of Xenon Gas on that part in units. Only used for wet mass/dry costs calculation. 0
ia Yes Amount of Intake Air on that part in units. Only used for wet mass/dry costs calculation. 0
or Yes Amount of Ore on that part in units. Only used for wet mass/dry costs calculation. 0
ab Yes Amount of Ablator on that part in units. Only used for wet mass/dry costs calculation. 0
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.
volume Yes Volume of the part for cargo storage, which is usually given in the part.cfg in the ModuleCargoPart module. If the volume is -1, it is considered as a construction part which cannot be stored (N/A). Unknown volume (?)
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:
  • mh
  • bg
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.
parent No Parent directory of the part folder. Used for part.cfg file, see above. Overrides the type parameter.
physics insignificant Yes Mark the mass and drag automatically with a note that they are insignificant (so called massless parts). This will use {{{nref}}}, so if it isn't set, will set it automatically to "N". Other notes can use that group then too. Must be set to "Y" or "y" to show insignificance. Not set/Hidden
notes Yes Additional notes below the part information. Not set/Hidden
nref Yes Automatically add references of the group with that name (usually N). Modules might have a nref parameter which needs to be set to the same value. Not set/Hidden
more Yes More module-specific information (see More parameter). Not set

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}}. 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}}.

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:

Type Role Parent Subtemplate
lfe Liquid fuel engine Engine {{Infobox/Part/reaction engine}}
mpe Monopropellant engine
srb Solid rocket booster {{Infobox/Part/solid fuel engine}}
je Jet engine {{Infobox/Part/jet engine}}
ie Ion engine {{Infobox/Part/ion engine}}
lft Liquid fuel tank FuelTank {{Infobox/Part/tank}}
mpt Monopropellant tank
xgt Xenon gas tank
sas Stability Augmentation System Command {{Infobox/Part/SAS}}
rw Reaction wheel {{Infobox/Part/torque}}
cm Command module {{Infobox/Part/command module}}
cp Cockpit
pod Command pod
lab Laboratory Science {{Infobox/Part/laboratory}}
sto Experiment Storage (n/a)
tel Telescope {{Infobox/Part/sensor}}
exp Environmental sensor
sen
rcs (instead of re) Reaction Control System Utility {{Infobox/Part/reaction engine}}, {{Infobox/Part/thrust vectors}}
re (deprecated)
ant Antenna {{Infobox/Part/antenna}}
int Air intake {{Infobox/Part/air intake}}
dec Decoupler {{Infobox/Part/separator}}
sep Separator
dp Docking port (n/a)
cb Cargo bay (n/a)
sb Service bay (n/a)
chu Parachute {{Infobox/Part/parachute}}
lad Ladder {{Infobox/Part/ladder}}
leg Landing leg (n/a)
lan (deprecated) Landing gear and leg (n/a)
lig Electric light {{Infobox/Part/electric usage}}
gea Landing gear Wheel (n/a)
rov Rover wheel {{Infobox/Part/rover wheel}}
nc Nose cone Aero (n/a)
cs Control surface {{Infobox/Part/control surface}}
hs Heat shield {{Infobox/Part/heat shield}}
fr Fairing (n/a)
win Wing {{Infobox/Part/lifting surface}}
let Winglet {{Infobox/Part/winglet}}
bat Battery Electrical {{Infobox/Part/energy storage}}
gen Generator {{Infobox/Part/generator}}
pan Solar panel {{Infobox/Part/solar panel}}
fc Fuel cell Resources {{Infobox/Part/converter}}
sca Scanner (not yet)
ot Ore tank {{Infobox/Part/tank}}
dri (instead of rh) Resource harvester (not yet)
rh (deprecated)
con Converter {{Infobox/Part/converter}}
str Strut Structural (n/a)
ada Adapter {{Infobox/Part/adapter}}
hab Habitation module None {{Infobox/Part/crew}}
rad Radiator Thermal {{Infobox/Part/radiator}}

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=
|role=
|type=
|file=
|size=
|size2=
|size3=
|costs=
|mass=
|lf=
|ox=
|mp=
|sf=
|xg=
|ia=
|drag=
|drag type=
|temp=
|tolerance=
|manufacturer=
|more=
|research=
|research page=
|since=
|part=
|parent=
|notes=
|physics insignificant=
|nref=
}}

Example

Example used on this page:

{{Infobox/Part
|file=TVR-400L Stack Quad-Adapter.png
|type=ada
|manufacturer=OMB
|size=large
|size2=small
|size3=tiny
|costs=800
|mass=0.2
|drag=0.3
|temp=3400
|tolerance=12
|since=0.21
|part=adapterLargeSmallQuad
|research=Meta-Materials
|more={{Infobox/Part/adapter
|out=4
}}
}}

Translation

When using this template, most of it is translated automatically. To have a full translation of it, here's what needs to be done additionally :

  • Title translation: Use the name parameter and a {{lang}} template to display the translated name of the part.
  • Research translation': Do not translate the research parameter. To translate the research, use the research page parameter. Here's an example, translating General Construction to french.

|research=General Construction

|research page={{lang|en=General Construction|fr=General Construction/fr{{!}}Construction générale}}

Note to the translation of manufacturer names: Manufacturer names are translated automatically. If some translations are not available in your language, you may add them to the {{Infobox/Part/Manufacturer}} template. Do not translate manufacturer names in {{Infobox/Part/ManufacturerUntranslated}}.


To translate this template or one of the subtemplates see also this article.

At the moment only English is supported by all templates.

  • Deutsch (German): Infobox/Part complete, subtemplates partially
  • Español (Spanish): Infobox/Part complete, subtemplates partially
  • Polish (Polski): Infobox/Part mostly, subtemplates partially
  • Русский (Russian): Infobox/Part partially, subtemplates partially
  • Français (French): Infobox/Part mostly, subtemplates partially
  • 한국어 (Korean) : Infobox/Part complete, subtemplates partially
  • Português (Portuguese) : Infobox/Part complete, subtemplates partially
  • Magyar (Hungarian) : Infobox/Part complete, subtemplates partially
  • Italiano (Italian): Infobox/Part complete, subtemplates partially