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 | |
|---|---|
| Label | the event's name for people |
| Id | two names with a dot between them, unique in the project: door.opened. Scripts handle it by this id: on door.opened. |
| Scope | Self: the object it happens to; City: every subscriber |
| Producer | Test: Play's panels can send it too; Engine: only the game makes it |
| Payload | one 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
| Event | Scope | Producer | Payload |
|---|---|---|---|
city.powerChanged | city | test | powered |
building.visitorEntered | self | test | — |
object.stateChanged | self | engine | changes (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).