Instance Properties

From APICO Wiki
Revision as of 13:39, 6 November 2021 by Ellraiser (talk | contribs)
Jump to navigation Jump to search

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 Reference under the player, i.e. "grass1" or "water2" etc