-
Notifications
You must be signed in to change notification settings - Fork 11
Built in Functions
Defines the clause "1==1". It is typically only used to move a PauseIf/ResetIf to an alt group:
byte(0x1234) == 8 && (always_true() || (never(byte(0x2345) == 12) && unless(byte(0x3456) == 6)))
This allows the achievement (core group) to trigger while the never
is paused by the unless
.
Defines the clause "0==1". It is typically used for constructing alt chains, as a variable must have an initial value:
trigger = always_false()
for test in tests
trigger = trigger || test
achievement(..., trigger = trigger)
If more than two alt groups exist, the always_false
group will be removed from the final achievement code
Builds a string by inserting parameters
into placeholders in the format_string
.
For example:
stage_names = {
1: "Downtown"
}
stage_1_label = format("Stage {0} - {1}", 1, stage_names[1])
Would set stage_1_label
to "Stage 1 - Downtown"
Returns the number of elements in a dictionary or array, or the number of characters in a string.
Returns an array containing integers starting at start
and continuing until stop
.
If step
is specified, the second item will be start+step
, the third will be start+step*2
, and so on until a value greater than stop
would be generated. That value will be ignored.
Returns an array generated by processing each item in inputs
through predicate
.
inputs
is an array or a dictionary. If a dictionary is provided, the keys will be passed to the predicate
.
predicate
is a function that accepts a single input and returns an expression or constant constructed from that input. The expressions returned by predicate
are stored in the new array that is returned by array_map
.
Returns an expression that will evaluate true if any of the inputs
matches the predicate
.
inputs
is an array or a dictionary. If a dictionary is provided, the keys will be passed to the predicate
.
predicate
is a function that accepts a single input and returns an expression constructed from that input. The expressions returned by predicate
are joined with ||
s.
Returns an expression that will evaluate true if all of the inputs
matches the predicate
.
inputs
is an array or a dictionary. If a dictionary is provided, the keys will be passed to the predicate
.
predicate
is a function that accepts a single input and returns an expression constructed from that input. The expressions returned by predicate
are joined with &&
s.
Returns an expression that will evaluate true if all of the inputs
do not match the predicate
.
inputs
is an array or a dictionary. If a dictionary is provided, the keys will be passed to the predicate
.
predicate
is a function that accepts a single input and returns an expression constructed from that input. The expressions returned by predicate
are negated (!
) and then joined with &&
s.
Returns an expression that will calculate the sum of the inputs
modified by the predicate
.
inputs
is an array or a dictionary. If a dictionary is provided, the keys will be passed to the predicate
.
predicate
is a function that accepts a single input and returns an expression constructed from that input. The expressions returned by predicate
are added together with +
.
Returns a tally
expression where each comparison is generated by running the inputs
through the predicate
.
inputs
is an array or a dictionary. If a dictionary is provided, the keys will be passed to the predicate
.
predicate
is a function that accepts a single input and returns an expression constructed from that input. The expressions returned by predicate
are used in the tally
expression.