Reference

Building API

Methods of building aliases, used by quests to place objectives.

A building alias is a global created by Game:generateBuildingAlias(name, venueTag), plus the always-present currentBuilding. See State and memory and Quests.

11/11 documented

Objectives

Building:addObjective(actionId)#

Offers a quest action (WHERE = { "quest" }) at this building.

YnlClub:addObjective("ynl_meet_dealer")
Building:hasObjective(actionId) → boolean#

Whether it is offered here.

Building:removeObjective(actionId)#

Stops offering it here.

Location

Building:getBuildingId() → string#

The one building this alias stands for, as "::". Picked at random among the city's buildings of the alias's type the first time the map is loaded, then fixed and saved. Empty until then. On currentBuilding, the building the player is in.

Building:getLocation() → text#

The venue tag the alias points to; empty if never generated.

Building:getName() → string#

The building's real name when it has one (an OSM pub name), else its venue type's name.

Building:isHere() → boolean#

The player is in this alias's building (any building of its type while it is not pinned yet).

Building:isSameBuilding(other) → boolean#

Both aliases point to the same building (the same pinned building once both are pinned, else the same venue type).

Building:isValid() → boolean#

The alias was generated.

Building:pinHere() → boolean#

Binds the alias to the building the player is in (and its type): "the bar we met in". False when the player is in no building.

Building:alias:pinTo(buildingId) → bool#

Binds the alias to any populated building of the city by id, not only the one the player stands in: an objective at the cemetery a dead person lies in.

local g = r:grave() if g then LprMy_grave:pinTo(g.building) end