Explanation

The 2020 MotorSports cars introduced us to Tuning combined with Drivers, Principals and XP. Each step/level increases the car’s PR. As far as we know, the increases in performance and the costs are consistent for all cars in the same category   e.g. F1 2020. This script will calculate and return the car’s PR (and/or other details) based on the user-specified parameters.


Parameters

  • All parameters are specified as |parameter=value   e.g. |Category=GTE 2020.
  • All parameter values are (should be!) case-insensitive.
Parameter Alternative Description Valid Values
Category C Car category and year NASCAR 2020, F1 2020, Formula E 2020, GTE 2020, LMP1 2009

NOTE: This is the only mandatory parameter!

Car Car e.g. Audi R15 TDI
PR The car's base PR
Tuning T All Tuning steps in a single string.

Speed-Acceleration-Brakes-Grip

0-10 or max   e.g. 4-max-7-3

Specifying |Tuning=max will set all Tuning values to max!

Speed S Tuning Speed step 0-10 or max
Acceleration A Tuning Acceleration step 0-10 or max
Brakes B Tuning Brakes step 0-10 or max
Grip G Tuning Grip step 0-10 or max
Driver D Driver Level 1-8 or max
Principal P Principal level 1-13 or max
Output O Specify what should be returned/output See the Specifying the Output section


Testing

NASCAR 2020

{{CalcPR
|C=NASCAR 2020
|PR=43.8
|S=2
|A=3
|B=1
|G=2
|D=4
|P=6
}}

48.325

F1 2020

{{CalcPR
|Category=F1 2020
|PR=115.9
|Speed=9
|Acceleration=4
|Brakes=6
|Grip=5
|Driver=7
|Principal=5
}}

126.854

Formula E 2020

{{CalcPR
|C=Formula E 2020
|PR=54.7
|S=max
|A=max
|B=max
|G=max
|D=max
|P=max
}}

70.935

GTE 2020

{{CalcPR
|Category=GTE 2020
|PR=63.6
|Tuning=6-8-7-5
|Driver=3
|Principal=2
}}

72.956

LMP1 2009

{{CalcPR
|Category=LMP1 2009
|PR=73.3
|Tuning=Festival
}

81.974

{{CalcPR
|Category=LMP1 2009
|Car=Aston Martin DBR1-2
|PR=73.4
|Tuning=LMP Tour
}}

81.848


Using Event Tuning Setups

NOTE: These are specified in the ArrTuningSetups template.
Set the Tuning by using |Tuning=Event or |Tuning=Track

Category Event Track Tuning Curr.M.Dollars.New.80x80.Shifted.png PR
F1 2020 USA CotA 8-5-8-7 3,318,600 8.875
F1 2020 Singapore Marina Bay 5-8-7-8 3,548,600 9.248
F1 2020 Spain Barcelona 7-8-6-7 3,449,200 9.239
F1 2020 Abu Dhabi Abu Dhabi 8-6-6-8 3,361,000 9.083
F1 2020 Austria RBR 7-7-6-8 3,407,700 9.181
F1 2020 Italy Monza 10-6-9-3 3,643,500 8.776
F1 2020 Monaco Monaco 3-9-7-9 3,965,800 9.389
F1 2020 Britain Silverstone 8-7-7-6 3,329,300 9.066
F1 2020 Belgium Spa 9-6-7-6 3,313,100 8.967
NASCAR 2020 Federated Auto Parts 400 Richmond 9-7-5-7 2,080,600 8.298
NASCAR 2020 Daytona 400 Daytona 10-10-2-6 2,543,200 8.620
NASCAR 2021 Daytona 500 Daytona 10-10-2-6 2,543,200 8.620
NASCAR 2021 Toyota Owners 400 Richmond 9-7-5-7 2,080,600 8.298
Formula E 2020 New York New York 5-6-9-8 2,961,700 7.942
Formula E 2020 Berlin Tempelhof 8-8-7-5 3,017,900 8.066
GTE 2020 Race Day: GTE Endurance Championship Endurance 6-7-7-8 2,566,700 8.919
GTE 2020 Race Day: Le Mans Le Mans 10-7-8-3 2,794,400 8.684
LMP1 2009 Race Day: Festival Festival 6-7-7-8 2,972,100 8.674
LMP1 2009 Race Day: LMP Tour LMP Tour 10-7-8-3 3,235,900 8.447

Examples

The maximum tuning costs for [[Race Day: Le Mans 2020]] are {{M$}}{{FormatNumDP|{{CalcPR
|Category=GTE 2020
|Tuning=Le Mans
|Output=tc
}}}}.

The maximum tuning costs for Race Day: Le Mans 2020 are Curr.M.Dollars.New.80x80.Shifted.png2,794,400.

Full tuning for [[Federated Auto Parts 400 (2020)]] increases the car’s PR by {{CalcPR
|Category=NASCAR 2020
|Tuning=Federated Auto Parts 400
}}.

Full tuning for Federated Auto Parts 400 (2020) increases the car’s PR by 8.298.


Specifying the Output

Specify what should be returned by setting the output parameter   e.g. |Output=DXP

Value Description
T Tuning Setup e.g.

10-7-8-3

PRS Tuning Speed PR
PRA Tuning Acceleration PR
PRB Tuning Brakes PR
PRG Tuning Grip PR
PRT Tuning PR
PRD Driver PR
PRP Principal PR
PR Total (upgraded) PR

NOTE: This is the default setting (so is not necessary)

TCS Tuning Speed Cost M$
TCA Tuning Acceleration Cost M$
TCB Tuning Brakes Cost M$
TCG Tuning Grip Cost M$
TC Tuning Cost M$
DXP Driver XP required
DTC Driver Training Cost M$
DGC Driver Level-Up Cost Gold
PXP Principal XP required
PGC Principal Level-Up Cost Gold
MD Total Cost M$
GC Total Cost Gold
All A string containing all values separated by ; semi-colon

See the All Values Returned section

List Output values as a simple list
Table Output values as a simple 2-column (sub-) table
WikiTable Output values as a simple 2-column Wiki-formatted (sub-) table
{{CalcPR
|Category=F1 2020
|PR=115.9
|Speed=9
|Acceleration=4
|Brakes=6
|Grip=5
|Driver=7
|Principal=5
|Output=t
}}

9-4-6-5

|O=TC

2713700

|O=DXP

65000

|O=DTC

938000

|O=dgc

521

|O=PXP

900

|Output=pgc

51

|O=Md

3651700

|O=GC

572

|Output=all

115.9;9-4-6-5;7;5;126.854;2713700;65000;938000;521;900;51;2.685;1.591;1.591;1.699;7.566;2.623;0.765;1222900;473300;506900;510600

|O=List


  • Base PR = 115.900
  • Tuning = 9-4-6-5
  • Driver Level = 7
  • Principal Level = 5
  • PRs
    • Tuning Speed PR = 2.685
    • Tuning Acceleration PR = 1.591
    • Tuning Brakes PR = 1.591
    • Tuning Grip PR = 1.699
    • Tuning PR = 7.566
    • Driver PR = 2.623
    • Principal PR = 0.765
    • Upgraded PR = 126.854
  • Tuning Costs
    • Tuning Speed Cost Curr.M.Dollars.New.80x80.Shifted.png = 1,222,900
    • Tuning Acceleration Cost Curr.M.Dollars.New.80x80.Shifted.png = 473,300
    • Tuning Brakes Cost Curr.M.Dollars.New.80x80.Shifted.png = 506,900
    • Tuning Grip Cost Curr.M.Dollars.New.80x80.Shifted.png = 510,600
    • Tuning Cost Curr.M.Dollars.New.80x80.Shifted.png = 2,713,700
  • Driver XP Required = 65,000
  • Driver Training Cost Curr.M.Dollars.New.80x80.Shifted.png = 938,000
  • Driver Level-Up Cost Curr.Gold.New.80x80.Shifted.png = 521
  • Principal XP Required = 900
  • Principal Level-Up Cost Curr.Gold.New.80x80.Shifted.png = 51
|O=table


Base PR 115.900
Tuning 9-4-6-5
Driver Level 7
Principal Level 5
Tuning Speed PR 2.685
Tuning Acceleration PR 1.591
Tuning Brakes PR 1.591
Tuning Grip PR 1.699
Tuning PR 7.566
Driver PR 2.623
Principal PR 0.765
Upgraded PR 126.854
Tuning Speed Cost Curr.M.Dollars.New.80x80.Shifted.png 1,222,900
Tuning Acceleration Cost Curr.M.Dollars.New.80x80.Shifted.png 473,300
Tuning Brakes Cost Curr.M.Dollars.New.80x80.Shifted.png 506,900
Tuning Grip Cost Curr.M.Dollars.New.80x80.Shifted.png 510,600
Tuning Cost Curr.M.Dollars.New.80x80.Shifted.png 2,713,700
Driver XP Required 65,000
Driver Training Cost Curr.M.Dollars.New.80x80.Shifted.png 938,000
Driver Level-Up Cost Curr.Gold.New.80x80.Shifted.png 521
Principal XP Required 900
Principal Level-Up Cost Curr.Gold.New.80x80.Shifted.png 51
|Output=WikiTable


Base PR 115.900
Tuning 9-4-6-5
Driver Level 7
Principal Level 5
Tuning Speed PR 2.685
Tuning Acceleration PR 1.591
Tuning Brakes PR 1.591
Tuning Grip PR 1.699
Tuning PR 7.566
Driver PR 2.623
Principal PR 0.765
Upgraded PR 126.854
Tuning Speed Cost Curr.M.Dollars.New.80x80.Shifted.png 1,222,900
Tuning Acceleration Cost Curr.M.Dollars.New.80x80.Shifted.png 473,300
Tuning Brakes Cost Curr.M.Dollars.New.80x80.Shifted.png 506,900
Tuning Grip Cost Curr.M.Dollars.New.80x80.Shifted.png 510,600
Tuning Cost Curr.M.Dollars.New.80x80.Shifted.png 2,713,700
Driver XP Required 65,000
Driver Training Cost Curr.M.Dollars.New.80x80.Shifted.png 938,000
Driver Level-Up Cost Curr.Gold.New.80x80.Shifted.png 521
Principal XP Required 900
Principal Level-Up Cost Curr.Gold.New.80x80.Shifted.png 51


Using the Output

The [[ASTON MARTIN RED BULL RACING RED BULL RACING RB16]] with Tuning 9-4-6-5, Driver Level 7 and Principal Level 5 will have PR {{CalcPR
|Category=F1 2020
|PR=115.9
|Speed=9
|Acceleration=4
|Brakes=6
|Grip=5
|Driver=7
|Principal=5
|Output=PR
}} whilst the maximum PR is {{CalcPR
|Category=F1 2020
|PR=115.9
|T=max
|D=max
|P=max
}}.

The ASTON MARTIN RED BULL RACING RED BULL RACING RB16 with Tuning 9-4-6-5, Driver Level 7 and Principal Level 5 will have PR 126.854 whilst the maximum PR is 134.268.

For a 2020 F1 car the cost of Tuning 8-7-7-6 is {{M$}}{{FormatNumDP|{{CalcPR
|Category=F1 2020
|Speed=8
|Acceleration=7
|Brakes=7
|Grip=6
|Output=TC
}}}} and the maximum Tuning cost is {{M$}}{{FormatNumDP|{{CalcPR
|Category=F1 2020
|Tuning=max-max-max-max
|Output=TC
}}}}.

For a 2020 F1 car the cost of Tuning 8-7-7-6 is Curr.M.Dollars.New.80x80.Shifted.png3,329,300 and the maximum Tuning cost is Curr.M.Dollars.New.80x80.Shifted.png6,530,300.

Maxing a GTE 2020 car’s Principal requires {{FormatNumDP|{{CalcPR
|C=Gte 2020
|P=Max
|Output=PXP
}}}} XP.

Maxing a GTE 2020 car’s Principal requires 9,000 XP.


All Values Returned

If you need to use more than one of the possible values it makes more sense to retrieve all values.

{{CalcPR
|Category=GTE 2020
|PR=63.6
|Tuning=Le Mans
|Driver=3
|Principal=2
|Output=all
}}

63.6;10-7-8-3;3;2;73.327;2794400;4000;78000;56;150;9;2.908;2.714;2.068;0.994;8.684;0.852;0.191;1134800;773600;659600;226400

Position Description Value
0 Base PR 63.6
1 Tuning (Speed-Acceleration-Brakes-Grip) Steps 10-7-8-3
1.0 Tuning Speed Step 10
1.1 Tuning Acceleration Step 7
1.2 Tuning Brakes Step 8
1.3 Tuning Grip Step 3
2 Driver Level 3
3 Principal Level 2
4 Total (Upgraded) PR 73.327
5 Tuning Cost M$ 2794400
6 Driver XP Required 4000
7 Driver Training Cost M$ 78000
8 Driver Level-Up Cost Gold 56
9 Principal XP Required 150
10 Principal Level-Up Cost Gold 9
11 Tuning Speed PR 2.908
12 Tuning Acceleration PR 2.714
13 Tuning Brakes PR 2.068
14 Tuning Grip PR 0.994
15 Tuning PR 8.684
16 Driver PR 0.852
17 Principal PR 0.191
18 Tuning Speed Cost M$ 1134800
19 Tuning Acceleration Cost M$ 773600
20 Tuning Brakes Cost M$ 659600
21 Tuning Grip Cost M$ 226400

How to Use

  • (Convert the returned values into a string and) Use #explode to retrieve specific values.
  • Convert the returned values into an array and use the array commands.

NOTE: Don’t forget that both use zero-based positioning (as per the above table).

Reference

Community content is available under CC-BY-SA unless otherwise noted.