Skip to main content

Events

Every event of the town is an .event document of the project; together they are the catalog Kalem checks scripts against, and the one Play's Events panel sends from. The editor reads the catalog from the documents; it never finds events by running scripts.

The Design tab is the event's form:

Field
Labelthe event's name for people
Idtwo names with a dot between them, unique in the project: door.opened. Scripts handle it by this id: on door.opened.
ScopeSelf: the object it happens to; City: every subscriber
ProducerTest: Play's panels can send it too; Engine: only the game makes it
Payloadone card per field (↑ ↓, remove, Add Field below): Key (the name a script binds), Label, Type (Yes / No, Number, Text, Time of day), for numbers Integer, Min and Max, and the Default Play's test panel starts from

Changing a type resets the default; the bounds and Integer pull the default inside them.

Rules​

Problems that keep an event out of the catalog are written above the form:

  • the id's form, and another event of the project with the same id;
  • at most 16 payload fields, and each field's key;
  • the reserved keys type gameMinute sequence object changes;
  • a default of the wrong type or out of bounds.

The document's keys keep a fixed order.

Caria's events today​

EventScopeProducerPayload
city.powerChangedcitytestpowered
building.visitorEnteredselftest—
object.stateChangedselfenginechanges (added by the game)

object.stateChanged comes only from fields that were accepted and really changed; neither the screen nor a test can make it up. Events that do not come from a field's change will be sent by scripts (Roadmap).