User Tools

Site Tools


prpl:getunittype

<- PRPL reference <- Everything Else 2

GetUnitType

ArgumentsResultNotation
UID Type [ int - string ]

Description

Takes a unit UID and returns a string of the type of the corresponding unit. Useful for myriad things where you need only a certain type of unit. See also: List of unit types

Examples

CurrentCoords 10000 1 GetAllUnitsInRange ->MapUnits

<-MapUnits GetListCount 0 do
    <-MapUnits[I] ->Unit
    
    "Unit:" <-Unit "is" <-Unit GetUnitType
    
    <-Unit GetUnitIsEnemy if
        "(Enemy)"
    else
        "(Ally)"
    endif
    
    Trace5
loop
prpl/getunittype.txt · Last modified: 2017/06/24 23:02 by GoodMorning