Skip to content

title: player(name)

player(name)

This is an MPF Event

The content on this page is technical documentation for an MPF Event.

Posted when simpler types of player variables are added or change value.

The actual event has (var_name) replaced with the name of the player variable that changed. Some examples:

  • player_score
  • player_shot_upper_lit_hit

Lots of things are stored in player variables, so there's no way to build a complete list of what all the options are here. Elsewhere in the documentation, if you see something that says it's stored in a player variable, that means you'll get this event when that player variable is created or is changed.

Note that this event is only posted for simpler types of player variables, including player variables that are integers, floating point numbers, or strings. More complex player variables (lists, dicts, etc.) do not get this event posted.

This event is posted for a single player variable changing, meaning if multiple player variables change at the same time, multiple events will be posted, one for each change.

Keyword arguments

(See the Conditional Events guide for details for how to create entries in your config file that only respond to certain combinations of the arguments below.)

change

: If the player variable just changed, this will be the amount of the change. If it's not possible to determine a numeric change (for example, if this player variable is a string), then this change value will be set to the boolean True.

kwargs

: Additional keyword arguments to include in the event args.

player_num

: The player number this variable just changed for, starting with 1. (e.g. Player 1 will have player_num=1, Player 4 will have player_num=4, etc.)

prev_value

: The previous value of this player variable, e.g. what it was before the current value.

value

: The new value of this player variable.

Event is posted by player_vars:


Something missing or wrong? You can fix it!

This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?

Please help us! You can fix it yourself and be an official "open source" contributor!

It's easy! See our Beginner's guide to editing the docs.

Page navigation via the keyboard: < >

You can navigate this site via the keyboard. There are two modes:

General navigation, when search is not focused:

  • F , S , / : open search dialog
  • P , , : go to previous page
  • N , . : go to next page

While using the search function:

  • Down , Up : select next / previous result
  • Esc , Tab : close search
  • Enter : go to highlighted page in the results