# Events

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

Events are declared in Project Settings → Animation, or in `project.aego`:

    animation {
      event "Hit" payload=float {}
      event "Footstep" {}
    }

`Footstep` and `Hit` (payload `float`) are declared by the engine for its built-in clips; a project may use them without declaring them.

An event in a clip has a mode:

| Mode | When it runs |
|---|---|
| `gameplay` (default) | on the fixed step that crosses it, once per cycle, the same on every replay |
| `presentation` | when the drawn time crosses it; for sounds and effects; not during a replay |
| `preview` | only in the editor's preview |

The scripts of the player's node get `OnAnimEvent(id int, payload float)`, and the player emits its `Event(id, payload)` signal. An event at time 0 runs when the clip starts and on every new cycle; an event at the end runs once per cycle. A step that covers several cycles runs each event once per cycle, in order. `Seek` fires nothing.
