-
Notifications
You must be signed in to change notification settings - Fork 0
realtime_player_properties
Player custom properties are per-player key/value data synced across the room. Set them on the local player (they are broadcast to everyone), and read the remote cached values of other players. Changes to any player's properties are delivered to photon_realtime_set_callback_player_properties_change.
Get and set the local player's custom properties:
- photon_realtime_player_properties_set_local_string
- photon_realtime_player_properties_set_local_i32
- photon_realtime_player_properties_set_local_f64
- photon_realtime_player_properties_set_local_bool
- photon_realtime_player_properties_remove_local
- photon_realtime_player_properties_clear_local
- photon_realtime_player_properties_has_local
- photon_realtime_player_properties_get_local_string
- photon_realtime_player_properties_get_local_i32
- photon_realtime_player_properties_get_local_f64
- photon_realtime_player_properties_get_local_bool
- photon_realtime_player_properties_to_string_local
- photon_realtime_player_properties_get_local_all
Read the cached custom properties of other players:
- photon_realtime_player_properties_has_remote
- photon_realtime_player_properties_get_remote_string
- photon_realtime_player_properties_get_remote_i32
- photon_realtime_player_properties_get_remote_f64
- photon_realtime_player_properties_get_remote_bool
- photon_realtime_player_properties_to_string_remote
- photon_realtime_player_properties_get_remote_all
Sets a string custom property on the local player and syncs it to the room. Other clients are notified via photon_realtime_set_callback_player_properties_change.
Syntax:
photon_realtime_player_properties_set_local_string(key, value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| value | String | The string value to set. |
Returns:
Whether the property was set.
Sets a 32-bit integer custom property on the local player and syncs it to the room.
Syntax:
photon_realtime_player_properties_set_local_i32(key, value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| value | Real | The integer value to set. |
Returns:
Whether the property was set.
Sets a 64-bit floating point custom property on the local player and syncs it to the room.
Syntax:
photon_realtime_player_properties_set_local_f64(key, value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| value | Real | The value to set. |
Returns:
Whether the property was set.
Sets a boolean custom property on the local player and syncs it to the room.
Syntax:
photon_realtime_player_properties_set_local_bool(key, value)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
| value | Boolean | The value to set. |
Returns:
Whether the property was set.
Removes a custom property from the local player.
Syntax:
photon_realtime_player_properties_remove_local(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key to remove. |
Returns:
Whether the property was removed.
Removes all custom properties from the local player.
Syntax:
photon_realtime_player_properties_clear_local()
Returns:
Whether the properties were cleared.
Returns whether the local player has a custom property with the given key.
Syntax:
photon_realtime_player_properties_has_local(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
Returns:
Whether the property exists.
Returns a string custom property of the local player.
Syntax:
photon_realtime_player_properties_get_local_string(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
Returns:
The property value.
Returns an integer custom property of the local player.
Syntax:
photon_realtime_player_properties_get_local_i32(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
Returns:
The property value.
Returns a floating point custom property of the local player.
Syntax:
photon_realtime_player_properties_get_local_f64(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
Returns:
The property value.
Returns a boolean custom property of the local player.
Syntax:
photon_realtime_player_properties_get_local_bool(key)
| Argument | Type | Description |
|---|---|---|
| key | String | The property key. |
Returns:
The property value.
Returns a human-readable string of all the local player's custom properties, useful for debugging.
Syntax:
photon_realtime_player_properties_to_string_local()
Returns:
A readable dump of the local properties.
Returns all of the local player's custom properties as a GML struct.
Syntax:
photon_realtime_player_properties_get_local_all()
Returns:
A struct of all local custom properties.
Returns whether the given player has a cached custom property with the given key.
Syntax:
photon_realtime_player_properties_has_remote(player_number, key)
| Argument | Type | Description |
|---|---|---|
| player_number | Real | The player number to query. |
| key | String | The property key. |
Returns:
Whether the property exists.
Returns a cached string custom property of the given player.
Syntax:
photon_realtime_player_properties_get_remote_string(player_number, key)
| Argument | Type | Description |
|---|---|---|
| player_number | Real | The player number to query. |
| key | String | The property key. |
Returns:
The property value.
Returns a cached integer custom property of the given player.
Syntax:
photon_realtime_player_properties_get_remote_i32(player_number, key)
| Argument | Type | Description |
|---|---|---|
| player_number | Real | The player number to query. |
| key | String | The property key. |
Returns:
The property value.
Returns a cached floating point custom property of the given player.
Syntax:
photon_realtime_player_properties_get_remote_f64(player_number, key)
| Argument | Type | Description |
|---|---|---|
| player_number | Real | The player number to query. |
| key | String | The property key. |
Returns:
The property value.
Returns a cached boolean custom property of the given player.
Syntax:
photon_realtime_player_properties_get_remote_bool(player_number, key)
| Argument | Type | Description |
|---|---|---|
| player_number | Real | The player number to query. |
| key | String | The property key. |
Returns:
The property value.
Returns a human-readable string of all the given player's cached custom properties, useful for debugging.
Syntax:
photon_realtime_player_properties_to_string_remote(player_number)
| Argument | Type | Description |
|---|---|---|
| player_number | Real | The player number to query. |
Returns:
A readable dump of the player's properties.
Returns all of the given player's cached custom properties as a GML struct.
Syntax:
photon_realtime_player_properties_get_remote_all(player_number)
| Argument | Type | Description |
|---|---|---|
| player_number | Real | The player number to query. |
Returns:
A struct of all the player's custom properties.
GameMaker 2026