FANDOM


Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit Template:GameVersion/doc to edit this documentation. (How does this work?)

This script takes the passed-in version number and determines the correct version number which it then uses to retrieve the link to the History page for the version and, depending on the optional parameters specified, returns one of the following

  • Version Number (as a link to the History page)
  • Version Name (as a link to the History page)      DEFAULT
  • History Link (as a link to the History page)

Syntax

{{GameVersion|version number}}
{{GameVersion|Version=version number}}

Optional Parameters

{{GameVersion|Version=...|Link=Y or N}}
{{GameVersion|Version=...|Output=NUM or TEXT or LINK}}
{{GameVersion|Version=...|BR=Y}}
{{GameVersion|Version=...|V=v}}
{{GameVersion|Version=...|Style=font styling}}
  • Version or first/only unnamed parameter {{{1}}} = Version Number
    • The Version Number will be corrected to a standard value
    • If not a recognised value it will be replaced with ? which allows the calling script to check for a valid version number, see examples below
    • Note: Setting the version to current will return the current version
      • {{GameVersion|Version=current}} or {{GameVersion|current}}
  • Link = Y to make the Output into a link, N = just return the Output
  • Output = What to output!
    • NUM = the corrected Version Number (to be displayed as the link)
    • TEXT = the nicely formatted Version (Link) Name (to be displayed as the link)
    • LINK = the unformatted Version Link (to be displayed as the link)
  • Version Number relevant parameters, only relevant if |Output=NUM
    • BR = Y (actually, anything will do!) to wrap Version Number in brackets
    • V = value ... precede Version Number with value ... normally "v" (case-sensitive)
  • Style = font styling e.g. font-size:12px or color:white
  • Parameter names are case-sensitive so Output= is ok but output= and OUTPUT= are not.

The default values are

  • Link = Y
  • Output = TEXT
  • No brackets and no styling

Parameter values are case-insensitive so Num, NUM and num all work fine.


No Optional Parameters

{{GameVersion|1}}
{{GameVersion|Version=1.0.5}}
{{GameVersion|Version=1.1}}
{{GameVersion|2.6}}
{{GameVersion|Version=5.6.0}}
{{GameVersion|Version=6}}
{{GameVersion|6.0.5}}
{{GameVersion|99}}
{{GameVersion|current}}
{{GameVersion|next}}

Announcing Real Racing 3 (v1.0)
Announcing Real Racing 3 (v1.0)
Chevrolet Update (v1.1)
Classic Lamborghini Update (v2.6)
Aston Martin Update (v5.6.0)
Red Bull Ring Update (v6.0.0)
Real Racing Classics Update (v6.0.7)
Real Racing 3 ??? (v99)
GT3 Update (v8.4)
NEXT Update (v8.5)

The current release is {{GameVersion|Version=Current}}.

The current release is GT3 Update (v8.4).

'''Racing School Advanced''' is a time-limited event that allows players to win the [[BMW Z4 SDRIVE35IS]].
Since {{GameVersion|2.6}} the event has been a part of the [[Amateur]] group.

Racing School Advanced is a time-limited event that allows players to win the BMW Z4 SDRIVE35IS.
Since Classic Lamborghini Update (v2.6) the event has been a part of the Amateur group.


Link Parameter Set

{{GameVersion|current|Link=N}}

GT3 Update (v8.4)

{{GameVersion|Version=2.6|Link=Y}}

Classic Lamborghini Update (v2.6)

{{GameVersion|Version=6|Link=wibble}}

Red Bull Ring Update (v6.0.0)


Output Parameter Set

{{GameVersion|current|Output=num}

8.4

{{GameVersion|Version=3.5|Output=TEXT}

Lions of Leipzig Update (v3.5)

{{GameVersion|Version=4.2|Output=link}

History#Real Racing 3 Venom Update (v4.2)

{{GameVersion|Version=3.7|Output=wibble}

McLaren Update (v3.7)


Both Parameters Set

{{GameVersion|Version=current|Link=N|Output=num}

8.4

{{GameVersion|Version=2.6|Link=N|Output=TEXT}

Classic Lamborghini Update (v2.6)

{{GameVersion|Version=2.6|Link=N|Output=link}

History#Real Racing 3 Classic Lamborghini Update (v2.6)

{{GameVersion|Version=2.6|Link=N|Output=wibble}

Classic Lamborghini Update (v2.6)

{{GameVersion|Version=2.6|Link=Y|Output=NUM}

2.6

{{GameVersion|Version=current|Link=Y|Output=text}

GT3 Update (v8.4)

{{GameVersion|Version=2.6|Link=Y|Output=LINK}

History#Real Racing 3 Classic Lamborghini Update (v2.6)

{{GameVersion|Version=2.6|Link=Y|Output=wibble}

Classic Lamborghini Update (v2.6)

{{GameVersion|Version=2.6|Link=wibble|Output=wobble}

Classic Lamborghini Update (v2.6)


Invalid Version Number

The function of this script is to return a corrected version (number, name or link text) (as a link to the History page). Invalid values will not be highlighted in red. It is up to the calling script to check for errors and deal with them accordingly.

  • Output = NUM. An invalid version number will be returned as ?.
  • Output = LINK or NAME (default). The name will have ??? for the version BUT the bracketed version will be the value you passed to the script.

The calling script can check for these values and process the result accordingly.

{{GameVersion|99|Output=num}}

?

{{GameVersion|Wobble|Output=link}}

History#Real Racing 3 ??? (vWobble)

{{GameVersion|Version=99}}

Real Racing 3 ??? (v99)

{{GameVersion|99|Link=n|Output=num}}

?

{{GameVersion|Wobble|Link=n|Output=link}}

History#Real Racing 3 ??? (vWobble)

{{GameVersion|Version=99|Link=n}}

Real Racing 3 ??? (v99)

Checking in a script

{{script|Ver=6.0.7}}
{{script|Ver=6.0.5}}
{{script|Ver=99}}
- - - - - -
{{#vardefine:VerNum|{{GameVersion|{{{Ver|}}}|Link=n|Output=num}}}}
Version Number {{{Ver|}}} is 
{{#ifeq:{{#var:VerNum}}|?|invalid|valid
{{#ifeq:{{{Ver|}}}|{{#var:VerNum}}|| but the corrected version number is {{#var:VerNum}}}}
}}.

Version Number 6.0.7 is valid.

Version Number 6.0.5 is valid but the corrected version number is 6.0.7.

Version Number 99 is invalid.


More Parameters!

Wrapping the Version Number in brackets and/or preceding it with v

{{GameVersion|Version=2.6|Output=num|BR=Y}}
{{GameVersion|Version=2.6|Link=n|Output=num|V=v}}
{{GameVersion|Version=2.6|Output=num|BR=Y|V=V}}

(2.6)
v2.6
(V2.6)

Styling

{{GameVersion|Version=2.6|Style=color:orange}}

Classic Lamborghini Update (v2.6)

{{GameVersion|Version=2.6|Output=link|Style=font-size:20px}}

History#Real Racing 3 Classic Lamborghini Update (v2.6)

{{GameVersion|Version=2.6|Link=N|Style=color:green}}

Classic Lamborghini Update (v2.6)

{{GameVersion|Version=2.6|Output=num|BR=y|Style=color:silver}}

(2.6)

{{GameVersion|Version=2.6|Link=N|Output=num|BR=y|V=v|Style=color:white;font-size:10px;}}

(v2.6)

{{GameVersion|Version=2.6|Style=color:#FF88AA;font-weight:bold;}}

Classic Lamborghini Update (v2.6)


A good example which uses most of the above parameters (and which was the driving force behind creating this script!) is the Series tables on the Series and Special Events page which displays the version nunber in brackets in navy and linked to the History page.

Index Series (Abbr.) Cars
M.1.3

(6.1)

Series 2018 Season (NASCAR)
2018 Season (NASCAR) (NA2018)

Showcase CHEVROLET CAMARO ZL1 (2018)
CHEVROLET CAMARO ZL1 (2018)
Showcase FORD FUSION (2018)
FORD FUSION (2018)
Showcase TOYOTA CAMRY (2018)
TOYOTA CAMRY (2018)
 
Community content is available under CC-BY-SA unless otherwise noted.