# set_type

Area: Annotate. Safety: writes; dry-run unless dry_run=false.

Define a user type and/or apply one: at a data global, `type` types it (a `Player *` names the fields read through it, an enum the constants compared with it); at a function, `type` is its C prototype, or with `var` (a1, local_58) names/types that variable; `type` alone defines C structs. Dry-run unless dry_run=false.

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `address` | string | no | Data global to type, or a function for a prototype or `var`. |
| `dry_run` | boolean | no | Preview only; false applies. |
| `fields` | array | no | The struct's fields, each `offset:name:type` (`0x1c:mp:u32`). |
| `name` | string | no | Name to define (struct/enum/typedef with `fields`/`values`/`type`), or `var`'s new name. |
| `size` | integer | no | Size past the last field, or an enum's width (4 or 8). |
| `type` | string | no | The type to apply, a typedef's target (`Player *`), a prototype (`int f(Player *p)`), or alone C declarations (struct/enum/typedef, #pragma pack, `// @0x10` offset asserts). |
| `values` | array | no | The enum's values, each `name:value` (`Run:1`); width 4 by default. |
| `var` | string | no | Variable of the function at `address` to name/type (`a1`, `local_58`). |

## Call

```json
{
  "name": "set_type",
  "arguments": {}
}
```
