Instance Properties
Every single instance in the game falls under a specific category of instance. The main ones you will interact with are the Player, Items, Objects, Menu Objects, Menus, and Slots!
Each instance has a set of built-in properties that you can get/set with api_get_property() and api_set_property(). This page aims to list all the properties you may find useful.
Modding
Instance Properties
Player (ob_player)
The Player is a special instance of which there is only ever one. This is the Player instance that the player moves around, and it stores a lot of key information.
Property Key | Datatype | Description |
---|---|---|
x | integer | current player x position |
y | integer | current player y position |
spawn_x | integer | current player spawn x position (player will spawn here after drowning / going to devland / finishing the game) |
spawn_y | integer | current player y position (player will spawn here after drowning / going to devland / finishing the game) |
open | boolean | whether the player's inventory is open or closed |
hotbar | integer | current "equipped" slot index in the hotbar, starting from 0 |
dir | string | current direction the player is facing, either "left" or "right" |
walking | boolean | whether the player is currently walking / moving |
wading | boolean | whether the player is currently wading in shallow water |
sitting | boolean | whether the player is sitting on a bench |
sleeping | boolean | whether the player is sleeping (on a bench or a bed) |
soaking | boolean | whether the player is standing in shallow water |
sailing | boolean | whether the player is sailing on a boat (moving or not) |
sliding | boolean | whether the player is sliding on ice |
drowning | boolean | whether the player is "drowning" (stuck in deep water) |
name | string | the player's chosen name |
money | integer | the amount of Rubees the player has |
honeycore | integer | the amount of Honeycore the player has |
current_tile | string | the current tile OID under the player, i.e. "grass1" or "water2" etc |
buff | string | the current buff applied to the player, if any. This value will be the spice OID, i.e. "spice1". Setting this value directly will not trigger the buff notification. |
buff_time | integer | the amount of time left before the buff applied expires, if any |
boat | integer | the instance ID of the boat object if the player is sailing in a boat |
palette | table | the color palette for the player, which is a set of indices keys for hair, skin, overalls, undershirt, and hair. Changing these indices will not change the player colors. |
stats | table | the stats stored for the player (the ones shown in nan's bookcase!) |
unlocked_books | table | a boolean for each book to say whether its unlocked or not (making it show in the bottom bar) |
door_opened | whether the player has opened the Hivemother Door (spoilers!) |