World Management & Finders
Functions to build the map and locate objects within it.
Map Building
Booktasy.add_room(room)
Registers a room in the Booktasy.GAME_WORLD.
Usage:Booktasy.add_room(my_kitchen_var)
Booktasy.connect_rooms(from, dir, to, one_way)
Creates exits between two registered rooms.
Parameters:
from(string): Name of the source room.dir(string): Direction (e.g., "north", "up").to(string): Name of the destination room.one_way(boolean, optional): If false (default), automatically creates the reverse connection (e.g., "south" for "north").
Booktasy.edit_room(room_name, new_description)
Dynamically changes a room's description during gameplay.
Finder Functions
These utilities help locate objects within data structures.
Booktasy.find_entity_in_room(room, entity_name)
Returns the entity object or nil.
Booktasy.find_item_in_inventory(item_name)
Returns item, index or nil.
Booktasy.find_item_in_room(room, item_name)
Returns item, index or nil from the floor.
Booktasy.find_item_in_entity(entity, item_name)
Returns item, index or nil from an NPC's inventory.