User Tools

Site Tools


crpl:docs:getunitattribute

This is an old revision of the document!


~~DISCUSSION~~ <- CRPL reference <- Unit Commands

GetUnitAttribute

Arguments Result Notation
Unit UID, Attribute ConstantThe resulting value for the attribute i1 i2 -- n1

Description

GetUnitAtrribute allows you to query various attributes on different units.

Unit Constants

The constant must be one of the following:

CommandDesc
CONST_COORDX The x coordinate of the unit.
CONST_COORDY The y coordinate of the unit.
CONST_ISDESTROYED If the unit is destroyed. Can only be read, not set.
CONST_ISLANDED If the unit is landed. Can only be read, not set. Only ever not true for units that can move.
CONST_HEALTH The unit's health. Floating point value.
CONST_MAXHEALTH The unit's max health. Floating point value.
CONST_AMMO The unit's ammo. Floating point value.
CONST_MAXAMMO The unit's max ammo. Floating point value.
CONST_AMMOAC The unit's AntiCreeper ammo. Floating point value.
CONST_MAXAMMOACThe unit's max AntiCreeper ammo. Floating point value.
CONST_CREATEPZ Whether the CrplTower creates a power zone when destroyed. Only works for CRPLTowers.
CONST_TAKEMAPSPACE Whether the CrplTower consumes space on the map (preventing other units from stacking). Only works for CRPLTowers.
CONST_CELLWIDTH The width of space that the unit takes. Only worls for CRPLTowers.
CONST_CELLHEIGHT The width of space that the unit takes. Only worls for CRPLTowers.
CONST_SUPPORTSDIGITALIS Whether the CrplTower supports the growth of Digitalis. Does not mean that the unit seeds Digitalis, only that it keeps it alive. Only works for CRPLTowers.
CONST_COUNTSFORVICTORY Whether the CrplTower must be destroyed before map victory on annihilation game modes. Only works for CRPLTowers.
CONST_NULLIFIERDAMAGES Whether the CrplTower can be targeted and damaged by Nullifiers. Only works for CRPLTowers.
CONST_SNIPERTARGET Whether the CrplTower can be targeted and damaged by Snipers. Only works for CRPLTowers.
CONST_THORTARGET Whether the CrplTower can be targeted and damaged by Thor main cannons. Only works for CRPLTowers.
CONST_DESTROYMODE Effect to play when CrplTower is destroyed. Only works for CRPLTowers. -1 means Default, 0 means none, 1 means flash with no sound, 2 means explosion with sound, 3 means explosion with no sound.
CONST_PIXELCOORDX The X coordinate of the unit on the screen (pixels)
CONST_PIXELCOORDY The Y coordinate of the unit on the screen (pixels)
CONST_HEALRATE The Heal Rate of a unit. 0.001 is the default. This is the amount of health that is added per frame
CONST_ISBUILDING If the unit is in build mode (requests build packets). Only settable for CRPLTowers.
CONST_BUILDCOST How many packets it takes to build the unit. Only works for CRPLTowers.
CONST_CONNECTABLE If the unit can connect to the player's network grid. Only works for CRPLTowers.
CONST_REQUESTPACKETS If the unit can request packets. Only works for CRPLTowers.
CONST_REQUESTACPACKETS If the unit can request AC packets. Only works for CRPLTowers.
CONST_PACKETREQUESTDELAY The delay between packet requests for the unit. Only works for CRPLTowers.
CONST_ACPACKETREQUESTDELAY The delay between AC packet requests for the unit. Only works for CRPLTowers.
CONST_CANREQUESTAMMO Whether the unit can request Ammo packets. Only works for CRPLTowers.
CONST_DESTROYONDAMAGE Whether the unit should be destroyed if its health reaches zero due to enemy fire.

Examples

# Get the max AC ammo of the current unit.
 Self CONST_MAXAMMOAC GetUnitAttribute trace
crpl/docs/getunitattribute.1378071468.txt.gz · Last modified: 2025/02/14 14:56 (external edit)