This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| crpl:docs:self [2013/01/14 19:11] – external edit 127.0.0.1 | crpl:docs:self [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | <- [[crpl: | ||
| ===== Self ===== | ===== Self ===== | ||
| ^Arguments^Result^Notation^ | ^Arguments^Result^Notation^ | ||
| - | | |Unit UID for current unit ||| FIXME ||| | + | | |Unit UID for current unit | '' |
| Line 9: | Line 10: | ||
| Pushes the unique unit ID (an int) for the current unit to the stack. | Pushes the unique unit ID (an int) for the current unit to the stack. | ||
| === Examples === | === 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 " | ||
| + | </ | ||