-
Notifications
You must be signed in to change notification settings - Fork 57
Definitions
Definitions are collections of data stored in the game Cache, they often store data about a specific Entity, Interface or other game engine system.
Tip
You can find the full list of definitions in ./engine/data/definition/
Definitions can be accessed from anywhere using the format:
ItemDefinitions.get(itemId)Or in functions using the old injection method:
val itemDefinitions: ItemDefinitions = get()Void goes beyond standard definitions and links TOML configuration files to each definition making it easy to define String Identifiers and additional data.
Anything added to an npc beyond the integer id is added to the respective definitions.extras map where they can later be accessed in a similar way to Variables.
[hans]
id = 0
wander_radius = 4
categories = ["human"]
examine = "Servant of the Duke of Lumbridge."val race = npc.def["race", ""] // Get or default return empty string
val examine: String = npc.def["examine"] // Get unsafe with type
val radius: Int? = npc.def.getOrNull("wander_radius") // Get if exists else return null valueNote
This applies to all definitions, .objs.toml -> ObjectDefinition, .ifaces.toml -. InterfaceDefinition, fonts.toml -> FontDefinition, etc...