Leaderboard Functions - Jamiras/RATools GitHub Wiki

leaderboard(title, description, start, cancel, submit, value, format="VALUE", lower_is_better=false, id=0)

Defines a leaderboard. title and description must be strings.

start, cancel, and submit are trigger expressions similar to the achievement's trigger parameter.

value is a memory accessor, arithmetic expression, or a function that evaluates to a memory accessor or arithmetic expression. Multiple values may be defined by encasing them in a max_of(a, b, ...) function.

format is one of the following:

  • VALUE - number (default)
  • SECS - the value is a number of seconds that should be formatted as MM:SS
  • FRAMES - the value is divided by 60 and displayed as MM:SS
  • POINTS - the value should be displayed as a zero-padded six digit number
  • MILLISECS - the value is a number of hundredths of a second and will be displayed as MM:SS.FF
  • MINUTES - the value is a number of minutes that should be formatted as HHhMM
  • SECS_AS_MINS - the value is a number of seconds that should be formatted as HHhMM
  • FLOAT1 ... FLOAT6 - the value is formatted to N digits after the decimal (FLOAT1 = 1 digit after the decimal, FLOAT3 = 3 digits after the decimal, etc).
  • FIXED1 ... FIXED3 - the value is formatted with a decimal point N spaces from the end (FIXED1 = 1 digit after the decimal).
  • TENS, HUNDREDS, THOUSANDS - the value is padded with additional 0s after the end of the value.

if lower_is_better is true, lower scores will be ranked higher in the leaderboard.

if id is provided when calling the leaderboard function, the script will generate a local leaderboard definition that the toolkit will merge into the existing leaderboard instead of putting as a separate local leaderboard.