The upgrades template, used to display the upgrade costs for cars on their article page has had a makeover, all 133 car page has been updated with the template and now display totals. The existing data is unchanged, all the work to format the car upgrade data is calculated by the template code behind the scenes. When car upgrade costs in R$ or
<noscript></noscript> are entered into the upgrade template the costs will automatically format, calculate and total.Example
There are three parts to the upgrade template, the headings, the data and the total:
Colour keys | |
---|---|
White | purchase before any upgrades Or instant purchase |
Green | purchase after any upgrades |
Red | only purchase |
For upgrades including PR values, please see the project page RR3_Wiki:Upgrades_Section_(Classic_Version), please be aware that PR values can vary depending on the upgrade order.
{{H/upgrades}}
{{R/upgrades|1|Engine|Cold Air Intake|30 minutes|13,500|3}}
{{R/upgrades|2|Engine|Competition Engine Tuning|1 hour 15 minutes|20,300|5}}
{{R/upgrades|4|Engine|Increase Engine Bore|||12}}
{{R/upgrades|5|Engine|Performance Intake Manifold|12 hours|68,600|18}}
{{R/upgrades|6|Engine|Competition Cam-Shaft|||28}}
{{R/upgrades|7|Engine|Competition Cylinder Heads|1 day|154,300|42}}
{{R/upgrades|8|Engine|High Performance Supercharger Pulley Kit|||60}}
{{T/upgrades|1 day 17 hours 5 minutes}}
Technical details
Heading
{{H/upgrades}}
The heading has no input data, it formats the table headings and configures the columns for sorting.
Upgrade Data
The upgrade data takes upto 6 data inputs, separated by a pipe |, for example:
{{R/upgrades|1|Engine|Cold Air Intake|30 minutes|13,500|3}}
In this example :
- 1 = The number of the upgrade, 1 being the first upgrade, this should be in a value format.
- Engine = The component being upgraded, either Engine, Drivetrain, Body, Suspension, Exhaust, Brakes or Tires & Wheels
- Cold Air Intake = Description of the upgrade (number 3 in the above screengrab)
- 30 minutes = The length of time the upgrade will take, use the format day(s), hour(s) minute(s) (empty for Gold only upgrades) (number 4 in the above screengrab)
- 13,500 = R$ upgrade cost, this should be in a value format, either 13500 or 13,500, if the comma separator isn't entered, it will automatically be added (empty for Gold only upgrades) (number 5 in the above screengrab)
- 3 = Upgrade cost in , this should be in a value format (number 6 in the above screengrab)
Total
{{T/upgrades|1 day 17 hours 5 minutes}}
In this example :
- 1 day 17 hours 5 minutes = The total upgrade time, if all upgrades are completed consecutively. It is free text, the total needs to be manually calculated and entered if empty the total will be blank.
Quality Check
Upgrade descriptions are checked against previously used descriptions. If the description hasn't been used before, it will display in red, this is to catch typos and spelling mistakes. Double check any red descriptions, if they are correct, add them to this template:
Add descriptions to the second to last line, in the format | lower case description = Proper Case Description e.g.:
| race prototype intake manifold = Race Prototype Engine Tuning
History
This the second template to be created as part of the project to automatically add totals to data. This follows on from the Manufacturers page.
Comments
Any problems or comments, please feel free to post a comment below or on my message wall. Thank you for your support.
Edit: 3-Dec-2017 Added Quality Check