5. Values and types
| Type | Example | Use |
|---|---|---|
| integer | 5 | Whole counts, indices, slots |
| number | 2.5 | Seconds, speeds, measurements |
| text | "Archive Key" | Speech, IDs, entered text |
| boolean | true, false | A yes/no puzzle fact |
| null | null | No value / not found |
| array | ["key", "note"] | Ordered values |
| dictionary | {"open": false} | Named values |
| vector2 | vector2(10, 20) | Two coordinates |
| vector3 | vector3(2, 0, -1) | 3D coordinates |
| color | color("#88bbff") | A color value |
| record | characters.elias | A live reference to a project record |
function run()
let count: integer = 3
let delay: number = 0.5
let title: text = "Parts tray"
let ready: boolean = true
let items: array = ["key", "note"]
return type_of(items)
endType annotations are optional, but useful on public functions. A typed declaration can catch the accidental text "3" where you intended the number 3. Use str(), integer(), number() and boolean() when you intend a conversion. Do not expect boolean("false") to parse an English answer: compare the entered text with "true" or "yes" yourself.
