-
Notifications
You must be signed in to change notification settings - Fork 11
Achievement Functions
achievement(title, description, points, trigger, id=0, published="", modified="", badge="0", type="")
Defines a new achievement with the specified title
(string), description
(string), points
(integer), and trigger
.
trigger
is an expression with one or more comparisons. These may be modified by trigger functions.
if id
is provided when calling the achievement
function, the script will generate a local achievement definition that the toolkit will merge into the existing achievement instead of putting as a separate local achievement.
badge
can be used to specify the image associated to the achievement. The value is the ID of the badge (already on the server). RATools will not upload a badge for you.
published
and modified
are unused parameters that are populated when generating a script from existing achievements.
type
specifies the classification of the achievement. Valid values are:
value | type |
---|---|
"" |
Standard (unflagged) |
"missable" |
Missable |
"progression" |
Progression |
"win_condition" |
Win condition |
function current_board() => byte(0x0088)
function current_player() => byte(0x008C)
function trigger_win_game() => current_board() == 0x8B && current_player() == 0
achievement(
title = "Score!", description = "Win a game with at least 600 points", points = 25,
trigger = trigger_win_game() && byte(0x0573) >= 0xF6 // 0x0573 is hundreds place of score
)
First, a couple of helper functions are defined to make the code easier to read. Because all functions are inlined and evaluated on use, this expands to:
trigger = byte(0x0088) == 0x8B && byte(0x008C) == 0 && byte(0x0573) >= 0xF6