This is an old revision of the document!
<- CRPL reference <- Unit Commands
| Arguments | Result | Notation | 
|---|---|---|
| Unit UID for current unit |  – i1 | 
Pushes the unique unit ID (an int) for the current unit to the stack.
Trace current unit's ID
Self Trace
If the unit's ammo is full, destroy it
Self CONST_AMMO GetUnitAttribute ->ammo
Self CONST_MAXAMMO GetUnitAttribute ->maxAmmo
<-ammo <-maxAmmo gte if
    Self CONST_DESTROYMODE GetUnitAttribute ->destroyMode
    
    Self <-destroyMode Destroy
endif
Creates a unit then tells it its creator's UID in the “myCreator” variable
"CRPLCORE" CurrentCoords CreateUnit ->unit <-unit "doThings.crpl" AddScriptToUnit <-unit "doThings.crpl" "myCreator" Self SetScriptVar