Playfield Multipliers
recipe
multiplier
scoring
Playfield Multipliers
A playfield multiplier (2X, 3X, …) scales a swath of scoring at once. The trick is to keep the multiplier in a single variable and have every affected rule reference it, so raising the multiplier instantly boosts all of them.
A shared multiplier
Give several scoring rules the same multiplier variable. Each rule’s points are scaled by whatever that variable currently holds:
score "hardware" "ramps_multiplied" {
devices = ["left_ramp_entry", "right_ramp_entry"]
transition = "active"
points = 100
multiplier = "playfield_multiplier"
}
score "hardware" "bumpers_multiplied" {
tags = ["pop_bumpers"]
transition = "active"
points = 10
multiplier = "playfield_multiplier"
}Raising and resetting it
Drive the multiplier from gameplay — light it on a qualifying shot, drop it back at ball end:
event_handler "raise_multiplier" {
when = shot.multiplier_lane.complete
condition = var.playfield_multiplier < 3
actions {
increment = "playfield_multiplier"
}
}
event_handler "reset_multiplier" {
when = system.ball.end
actions {
set_variable {
name = "playfield_multiplier"
value = 1
}
}
}How it works
Because every rule reads the same variable, you change the multiplier in one place and the whole group follows. This pairs naturally with modes — a mode can raise the multiplier while it’s active and a score "modifier" can gate other bonuses on mode.<name>.active. See Organizing Modes into Modules.