player_vars:

Config file section

Valid in machine config files YES
Valid in mode config files NO

New in version 0.32.

The player_vars: section of your machine-wide config file lets you specify the initial state of player variables that are set for a player when the game starts.

Example:

#config_version=4

player_vars:
  some_var:
    initial_value: 4
  some_float:
    initial_value: 4
    value_type: float
  some_string:
    initial_value: 4
    value_type: str
  some_other_string:
    initial_value: hello
    value_type: str  # required for non-ints

machine_vars:
  test1:
    initial_value: 4
    value_type: int
  test2:
    initial_value: '5'
    value_type: str

# below is the min config we need to be able to start a game

game:
    balls_per_game: 3

coils:
    eject_coil1:
        number:
    eject_coil2:
        number:

switches:
    s_start:
        number:
        tags: start
    s_ball_switch1:
        number:
    s_ball_switch2:
        number:
    s_ball_switch_launcher:
        number:

ball_devices:
    bd_trough:
        eject_coil: eject_coil1
        ball_switches: s_ball_switch1, s_ball_switch2
        debug: true
        confirm_eject_type: target
        eject_targets: bd_launcher
        tags: trough, drain, home
    bd_launcher:
        eject_coil: eject_coil2
        ball_switches: s_ball_switch_launcher
        debug: true
        confirm_eject_type: target
        eject_timeouts: 2s
        tags: ball_add_live

Settings

Each subsection in the player_vars: section is the name of a player variable to set. Then there are two sub-settings under there:

initial_value: (required)

The initial value of this player variable that you’re setting. This is set when the player is created.

value_type:

Select one of the options from this list: int (integer), float, or str (string). The default is “int”, and there is no intelligence to try to detect which type of value you have, so if you have a floating point number or a string, you also need to set the value_type.