# .aectrl controllers

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

A controller is an aetext file. Unknown blocks, attributes and fields fail the import with [ANC006](/diagnostics.html#ANC006.md); names that do not resolve give [ANC001](/diagnostics.html#ANC001.md) and [ANC002](/diagnostics.html#ANC002.md).

    controller version=1 entryPos=[-176, 0] anyPos=[-176, 110] {
      entry="Idle"
      param "Speed" kind=float {}
      param "Attack" kind=trigger {}
      state "Idle" clip=asset("a0a10000000000000000000000000001") pos=[0, 0] {}
      state "Run" clip=asset("a0a10000000000000000000000000002") speed=1.2 pos=[220, 0] {}
      transition "Idle" to="Run" duration=0.1 {
        cond "Speed" op=gt value=0.1 {}
      }
      transition "any" to="Hit" interrupt=true {
        cond "Attack" {}
      }
    }

## controller

| Attribute | Meaning |
|---|---|
| `version` | text version, 1 |
| `ease` | easing of blends, `inOutQuad` by default |
| `entryPos` | `[x, y]` of the Entry pill in the Animator panel |
| `anyPos` | `[x, y]` of the Any State pill in the Animator panel |

| Field | Meaning |
|---|---|
| `entry` | the state the Animator starts in, the first state when left out |

It holds `param`, `state` and `transition` blocks. `pos`, `entryPos` and `anyPos` are for the editor only: the runtime ignores them, and the panel lays out what has no position.

## param

The label is the name.

| Attribute | Meaning |
|---|---|
| `kind` | `bool`, `int`, `float` or `trigger`, required |
| `default` | starting value; triggers have none |

## state

The label is the name; `any` is reserved.

| Attribute | Meaning |
|---|---|
| `clip` | the clip asset |
| `speed` | playback speed, 1 by default |
| `loop` | overrides the clip's loop mode |
| `pos` | `[x, y]` of the box in the Animator panel |
| `events` | during a blend: `dominant` (default), `both` or `incoming` |

## transition

The label is the source state, or `any`. Transitions are tried in file order.

| Attribute | Meaning |
|---|---|
| `to` | target state, required |
| `duration` | blend time in seconds |
| `exitTime` | passes of the state's clip that must have played; 1 is one pass |
| `interrupt` | may cut a running blend |

It holds `cond` blocks only; all must hold.

## cond

The label is the parameter.

| Attribute | Meaning |
|---|---|
| `op` | `set`, `eq`, `ne`, `gt`, `ge`, `lt` or `le`; triggers use `set` |
| `value` | a number or `true`/`false`; required except for `set` |
