Template:Infobox vehicle part: Difference between revisions

From PZwiki
(added up to 5 alternate images, increased infobox width, added "image_width" parameter for custom title image sizes)
(I changed all infobox item in template to infobox vehicle part)
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly>{{Infobox
<noinclude>
|bodystyle  = width:350px; -moz-box-shadow: 0px 0px 2px 2px #{{Infobox nc|{{{name_colour|}}}}}; -webkit-box-shadow: 0px 0px 2px 2px #{{Infobox nc|{{{name_colour|}}}}}; box-shadow: 0px 0px 2px 2px #{{Infobox nc|{{{name_colour|}}}}}; border: 1px solid #{{Infobox nc|{{{name_colour|}}}}};
{{Documentation/sandbox|doc=
| above      = <div style="background: #{{Infobox nc|{{{name_colour|}}}}}; padding: 5px; font-weight: bold; text-align: center; font-size: 120%; color:#{{Infobox nc|{{{name_text_colour|}}}|text}};"><span class="fn">{{{name|{{{display_name|{{PAGENAME}}}}}}}}</span></div>
This template is used to create an infobox in an article about vehicle parts.
| image      = {{#if: {{{image|}}}|[[File:{{{image}}}|{{{display_name}}}|{{{image_width|120px}}}]]}}
| caption    = {{#if: {{{image_caption|}}}|''{{{image_caption|}}}''}}


| image2    = {{#if: {{{alternate_image|}}}|{{{!}} style="margin:auto;" cellspacing=5
==Usage==
{{!}} style="width:32px; padding:2px; background-color:#EEEEEE; border: 1px solid #{{Infobox nc|{{{name_colour|}}}}}; margin:auto;" {{!}} [[Image:{{{alternate_image}}}|link={{{alternate_link|}}}{{#if: {{{alternate_name|}}} |{{!}}{{{alternate_name}}} }}]]
To use this template in an article, copy the template below, then paste the template into the article, filling in the blanks.
{{#if: {{{alternate_image2|}}}
{{Infobox vehicle part
|{{!}} style="width:32px; padding:2px; background-color:#EEEEEE; border: 1px solid #{{Infobox nc|{{{name_colour|}}}}}; margin:auto;" {{!}} [[Image:{{{alternate_image2}}}|link={{{alternate_link2|}}}{{#if: {{{alternate_name2|}}} |{{!}}{{{alternate_name2}}} }}]]
|name=name
{{#if: {{{alternate_image3|}}}
|model=image.png
|{{!}} style="width:32px; padding:2px; background-color:#EEEEEE; border: 1px solid #{{Infobox nc|{{{name_colour|}}}}}; margin:auto;" {{!}} [[Image:{{{alternate_image3}}}|link={{{alternate_link3|}}}{{#if: {{{alternate_name3|}}} |{{!}}{{{alternate_name3}}} }}]]
|icon=image.png
{{#if: {{{alternate_image4|}}}
|icon_name=icon_name
|{{!}} style="width:32px; padding:2px; background-color:#EEEEEE; border: 1px solid #{{Infobox nc|{{{name_colour|}}}}}; margin:auto;" {{!}} [[Image:{{{alternate_image4}}}|link={{{alternate_link4|}}}{{#if: {{{alternate_name4|}}} |{{!}}{{{alternate_name4}}} }}]]
<!--General-->
{{#if: {{{alternate_image5|}}}
|category=category
|{{!}} style="width:32px; padding:2px; background-color:#EEEEEE; border: 1px solid #{{Infobox nc|{{{name_colour|}}}}}; margin:auto;" {{!}} [[Image:{{{alternate_image5}}}|link={{{alternate_link5|}}}{{#if: {{{alternate_name5|}}} |{{!}}{{{alternate_name5}}} }}]] }} }} }} }}
|weight=3
{{!}}} }}
|weight_text=weight_text
|function=function
<!--Properties-->
|container=trunk
|capacity=10
|capacity_text=capacity_text
|wheel_friction=wheel_friction
|pressure_max=pressure_max
|brake_force=brake_force
|damping=damping
|compression=compression
|part_tier=part_tier
|noise_mod=noise_mod
|vehicle_type=vehicle_type
|vehicle_type2=vehicle_type2
|vehicle_type3=vehicle_type3
|condition_max=condition
|chance_damaged=chance_damaged
|chance_damaged_text=chance_damaged_text
<!--Install/Uninstall-->
|tool=tool
|skill=skill
|recipe=recipe
<!--Technical-->
|item_id=item_id
|item_id_more=Technical
}}
<pre>
{{Infobox vehicle part
|name=
|model=
|model_width=
|icon=
|icon_name=
<!--General-->
|category=
|weight=
|weight_text=
|function=
<!--Properties-->
|container=
|capacity=
|capacity_text=
|wheel_friction=
|pressure_max=
|brake_force=
|damping=
|compression=
|part_tier=
|noise_mod=
|damage_chance=
|vehicle_type=
|vehicle_type2=
|vehicle_type3=
|condition_max=
|chance_damaged=
<!--Install/Uninstall-->
|tool_tag=<!-- or |tool -->
|skill=
|recipe=
<!--Technical-->
|item_id=
|item_id_more=
}}</pre>


| imagestyle = padding:10px;
==Parameters==
| headerstyle = background-color: #{{Infobox nc|{{{name_colour|}}}}}; color: #{{Infobox nc|{{{name_text_colour|}}}|text}};
===Image and name===
| labelstyle = background-color:#eee; width:50%;
;<code>name</code>
| datastyle  = width:50%;
:Name of the item. Displayed at the top of the infobox. ''Default: uses page display title''
;<code>model</code>
:Model for the item with the format <code>Image.png</code>. Multiple images can be set by changing the suffix id, e.g. <code>model2</code>. ''Default: uses <code>icon</code> if defined''
;<code>model_name</code>
:Name of the item for the model. If multiple images are defined, it will be set for the model with the same suffix id, e.g. <code>model_name2</code>. ''Default: uses <code>name</code> if defined''
;<code>icon</code>
:Icon for the item, with the format <code>Image.png</code>. Multiple icons can be set by changing the suffix id, e.g. <code>icon2</code>. ''Default: uses <code>image</code>, only if more than one image defined''
;<code>icon_name</code>
:Name of the icon. If multiple icons are defined, it will be set for the icon with the same suffix id, e.g. <code>icon_name2</code>. ''Default: uses <code>name</code> if defined''


| header1    = General
===General===
;<code>category</code>
:The in-game category for the item.
;<code>weight</code>
:The encumbrance (previously weight) of the item. Will automatically calculate the weight when equipped and display as a tooltip. Up to 3 different weights can be defined by adding a suffix id to the end of the parameter, e.g. <code>weight2</code>.
;<code>weight_text</code>
:Text to appear next to the weight value with the same suffix id. E.g. (regular).
;<code>function</code>
:The function of the item, if not obvious from other infobox parameters. If none, leave blank.


| label2    = Category
===Properties===
| data2      = {{{category|Item}}}
;<code>vehicle_type</code>
:The vehicle type. Will be displayed next to certain properties. Up to 3 can be defined, which should always be the following: 1 = Standard, 2 = Heavy-Duty, 3 = Sport. Should only be defined if required.
;<code>part_tier</code>
:The tier of the part, i.e. the name prefix (such as "Old"). Up to 3 can be defined. Should only be defined if required.
;<code>container</code>
:The type of container. This will determine the icon to be displayed next to <code>capacity</code>.
<table class="mw-collapsible mw-collapsed" style="margin-left:32px; width:200px;" data-expandtext="Show container list" data-collapsetext="Hide container list">
<caption style="text-align:left;"></caption>
<tr><td>[[File:Container_GloveCompartment.png{{!}}21px]]</td> <td>{{code|glove box}}</td></tr>
<tr><td>[[File:Container_CarSeat.png{{!}}21px]]</td> <td>{{code|seat}}</td></tr>
<tr><td>[[File:Container_TruckBed.png{{!}}21px]]</td> <td>{{code|truck bed}}</td></tr>
<tr><td>[[File:Container_CarTrunk.png{{!}}21px]]</td> <td>{{code|trunk}}</td></tr>
</table>
;<code>capacity</code>
:The maximum weight that the container of a single tile can store, or other non-storage related capacities, such as electricity charge (use <code>pressure_max</code> instead for tires). If required, [[Template:Tooltip|tooltips]] can be set manually using [[Template:Container capacity]], which are automatically added if <code>container</code> is defined. Up to 3 different capacities can be defined by adding a suffix id to the end of the parameter, e.g. <code>capacity2</code>.
;<code>capacity_text</code>
:Displays text next to the <code>capacity</code> value with the same suffix id. Used so automatic calculations/tooltips will still be displayed.
;<code>wheel_friction</code>
:<code>WheelFriction</code> value for the item (tires). <code>part_tier</code> can be used to display the tier of the part next to the value with the same suffix id.
;<code>pressure_max</code>
:<code>ConditionMax</code> for tires (use <code>capacity</code> for other items). <code>part_tier</code> can be used to display the tier of the part next to the value with the same suffix id.
;<code>brake_force</code>
:<code>brakeForce</code> value for the item (brakes). <code>part_tier</code> can be used to display the tier of the part next to the value with the same suffix id.
;<code>damping</code>
:<code>SuspensionDamping</code> value for the item (suspension). <code>vehicle_type</code> can be used to display the vehicle type for the part next to the value with the same suffix id.
;<code>compression</code>
:<code>SuspensionCompression</code> value for the item (suspension). <code>vehicle_type</code> can be used to display the vehicle type for the part next to the value with the same suffix id.
;<code>noise_mod</code>
:<code>EngineLoudness</code> value for the item (muffler). <code>part_tier</code> can be used to display the tier of the part next to the value with the same suffix id.
;<code>condition_max</code>
:<code>ConditionMax</code> value for the item.
;<code>chance_damaged</code>
:<code>ChanceToSpawnDamaged</code> value for the item. <code>chance_damaged_text</code> can be used to display text next to the value, otherwise <code>part_tier</code> will be used (if defined).
;<code>chance_damaged_text</code>
:Text to display next to <code>chance_damaged</code>.


| label3 = Weight [[File:Moodle_heavyLoad.png|right|link=Moodles#Heavy Load|Heavy Load]]
===Install/Uninstall===
| data3 = {{{weight|}}}
;<code>tool</code> or <code>tool_tag</code>
:The tool or tool tag required to install/uninstall the part. <code>tool_tag</code> will automatically link to the appropriate [[Item tags|item tag]]. Up to 3 can be defined by changing the suffix id, e.g. <code>tool2</code>.
;<code>skill</code>
:The recommended level for installing/uninstalling the part. Up to 3 can be defined by changing the suffix id, e.g. <code>skill2</code>.
;<code>recipe</code>
:The recipe required to install/uninstall.


| label4 = Function
===Technical===
| data4 = {{{function|{{{primary_use|}}}}}}{{#if:{{{secondary_use|}}}|<br>{{{secondary_use}}}}}
;<code>item_id</code>
:The ID for the item. The format is {{code|[module].[name]}}. Multiple item IDs can be set by either: separating with {{code|<br>}} or adding a 'suffix id' to the end (up to 10), e.g. <code>item_id2</code>.
;<code>item_id_more</code>
:Adds a "See all" link, linking to the section named in the parameter. E.g. {{code|id_more{{=}}Item IDs}} will link to a section called "Item IDs". This is useful for multiple IDs, or where more information is required to distinguish between each ID, as the ID itself may not be very descriptive.


| label5 = Required tool
{{Translation guide|<syntaxhighlight lang="html">{{#switch: {{{1|}}}
| data5 = {{{tool|}}}
| general = General
| category = Category
| weight = Encumbrance
| weight_equipped = when equipped
| properties = Properties
| capacity = Capacity
| with_organized = with organized trait.
| with_disorganized = with disorganized trait.
| units = units
| function = Function
| wheel_friction = Wheel friction
| max_pressure = Max pressure
| brake_force = Brake force
| damping = Damping
| compression = Compression
| noise_modifier = Noise modifier
| max_condition = Max condition
| chance_damaged = Chance damaged
| install_uninstall = Install/Uninstall
| tools = Tool(s)
| recommended_level = Recommended level
| recipe = Recipe
| technical = Technical
| item_id = Item ID
| item_id_more = Item ID's
| see_all = See all
| #default = {{Error|translation}}
}}
</syntaxhighlight>}}


| label6 = Repairable
==See also==
| data6 = {{{repairable|}}}
*{{ll|Template:Infobox item}}
*{{ll|Template:Infobox tile}}
}}
{{ll|Category:Infobox}}
</noinclude><includeonly>{{Infobox/sandbox
  | title = {{{name|{{#getdisplaytitle:{{FULLPAGENAME}}}}}}}
  | color = var(--color-red)
  | {{Infobox/image <!-- ## Image -->
    | 1 = {{#if:{{{icon|}}}|[[File:{{{icon}}}|{{{icon_name|{{{model_name|{{{name|}}}}}}}}}|link=]]}}
    | 2 = {{#if:{{{icon2|}}}|[[File:{{{icon2}}}|{{{icon_name2|{{{model_name2|{{{name|}}}}}}}}}|link=]]}}
    | 3 = {{#if:{{{icon3|}}}|[[File:{{{icon3}}}|{{{icon_name3|{{{model_name3|{{{name|}}}}}}}}}|link=]]}}
    | 4 = {{#if:{{{icon4|}}}|[[File:{{{icon4}}}|{{{icon_name4|{{{model_name4|{{{name|}}}}}}}}}|link=]]}}
    | 5 = {{#if:{{{icon5|}}}|[[File:{{{icon5}}}|{{{icon_name5|{{{model_name5|{{{name|}}}}}}}}}|link=]]}}
    | 6 = {{#if:{{{icon6|}}}|[[File:{{{icon6}}}|{{{icon_name6|{{{model_name6|{{{name|}}}}}}}}}|link=]]}}
    | 7 = {{#if:{{{icon7|}}}|[[File:{{{icon7}}}|{{{icon_name7|{{{model_name7|{{{name|}}}}}}}}}|link=]]}}
    | 8 = {{#if:{{{icon8|}}}|[[File:{{{icon8}}}|{{{icon_name8|{{{model_name8|{{{name|}}}}}}}}}|link=]]}}
    | p1 = {{#if:{{{icon|}}}|[[File:{{{model|{{{icon}}}}}}|{{{model_name|{{{icon_name|{{{name|}}}}}}}}}|{{{model_width|200px}}}|{{#if:{{{model|}}}||class=pixelart}}]]}}
    | p2 = {{#if:{{{icon2|}}}|[[File:{{{model2|{{{icon2}}}}}}|{{{model_name2|{{{icon_name2|{{{name|}}}}}}}}}|{{{model_width2|200px}}}|{{#if:{{{model2|}}}||class=pixelart}}]]}}
    | p3 = {{#if:{{{icon3|}}}|[[File:{{{model3|{{{icon3}}}}}}|{{{model_name3|{{{icon_name3|{{{name|}}}}}}}}}|{{{model_width3|200px}}}|{{#if:{{{model3|}}}||class=pixelart}}]]}}
    | p4 = {{#if:{{{icon4|}}}|[[File:{{{model4|{{{icon4}}}}}}|{{{model_name4|{{{icon_name4|{{{name|}}}}}}}}}|{{{model_width4|200px}}}|{{#if:{{{model4|}}}||class=pixelart}}]]}}
    | p5 = {{#if:{{{icon5|}}}|[[File:{{{model5|{{{icon5}}}}}}|{{{model_name5|{{{icon_name5|{{{name|}}}}}}}}}|{{{model_width5|200px}}}|{{#if:{{{model5|}}}||class=pixelart}}]]}}
    | p6 = {{#if:{{{icon6|}}}|[[File:{{{model6|{{{icon6}}}}}}|{{{model_name6|{{{icon_name6|{{{name|}}}}}}}}}|{{{model_width6|200px}}}|{{#if:{{{model6|}}}||class=pixelart}}]]}}
    | p7 = {{#if:{{{icon7|}}}|[[File:{{{model7|{{{icon7}}}}}}|{{{model_name7|{{{icon_name7|{{{name|}}}}}}}}}|{{{model_width7|200px}}}|{{#if:{{{model7|}}}||class=pixelart}}]]}}
    | p8 = {{#if:{{{icon8|}}}|[[File:{{{model8|{{{icon8}}}}}}|{{{model_name8|{{{icon_name8|{{{name|}}}}}}}}}|{{{model_width8|200px}}}|{{#if:{{{model8|}}}||class=pixelart}}]]}}
  }}<!--


| header7 = {{#if:{{{data1|}}}{{{data2|}}}{{{data3|}}}|{{{part1|}}}}}
    ## GENERAL ##


| label8 = {{{func1}}}
-->{{#if:{{{category|}}}{{{weight|}}}{{{function|}}}
| data8 = {{{data1|}}}
    | {{Infobox/section <!-- ## General ## -->
      | {{tt|name=Infobox vehicle part|default=General|arg1=general}}
      | color = var(--color-red)
      | id = vehicle_part-general
      | <!--
  -->{{Infobox/sandbox/row
        |{{tt|name=Infobox vehicle part|default=Category|arg1=category}}
        |{{{category|Vehicle Maintenance}}}
      }}<!--


| label9 = {{{func2}}}
  -->{{Infobox/sandbox/row
| data9 = {{{data2|}}}
        |{{tt|name=Infobox vehicle part|default=Encumbrance|arg1=weight}}[[File:Moodle_Icon_HeavyLoad.png|right|link=Heavy Load{{lcs}}]]
        |{{#ifeq:{{{weight}}}|0|
          |{{#iferror:
            {{Tooltip<!--
          -->|{{{weight|1}}} {{#if:{{{weight_text|}}}|{{{weight_text}}}}} <!-- append weight_text --><!--
          -->|{{#expr:{{{weight|1}}}*0.3}} {{tt|name=Infobox vehicle part|default=when equipped|arg1=weight_equipped}}<!--
        -->}}
            |{{{weight|1}}} {{#if:{{{weight_text|}}}|{{{weight_text}}}}} <!-- append weight_text -->
          }}<!--
      -->{{#if:{{{weight2|}}}
            |<br>{{#iferror:
              {{Tooltip<!--
            -->|{{{weight2}}} {{#if:{{{weight_text2|}}}|{{{weight_text2}}}}} <!-- append weight_text --><!--
            -->|{{#expr:{{{weight2}}}*0.3}} {{tt|name=Infobox vehicle part|default=when equipped|arg1=weight_equipped}}<!--
          -->}}
              |{{{weight2}}} {{#if:{{{weight_text2|}}}|{{{weight_text2}}}}} <!-- append weight_text -->
            }}
          }}{{#if:{{{weight3|}}}
            |<br>{{#iferror:
              {{Tooltip<!--
            -->|{{{weight3}}} {{#if:{{{weight_text3|}}}|{{{weight_text3}}}}} <!-- append weight_text --><!--
            -->|{{#expr:{{{weight3}}}*0.3}} {{tt|name=Infobox vehicle part|default=when equipped|arg1=weight_equipped}}<!--
          -->}}
              |{{{weight3}}} {{#if:{{{weight_text3|}}}|{{{weight_text3}}}}} <!-- append weight_text -->
            }}
          }}
        }}
      }}<!--


| label10 = {{{func3}}}
  -->{{#if:{{{function|}}}
| data10 = {{{data3|}}}
        |{{Infobox/sandbox/row
          |{{tt|name=Infobox vehicle part|default=Function|arg1=function}}
          |{{{function|}}}
        }}
      }}
    }}
  }}<!--


| header11 = {{#if:{{{data4|}}}{{{data5|}}}{{{data6|}}}|{{{part2|}}}}}
    ## PROPERTIES ##


| label12 = {{{func1}}}
-->{{#if:{{{capacity|}}}{{{pressure|}}}{{{brake_force|}}}{{{damping|}}}{{{wheel_friction|}}}{{{compression|}}}{{{noise_mod|}}}{{{condition_max|}}}{{{chance_damaged|}}}{{{condition_lower_standard|}}}{{{condition_lower_offroad|}}}
| data12 = {{{data4|}}}
    | {{Infobox/section
      | {{tt|name=Infobox vehicle part|default=Properties|arg1=properties}}
      | color = var(--color-red)
      | id = vehicle_part-properties
      | <!--


| label13 = {{{func2}}}
  -->{{#if:{{{capacity|}}}
| data13 = {{{data5|}}}
        |{{yesno|{{{container|}}}
          |blank={{Infobox/sandbox/row
            |{{tt|name=Infobox vehicle part|default=Capacity|arg1=capacity}}
            |{{{capacity}}} {{{capacity_text|}}}{{#if:{{{capacity2|}}}
              |<br>{{{capacity2}}} {{{capacity_text2|}}}{{#if:{{{capacity3|}}}
                |<br>{{{capacity3}}} {{{capacity_text3|}}}
              }}
            }}
          }}
          |yes={{Infobox/sandbox/row
            |{{tt|name=Infobox vehicle part|default=Capacity|arg1=capacity}} {{#if: {{{container|}}}
              |[[File:{{#switch: {{lc:{{{container}}}}}
                | glove box = Container_GloveCompartment.png
                | seat = Container_CarSeat.png
                | truck bed = Container_TruckBed.png
                | trunk = Container_CarTrunk.png
                | default = {{{container}}}
              }}{{!}}link=Containers{{!}}{{ucfirst:{{{container}}}}}]]
            }}
            |{{#if:{{{container|}}}
              |{{#iferror:<!--
            -->{{Tooltip|{{#expr:{{{capacity}}}}} {{#if:{{{capacity_text|}}}|&nbsp;{{{capacity_text}}}}}<!-- append capacity_text --><!--
              -->|{{Container capacity|organized|{{{capacity|}}}}} {{tt|name=Infobox vehicle part|default=with organized trait.|arg1=with_organized}}<!--
              -->&nbsp;{{Container capacity|disorganized|{{{capacity|}}}}} {{tt|name=Infobox vehicle part|default=with disorganized trait.|arg1=with_disorganized}}<!--
            -->}}
                |{{{capacity}}} {{#if:{{{capacity_text|}}}|{{{capacity_text}}}}}<!-- append capacity_text -->
              }}
              |{{{capacity}}} {{tt|name=Infobox vehicle part|default=units|arg1=units}}
            }}<!--
        -->{{#if:{{{capacity2|}}}
              |<br>{{#if:{{{container|}}}
                |{{#iferror:<!--
              -->{{Tooltip|{{#expr:{{{capacity2}}}}} {{#if:{{{capacity_text2|}}}|{{{capacity_text2}}}}}<!-- append capacity_text --><!--
                -->|{{Container capacity|organized|{{{capacity2}}}}} {{tt|name=Infobox vehicle part|default=with organized trait.|arg1=with_organized}}<!--
                -->&nbsp;{{Container capacity|disorganized|{{{capacity2}}}}} {{tt|name=Infobox vehicle part|default=with disorganized trait.|arg1=with_disorganized}}<!--
              -->}}
                  |{{{capacity2}}} {{#if:{{{capacity_text2|}}}|&nbsp;{{{capacity_text2}}}}}<!-- append capacity_text -->
                }}
                |{{{capacity2}}} {{tt|name=Infobox vehicle part|default=units|arg1=units}}
              }}
            }}{{#if:{{{capacity3|}}}
              |<br>{{#if:{{{container|}}}
                |{{#iferror:<!--
              -->{{Tooltip|{{#expr:{{{capacity3}}}}} {{#if:{{{capacity_text3|}}}|{{{capacity_text3}}}}}<!-- append capacity_text --><!--
                -->|{{Container capacity|organized|{{{capacity3}}}}} {{tt|name=Infobox vehicle part|default=with organized trait.|arg1=with_organized}}<!--
                -->&nbsp;{{Container capacity|disorganized|{{{capacity3}}}}} {{tt|name=Infobox vehicle part|default=with disorganized trait.|arg1=with_disorganized}}<!--
              -->}}
                  |{{{capacity3}}} {{#if:{{{capacity_text3|}}}|&nbsp;{{{capacity_text3}}}}}<!-- append capacity_text -->
                }}
                |{{{capacity3}}} {{tt|name=Infobox vehicle part|default=units|arg1=units}}
              }}
            }}
          }}
        }}
      }}<!--


| label14 = {{{func3}}}
  -->{{Infobox/sandbox/row
| data14 = {{{data6|}}}
        |{{tt|name=Infobox vehicle part|default=Wheel friction|arg1=wheel_friction}}
        |{{#if:{{{wheel_friction|}}}
          |{{{wheel_friction}}}{{#if:{{{part_tier|}}}|&nbsp;<small>({{{part_tier}}})</small>}}{{#if:{{{wheel_friction2|}}}
            |<br>{{{wheel_friction2}}}{{#if:{{{part_tier2|}}}|&nbsp;<small>({{{part_tier2}}})</small>}}{{#if:{{{wheel_friction3|}}}
              |<br>{{{wheel_friction3}}}{{#if:{{{part_tier3|}}}|&nbsp;<small>({{{part_tier3}}})</small>}}
            }}
          }}
        }}
      }}<!--


| header15 = {{#if:{{{data7|}}}{{{data8|}}}{{{data9|}}}|{{{part3|}}}}}
  -->{{Infobox/sandbox/row
        |{{tt|name=Infobox vehicle part|default=Max pressure|arg1=max_pressure}}
        |{{#if:{{{pressure_max|}}}
          |{{{pressure_max}}}{{#if:{{{part_tier|}}}|&nbsp;<small>({{{part_tier}}})</small>}}{{#if:{{{pressure_max2|}}}
            |<br>{{{pressure_max2}}}{{#if:{{{part_tier2|}}}|&nbsp;<small>({{{part_tier2}}})</small>}}{{#if:{{{pressure_max3|}}}
              |<br>{{{pressure_max3}}}{{#if:{{{part_tier3|}}}|&nbsp;<small>({{{part_tier3}}})</small>}}
            }}
          }}
        }}
      }}<!--


| label16 = {{{func1}}}
  -->{{Infobox/sandbox/row
| data16 = {{{data7|}}}
        |{{tt|name=Infobox vehicle part|default=Brake force|arg1=brake_force}}
        |{{#if:{{{brake_force|}}}
          |{{{brake_force}}}{{#if:{{{part_tier|}}}|&nbsp;<small>({{{part_tier}}})</small>}}{{#if:{{{brake_force2|}}}
            |<br>{{{brake_force2}}}{{#if:{{{part_tier2|}}}|&nbsp;<small>({{{part_tier2}}})</small>}}{{#if:{{{brake_force3|}}}
              |<br>{{{brake_force3}}}{{#if:{{{part_tier3|}}}|&nbsp;<small>({{{part_tier3}}})</small>}}
            }}
          }}
        }}
      }}<!--


| label17 = {{{func2}}}
  -->{{Infobox/sandbox/row
| data17 = {{{data8|}}}
        |{{tt|name=Infobox vehicle part|default=Damping|arg1=damping}}
        |{{#if:{{{damping|}}}
          |{{{damping}}}{{#if:{{{damping2|}}}|{{#if:{{{vehicle_type|}}}|&nbsp;<small>({{{vehicle_type}}})</small>}}<!--
          --><br>{{{damping2}}}{{#if:{{{vehicle_type2|}}}|&nbsp;<small>({{{vehicle_type2}}})</small>}}{{#if:{{{damping3|}}}
              |<br>{{{damping3}}}{{#if:{{{vehicle_type3|}}}|&nbsp;<small>({{{vehicle_type3}}})</small>}}
            }}
          }}
        }}
      }}<!--


| label18 = {{{func3}}}
  -->{{Infobox/sandbox/row
| data18 = {{{data9|}}}
        |{{tt|name=Infobox vehicle part|default=Compression|arg1=compression}}
        |{{#if:{{{compression|}}}
          |{{{compression}}}{{#if:{{{compression2|}}}|{{#if:{{{vehicle_type|}}}|&nbsp;<small>({{{vehicle_type}}})</small>}}<!--
          --><br>{{{compression2}}}{{#if:{{{vehicle_type2|}}}|&nbsp;<small>({{{vehicle_type2}}})</small>}}{{#if:{{{compression3|}}}
              |<br>{{{compression3}}}{{#if:{{{vehicle_type3|}}}|&nbsp;<small>({{{vehicle_type3}}})</small>}}
            }}
          }}
        }}
      }}<!--


| header31 = Technical details
  -->{{Infobox/sandbox/row
        |{{tt|name=Infobox vehicle part|default=Noise modifier|arg1=noise_modifier}}
        |{{#if:{{{noise_mod|}}}
          |{{{noise_mod}}}{{#if:{{{part_tier|}}}|&nbsp;<small>({{{part_tier}}})</small>}}{{#if:{{{noise_mod2|}}}
            |<br>{{{noise_mod2}}}{{#if:{{{part_tier2|}}}|&nbsp;<small>({{{part_tier2}}})</small>}}{{#if:{{{noise_mod3|}}}
              |<br>{{{noise_mod3}}}{{#if:{{{part_tier3|}}}|&nbsp;<small>({{{part_tier3}}})</small>}}
            }}
          }}
        }}
      }}<!--


| label32   = Base ID
  -->{{Infobox/sandbox/row
| data32     = {{#if:{{{no_style|true}}}|{{ID|{{{class_name|[[#Item IDs|Item IDs]]}}}}}|{{{class_name|[[#Item IDs|Item IDs]]}}}}}
        |{{tt|name=Infobox vehicle part|default=Max condition|arg1=max_condition}}
}}</includeonly><noinclude>{{Documentation}}[[Category:Infobox]]</noinclude>
        |{{{condition_max|}}}
      }}<!--
 
   -->{{Infobox/sandbox/row
        |{{tt|name=Infobox vehicle part|default=Chance damaged|arg1=chance_damaged}}
        |{{#if:{{{chance_damaged|}}}
          |{{#iferror:{{#expr:{{{chance_damaged}}}}}%
            |{{{chance_damaged}}}
          }}{{#if:{{{chance_damaged_text|}}}{{{part_tier|}}}|&nbsp;{{{chance_damaged_text|<small>({{{part_tier}}}</small>)}}}}}{{#if:{{{chance_damaged2|}}}
            |<br>{{#iferror:{{#expr:{{{chance_damaged2}}}}}%
              |{{{chance_damaged2}}}
            }}{{#if:{{{chance_damaged_text2|}}}{{{part_tier2|}}}|&nbsp;{{{chance_damaged_text2|<small>({{{part_tier2}}}</small>)}}}}}{{#if:{{{chance_damaged3|}}}
              |<br>{{#iferror:{{#expr:{{{chance_damaged3}}}}}%
                |{{{chance_damaged3}}}
              }}{{#if:{{{chance_damaged_text3|}}}{{{part_tier3|}}}|&nbsp;{{{chance_damaged_text3|<small>({{{part_tier3}}}</small>)}}}}}
            }}
          }}
        }}
      }}
    }}
  }}<!--
 
    ## INSTALL/UNINSTALL ##
 
-->{{#if:{{{tool|}}}{{{tool_tag|}}}{{{skill|}}}{{{recipe|}}}
     | {{Infobox/section
      | {{tt|name=Infobox vehicle part|default=Install/Uninstall|arg1=install_uninstall}}
      | color = var(--color-red)
      | id = vehicle_part-install
      | <!--
  -->{{Infobox/sandbox/row
        |{{tt|name=Infobox vehicle part|default=Tool(s)|arg1=tools}}
        |{{#if:{{{tool|}}}
          |{{{tool}}}
          |{{#if:{{{tool_tag|}}}|{{tl|{{{tool_tag}}}}}}}
        }}{{#if:{{{tool2|}}}
          |<br>{{{tool2}}}
          |{{#if:{{{tool_tag2|}}}|<br>{{tl|{{{tool_tag2}}}}}}}
        }}{{#if:{{{tool3|}}}
          |<br>{{{tool3}}}
          |{{#if:{{{tool_tag3|}}}|<br>{{tl|{{{tool_tag3}}}}}}}
        }}{{#if:{{{tool4|}}}
          |<br>{{{tool4}}}
          |{{#if:{{{tool_tag4|}}}|<br>{{tl|{{{tool_tag4}}}}}}}
        }}{{#if:{{{tool5|}}}
          |<br>{{{tool5}}}
          |{{#if:{{{tool_tag5|}}}|<br>{{tl|{{{tool_tag5}}}}}}}
        }}{{#if:{{{tool6|}}}
          |<br>{{{tool6}}}
          |{{#if:{{{tool_tag6|}}}|<br>{{tl|{{{tool_tag6}}}}}}}
        }}
      }}<!--
 
  -->{{Infobox/sandbox/row
        |{{tt|name=Infobox vehicle part|default=Recommended level|arg1=recommended_level}}
        |{{#if:{{{skill|}}}|{{{skill}}}<!--
      -->{{#if:{{{skill2|}}}|{{{skill2}}}<!--
        -->{{#if:{{{skill3|}}}|{{{skill3}}} }}
          }}
        }}
      }}<!--
 
  -->{{Infobox/sandbox/row
        |{{tt|name=Infobox vehicle part|default=Recipe|arg1=recipe}}
        |{{{recipe|}}}
      }}
    }}
  }}<!--
 
    ## TECHNICAL ##
 
-->{{#if:{{{item_id|}}}{{{item_id_more|}}}
    | {{Infobox/section
      | {{tt|name=Infobox vehicle part|default=Technical|arg1=technical}}
      | color = var(--color-red)
      | id = vehicle_part-technical
      | collapsed = true
      | {{#if:{{{item_id|}}}{{{item_id_more|}}}
        | {{Infobox/sandbox/row
          |{{tt|name=Infobox vehicle part|default=Item ID|arg1=item_id}}
          |{{ID
            |{{{item_id|}}} {{#if:{{{item_id2|}}}
            |<br>{{{item_id2|}}}}} {{#if:{{{item_id3|}}}
            |<br>{{{item_id3|}}}}} {{#if:{{{item_id4|}}}
            |<br>{{{item_id4|}}}}} {{#if:{{{item_id5|}}}
            |<br>{{{item_id5|}}}}} {{#if:{{{item_id6|}}}
            |<br>{{{item_id6|}}}}} {{#if:{{{item_id7|}}}
            |<br>{{{item_id7|}}}}} {{#if:{{{item_id8|}}}
            |<br>{{{item_id8|}}}}} {{#if:{{{item_id9|}}}
            |<br>{{{item_id9|}}}}} {{#if:{{{item_id10|}}}
            |<br>{{{item_id10|}}}}}
          }}{{#if:{{{item_id_more|}}}|<br><small title="{{{item_id_more}}}">[[#{{{item_id_more}}}|[{{tt|name=Infobox vehicle part|default=See all|arg1=see_all}}]]]</small>}}
        }}
      }}
    }}
  }}
}}</includeonly>

Latest revision as of 23:39, 27 April 2024

Notebook.pngTemplate Documentation

This template is used to create an infobox in an article about vehicle parts.

Usage

To use this template in an article, copy the template below, then paste the template into the article, filling in the blanks.

name
Image.png
General
Category
category
Encumbrance
Moodle Icon HeavyLoad.png
3 weight_text
Function
function
Properties
Capacity Trunk
10  capacity_text
Wheel friction
wheel_friction (part_tier)
Max pressure
pressure_max (part_tier)
Brake force
brake_force (part_tier)
Damping
damping
Compression
compression
Noise modifier
noise_mod (part_tier)
Max condition
condition
Chance damaged
chance_damaged chance_damaged_text
Install/Uninstall
Tool(s)
tool
Recommended level
skill
Recipe
recipe
Technical
Item ID
item_id
[See all]
{{Infobox vehicle part
|name=
|model=
|model_width=
|icon=
|icon_name=
<!--General-->
|category=
|weight=
|weight_text=
|function=
<!--Properties-->
|container=
|capacity=
|capacity_text=
|wheel_friction=
|pressure_max=
|brake_force=
|damping=
|compression=
|part_tier=
|noise_mod=
|damage_chance=
|vehicle_type=
|vehicle_type2=
|vehicle_type3=
|condition_max=
|chance_damaged=
<!--Install/Uninstall-->
|tool_tag=<!-- or |tool -->
|skill=
|recipe=
<!--Technical-->
|item_id=
|item_id_more=
}}

Parameters

Image and name

name
Name of the item. Displayed at the top of the infobox. Default: uses page display title
model
Model for the item with the format Image.png. Multiple images can be set by changing the suffix id, e.g. model2. Default: uses icon if defined
model_name
Name of the item for the model. If multiple images are defined, it will be set for the model with the same suffix id, e.g. model_name2. Default: uses name if defined
icon
Icon for the item, with the format Image.png. Multiple icons can be set by changing the suffix id, e.g. icon2. Default: uses image, only if more than one image defined
icon_name
Name of the icon. If multiple icons are defined, it will be set for the icon with the same suffix id, e.g. icon_name2. Default: uses name if defined

General

category
The in-game category for the item.
weight
The encumbrance (previously weight) of the item. Will automatically calculate the weight when equipped and display as a tooltip. Up to 3 different weights can be defined by adding a suffix id to the end of the parameter, e.g. weight2.
weight_text
Text to appear next to the weight value with the same suffix id. E.g. (regular).
function
The function of the item, if not obvious from other infobox parameters. If none, leave blank.

Properties

vehicle_type
The vehicle type. Will be displayed next to certain properties. Up to 3 can be defined, which should always be the following: 1 = Standard, 2 = Heavy-Duty, 3 = Sport. Should only be defined if required.
part_tier
The tier of the part, i.e. the name prefix (such as "Old"). Up to 3 can be defined. Should only be defined if required.
container
The type of container. This will determine the icon to be displayed next to capacity.
Container GloveCompartment.png glove box
Container CarSeat.png seat
Container TruckBed.png truck bed
Container CarTrunk.png trunk
capacity
The maximum weight that the container of a single tile can store, or other non-storage related capacities, such as electricity charge (use pressure_max instead for tires). If required, tooltips can be set manually using Template:Container capacity, which are automatically added if container is defined. Up to 3 different capacities can be defined by adding a suffix id to the end of the parameter, e.g. capacity2.
capacity_text
Displays text next to the capacity value with the same suffix id. Used so automatic calculations/tooltips will still be displayed.
wheel_friction
WheelFriction value for the item (tires). part_tier can be used to display the tier of the part next to the value with the same suffix id.
pressure_max
ConditionMax for tires (use capacity for other items). part_tier can be used to display the tier of the part next to the value with the same suffix id.
brake_force
brakeForce value for the item (brakes). part_tier can be used to display the tier of the part next to the value with the same suffix id.
damping
SuspensionDamping value for the item (suspension). vehicle_type can be used to display the vehicle type for the part next to the value with the same suffix id.
compression
SuspensionCompression value for the item (suspension). vehicle_type can be used to display the vehicle type for the part next to the value with the same suffix id.
noise_mod
EngineLoudness value for the item (muffler). part_tier can be used to display the tier of the part next to the value with the same suffix id.
condition_max
ConditionMax value for the item.
chance_damaged
ChanceToSpawnDamaged value for the item. chance_damaged_text can be used to display text next to the value, otherwise part_tier will be used (if defined).
chance_damaged_text
Text to display next to chance_damaged.

Install/Uninstall

tool or tool_tag
The tool or tool tag required to install/uninstall the part. tool_tag will automatically link to the appropriate item tag. Up to 3 can be defined by changing the suffix id, e.g. tool2.
skill
The recommended level for installing/uninstalling the part. Up to 3 can be defined by changing the suffix id, e.g. skill2.
recipe
The recipe required to install/uninstall.

Technical

item_id
The ID for the item. The format is [module].[name]. Multiple item IDs can be set by either: separating with <br> or adding a 'suffix id' to the end (up to 10), e.g. item_id2.
item_id_more
Adds a "See all" link, linking to the section named in the parameter. E.g. id_more=Item IDs will link to a section called "Item IDs". This is useful for multiple IDs, or where more information is required to distinguish between each ID, as the ID itself may not be very descriptive.

How to translate

This template is translatable.

Template code

Paste the following code into the <includeonly> tag of the translated template and translate the text after each = sign (except for #default =).

{{#switch: {{{1|}}}
| general = General
| category = Category
| weight = Encumbrance
| weight_equipped = when equipped
| properties = Properties
| capacity = Capacity
| with_organized = with organized trait.
| with_disorganized = with disorganized trait.
| units = units
| function = Function
| wheel_friction = Wheel friction
| max_pressure = Max pressure
| brake_force = Brake force
| damping = Damping
| compression = Compression
| noise_modifier = Noise modifier
| max_condition = Max condition
| chance_damaged = Chance damaged
| install_uninstall = Install/Uninstall
| tools = Tool(s)
| recommended_level = Recommended level
| recipe = Recipe
| technical = Technical
| item_id = Item ID
| item_id_more = Item ID's
| see_all = See all
| #default = {{Error|translation}}
}}

Template documentation

Copy the code wrapped in the <noinclude> tag in this template and translate the text after doc = in the {{Documentation}} template.

{{Translation guide}} template should be removed from the translated documentation.

See also

Editors can experiment in this template's sandbox.