Instance Properties: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
No edit summary |
No edit summary |
||
Line 18: | Line 18: | ||
<h2>Player (ob_player)</h2> |
<h2>Player (ob_player)</h2> |
||
<p>The Player is a special instance of which there is only ever one.</p> |
<p>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.</p> |
||
{| class="wikitable |
{| class="wikitable |
||
! Property Key !! Description |
! Property Key !! Datatype !! Description |
||
|- |
|- |
||
| x || {{D|i=integer}} || current player x position |
|||
| acorn1 || tree acorns |
|||
|- |
|||
| y || {{D|i=integer}} || current player y position |
|||
|- |
|||
| open || {{D|i=boolean}} || whether the player's inventory is open or closed |
|||
|- |
|||
| hotbar || {{D|i=integer}} || current "equipped" slot index in the hotbar, starting from 0 |
|||
|- |
|||
| dir || {{D|i=string}} || current direction the player is facing, either "left" or "right" |
|||
|- |
|||
| walking || {{D|i=boolean}} || whether the player is currently walking / moving |
|||
|- |
|||
| wading || {{D|i=boolean}} || whether the player is currently wading in shallow water |
|||
|- |
|||
| sitting || {{D|i=boolean}} || whether the player is sitting on a bench |
|||
|- |
|||
| sleeping || {{D|i=boolean}} || whether the player is sleeping (on a bench or a bed) |
|||
|- |
|||
| soaking || {{D|i=boolean}} || whether the player is standing in shallow water |
|||
|- |
|||
| sailing || {{D|i=boolean}} || whether the player is sailing on a boat (moving or not) |
|||
|- |
|||
| drowning || {{D|i=boolean}} || whether the player is "drowning" (stuck in deep water) |
|||
|- |
|||
| name || {{D|i=string}} || the player's chosen name |
|||
|- |
|||
| money || {{D|i=integer}} || the amount of Rubees the player has |
|||
|- |
|||
| honeycore || {{D|i=integer}} || the amount of Honeycore the player has |
|||
|- |
|||
| current_tile || {{D|i=integer}} || the current tile [[OID OID_Reference]] under the player, i.e. "grass1" or "water2" etc |
|||
|} |
|} |
||
Revision as of 13:39, 6 November 2021
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 |
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) |
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 | integer | the current tile OID OID_Reference under the player, i.e. "grass1" or "water2" etc |