Cob Extensions - Unit position, health, cloak

Ext. ID Ext. Name Type Description Properties
29 CURRENT_SPEED GET/SET returns or sets current unit speed Recording (Setter)
100 UNITX GET unit X position  
101 UNITZ GET unit Z position  
102 UNITY GET unit Y position Recording (Setter)
103 TURNX GET/SET unit X turn value Recording (Setter)
104 TURNZ GET/SET unit Z turn value. Equivalent of ORIENTATION in TA:K Recording (Setter)
105 TURNY GET/SET unit Y turn value Recording (Setter)
106 UNIT_GRID_XZ GET    
107 HEALTH_VAL GET current unit exact health value (not percentage) -
108 MAKE_DAMAGE GET Make damage or heal any unit. This extension wraps native TA procedure that is used for making damage to units, including dmg done by weapons, unit reclaim, self destruct or even unit share
Parameters: DamageType, Amount, DamageGivingUnitID, DamageTakingUnitID

Damage types:
1 - weapon
2 - paralyzer
3 - self destruct. pass 30000 damage, unit giving : self, unit taking : self
4 - sharing unit. pass 30000 damage, unit giving : 0, taking : self
5 - reclaim
6 - unit death. pass 30000 damage
9 - unit dies in lab (also if being removed from plant queue). pass 30000 damage. unit giving : lab (builder), unit receiving : self
10 - healing other unit. can be "self to self"
11 - unkn
Recording
109 HEAL_UNIT GET heals target unit in native TA way (checks for player energy available etc. healer must have worker time set in UNITINFO)
Parameters: HealerUnitID, HealedUnitID
-
110 GET_CLOAKED GET returns cloak status of caller or unit given with parameter
Parameters: UnitID or none
-
111 SET_CLOAKED GET sets cloak status of caller or unit given with second parameter
Parameters: CloakStatus (0 or 1), UnitID
Recording
112 UNIT_BAS_STATE_MASK GET returns unit basic state mask (activated, cloaked, etc.)
Parameters: UnitID or none
-
113 UNIT_STATE_MASK GET returns unit state mask (selected, in move etc.)
Parameters: UnitID or none
-
114 SELECTABLE GET sets 'can this unit be selected by player' -
115 ATTACH_UNIT GET Attach, detach unit or get unit ID attached to PieceNr of TransporterID
CallType:
0 - detach unit
1 - attach unit
2 - get unit attached to PieceNr

Parameters: CallType, TransportedID, TransporterID, PieceNr
Recording
116 RANDOM_FREE_PIECE GET Iterates through pieces MinPieceNr to MaxPieceNr looking for a random free piece. Useful for multi air transporters to chose random piece where to attach loaded units.
Parameters: MinPieceNr, MaxPieceNr
-
117 CUSTOM_BAR_PROGRESS GET Overrides weapon reload bar position with user value
Parameters: Current, Max
-
118 MEX_RATIO GET/SET get or set metal extraction ratio for caller unit, multiply by 100 when setting, divide when getting -