Gameplay content
Venue programmes
Recurring sessions at particular buildings (a quiz night at this pub, not every pub), with booking, fees, cancellations and opening hours that follow them.
A programme is something that happens again and again at a venue: a board-game evening, a Sunday walk, a reading salon. Declare it as data and the game decides which buildings run it, lists it on their map card, lets the player book a session, charges the fee, and opens the building for it.
Declaring programmes
Programmes/*.ulprog in your mod:
luareturn {
{ id = "quiz_night", title = "Thursday quiz night", tags = { "pub", "bar" },
days = { 4 }, -- 0 = Sunday ... 6 = Saturday
start = 19, finish = 22, -- hours of the day
fee = 5, -- dollars, 0 for free
capacity = 0, -- 0 = no limit
share = 0.5, -- half the pubs and bars of the city run it
opens = true, -- the building opens for it, whatever its usual hours
exceptions = { "2026-12-24" } },
}
- Which buildings run it is decided from the building and the programme, so it is the same every time; at least one building per city always does. The map's location card lists a building's programmes with their next session.
opens = truekeeps an evening session from sitting in a closed building: the card says "Open now for a programme" and the player can enter.- Room layouts do not change for a programme yet.
From Lua
lualocal M = "ynl_Nightlife"
-- At the venue, when the session is on: pays the fee at the door unless booked.
local r = Programmes:attend(M, "quiz_night")
if not r.ok then return r.reason end -- "The programme is not on right now."
-- Ahead of time, from a page: the next session at a building that runs it.
local b = Programmes:where(M, "quiz_night")[1]
local n = Programmes:next(M, "quiz_night", b.id)
local booked = Programmes:book(M, "quiz_night", b.id, n.start) -- fee through the wallet, a plan in the agenda
- Booking checks the agenda first (no clash with the player's other plans), then takes the fee; if either fails nothing is taken. The booking is a plan in the agenda, with a reminder.
- Attending checks the player is in a building that runs it, during the session, and charges at the door only once entry is certain. Attending twice the same day is refused.
- Cancelling a session (
Programmes:cancel(mod, id, building, start, reason)) refunds whoever booked, cancels their plan and tells them. - Sessions' bookings, attendance and cancellations are saved.
| Call | Does |
|---|---|
Programmes:here() |
The programmes of the building the player is in, with their next session. |
Programmes:next(mod, id [, building [, fromHours]]) |
{ start, finish, date, cancelled, booked, attended, building } or nil. |
Programmes:where(mod, id) |
{ { id, name, tag } }: the buildings that run it. |
Programmes:book(mod, id, building, start) |
{ ok, reason, amount } |
Programmes:attend(mod, id) |
{ ok, reason, amount } |
Programmes:cancel(mod, id, building, start [, reason]) |
{ ok, reason, amount refunded } |
Programmes:version() |
The API version, 1. |
To show the player where a session is, open its building's card from your page with UI:openPlace(buildingId).