This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
crpl:docs:getunitattribute [2013/09/01 21:35] – Minor editorial changes Grauniad | crpl:docs:getunitattribute [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ~~DISCUSSION~~ | ||
<- [[crpl: | <- [[crpl: | ||
===== GetUnitAttribute | ===== GetUnitAttribute | ||
Line 8: | Line 7: | ||
=== Description === | === Description === | ||
- | GetUnitAtrribute | + | GetUnitAttribute |
+ | |||
+ | ====Unit Constants ==== | ||
The constant must be one of the following: | The constant must be one of the following: | ||
- | ^Command^Desc^ | + | ^Command^Description^Value^ |
- | |CONST_COORDX| The x coordinate of the unit. | | + | | CONST_ACPACKETREQUESTDELAY |
- | |CONST_COORDY| The y coordinate of the unit. | | + | | CONST_AMMO | The unit's ammo. Floating point value. |17| |
- | |CONST_ISDESTROYED| If the unit is destroyed. | + | | CONST_AMMOAC | The unit's AntiCreeper ammo. Floating point value. |
- | |CONST_ISLANDED| If the unit is landed. | + | | CONST_BEAMTARGET |
- | |CONST_HEALTH| The unit's health. | + | | CONST_BUILDCOST |
- | |CONST_MAXHEALTH| The unit's max health. | + | | CONST_CANREQUESTAMMO |
- | |CONST_AMMO| The unit's ammo. Floating point value.| | + | | CONST_CELLHEIGHT |
- | |CONST_MAXAMMO| The unit's max ammo. Floating point value.| | + | | CONST_CELLWIDTH |
- | |CONST_AMMOAC| The unit's AntiCreeper ammo. Floating point value.| | + | | CONST_CONNECTABLE |
- | |CONST_MAXAMMOAC|The unit's max AntiCreeper ammo. Floating point value.| | + | | CONST_COORDX |
- | |CONST_CREATEPZ| Whether | + | | CONST_COORDY |
- | |CONST_TAKEMAPSPACE| Whether the CrplTower consumes space on the map (preventing other units from stacking). Only works for CRPLTowers.| | + | | CONST_COUNTSFORVICTORY |
- | |CONST_CELLWIDTH| The width of space that the unit takes. | + | | CONST_CREATEPZ |
- | |CONST_CELLHEIGHT| The width of space that the unit takes. | + | | 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. |34| |
- | |CONST_SUPPORTSDIGITALIS| Whether | + | | CONST_DESTROYONDAMAGE |
- | |CONST_COUNTSFORVICTORY| Whether | + | | CONST_HEALRATE | The Heal Rate of a unit. 0.001 is the default. This is the amount of health that is added per frame |14| |
- | |CONST_NULLIFIERDAMAGES| Whether | + | | CONST_HEALTH | The unit's health. Floating point value. |15| |
- | |CONST_SNIPERTARGET| Whether the CrplTower | + | | CONST_ISBUILDING | If the unit is in build mode (requests build packets). |
- | |CONST_THORTARGET| Whether the CrplTower | + | | CONST_ISDESTROYED | If the unit is destroyed. Can only be read, not set. |12| |
- | |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_ISLANDED | If the unit is landed. Can only be read, not set. Only ever not true for units that can move. |13| |
- | |CONST_PIXELCOORDX| The X coordinate of the unit on the screen (pixels)| | + | | CONST_MAXAMMO |
- | |CONST_PIXELCOORDY| The Y coordinate of the unit on the screen (pixels)| | + | | CONST_MAXAMMOAC | The unit's max AntiCreeper ammo. Floating point value. |10| |
- | |CONST_HEALRATE| The Heal Rate of a unit. 0.001 is the default. | + | | CONST_MAXHEALTH | The unit's max health. Floating point value. |16| |
- | |CONST_ISBUILDING| If the unit is in build mode (requests build packets). | + | | CONST_NULLIFIERDAMAGEAMT | Set the amount of damage that a nullifier does to a unit. The default for nullifierdamageamt is 0. This means that the unit should be destroyed (the normal and default behavior). 0.1, for instance, does 0.1 damage to a unit rather than destroying |
- | |CONST_BUILDCOST| How many packets | + | | CONST_NULLIFIERDAMAGES | Whether the CrplTower can be targeted and damaged by Nullifiers. |
- | |CONST_CONNECTABLE| If the unit can connect to the player' | + | | CONST_PACKETREQUESTDELAY |
- | |CONST_REQUESTPACKETS| If the unit can request packets. Only works for CRPLTowers.| | + | | CONST_PIXELCOORDX | The X coordinate of the unit on the screen (pixels) |2| |
- | |CONST_REQUESTACPACKETS| If the unit can request | + | | CONST_PIXELCOORDY | The Y coordinate of the unit on the screen (pixels) |3| |
- | |CONST_PACKETREQUESTDELAY| The delay between packet requests for the unit. Only works for CRPLTowers.| | + | | CONST_REQUESTACPACKETS |
- | |CONST_ACPACKETREQUESTDELAY| The delay between AC packet requests for the unit. Only works for CRPLTowers.| | + | | CONST_REQUESTPACKETS |
- | |CONST_CANREQUESTAMMO| Whether the unit can request Ammo packets. Only works for CRPLTowers.| | + | | CONST_SHOWAMMOACBAR |
- | |CONST_DESTROYONDAMAGE| Whether the unit should | + | | CONST_SHOWAMMOBAR |
+ | | CONST_SHOWHEALTHBAR | ||
+ | | CONST_SNIPERTARGET | Whether the CrplTower | ||
+ | | CONST_SNIPERIGNORELOS | (1.66) On a unit that is targeted by snipers, whether or not the snipers ignore terrain heights when firing. i.e. The unit is "above the terrain" | ||
+ | | CONST_SUPPORTSDIGITALIS | ||
+ | | CONST_TAKEMAPSPACE | Whether the CrplTower consumes space on the map (preventing other units from stacking). Only works for CRPLTowers. |23| | ||
+ | | CONST_THORTARGET | Whether the CrplTower can be targeted and damaged by Thor main cannons. Only works for CRPLTowers. |33| | ||
- | === Examples === | + | |
+ | ==== Examples | ||
< | < | ||
# Get the max AC ammo of the current unit. | # Get the max AC ammo of the current unit. | ||
Self CONST_MAXAMMOAC GetUnitAttribute trace | Self CONST_MAXAMMOAC GetUnitAttribute trace | ||
</ | </ | ||
+ | < | ||
+ | # Show all attributes for a freshly-built CRPL core, or any unit. | ||
+ | once | ||
+ | ShowTraceLog | ||
+ | ClearTraceLog | ||
+ | Trace(" | ||
+ | @TraceUnitAttributes(Self) # can pass any unit ID, not just Self. | ||
+ | endonce | ||
+ | |||
+ | : | ||
+ | ->UnitID | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | Trace2(GetUnitAttribute(< | ||
+ | </ |