This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| crpl:docs:self [2013/01/14 18:59] – created chani | crpl:docs:self [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | TODO | + | |
| + | <- [[crpl: | ||
| + | ===== Self ===== | ||
| + | |||
| + | ^Arguments^Result^Notation^ | ||
| + | | |Unit UID for current unit | '' | ||
| + | |||
| + | |||
| + | === Description === | ||
| + | Pushes the unique unit ID (an int) for the current unit to the stack. | ||
| + | === Examples === | ||
| + | Trace current unit's ID | ||
| + | < | ||
| + | If the unit's ammo is full, destroy it | ||
| + | < | ||
| + | Self CONST_AMMO GetUnitAttribute ->ammo | ||
| + | Self CONST_MAXAMMO GetUnitAttribute -> | ||
| + | |||
| + | <-ammo < | ||
| + | Self CONST_DESTROYMODE GetUnitAttribute -> | ||
| + | |||
| + | Self < | ||
| + | endif | ||
| + | </ | ||
| + | Creates a unit then tells it its creator' | ||
| + | < | ||
| + | " | ||
| + | <-unit " | ||
| + | <-unit " | ||
| + | </ | ||