Cob Extensions - UNITINFO properties (experimental)

Ext. ID Ext. Name Type Description Properties
220 GRANT_UNITINFO SET Clones global template (aka unit info) of unit, allowing modifications on it for this specific (caller) unit. Check field types list to understand what's stored in unit info. Do not call it before unit construction is finished Network
221 GET_UNITINFO GET Returns unit info field value of caller or unit with ID given as second parameter. This extension doesn't require unit to have granted unit info, and is safe to be used at any time
Parameters: UnitInfoField, UnitID or none
Network
222 SET_UNITINFO GET Sets unit info field for caller unit. For most field types - granted unit info is a requirement. Set InvertSign to 1 to invert sign of new value
Parameters: UnitInfoField, NewValue, InvertSign
Network
223 UNIT_TYPE_LIMIT SET   -
224 GUI_INDEX SET   -
225 MOBILE_PLANT SET bmcode=1 plants will be able to build -

Definitions can be found in exptype.h file

UnitInfoField Name Description
1 EnergyStorage GET/SET
2 EnergyMake GET/SET - multiply given value by 100 before setting, divide by 100 after getting
3 EnergyUse GET/SET - multiply given value by 100 before setting, divide by 100 after getting
4 MetalStorage GET/SET
5 MetalMake GET/SET - multiply given value by 100 before setting, divide by 100 after getting
6 MetalUse GET/SET - multiply given value by 100 before setting, divide by 100 after getting
7 TidalGenerator GET/SET - multiply given value by 100 before setting, divide by 100 after getting
8 WindGenerator GET/SET - multiply given value by 100 before setting, divide by 100 after getting
9 MakesMetal GET/SET
10 BuildCostEnergy GET
11 BuildCostMetal GET
12 BuildTime GET
13 CloakCost GET/SET - multiply given value by 100 before setting, divide by 100 after getting
14 CloakCostMoving GET/SET - multiply given value by 100 before setting, divide by 100 after getting
18 Acceleration GET/SET - multiply given value by 100 before setting, divide by 100 after getting
19 BrakeRate GET/SET - multiply given value by 100 before setting, divide by 100 after getting
20 BankScale GET/SET
21 TurnRate GET/SET
22 CruiseAlt GET/SET
23 MaxSlope GET/SET
24 MaxVelocity GET/SET
25 MinWaterDepth GET/SET
26 MaxWaterDepth GET/SET
27 MaxWaterSlope GET/SET
28 WaterLine GET/SET
29 ManeuverLeashLength GET/SET
30 AttackRunLength GET/SET
31 HoverAttack GET/SET
32 Upright GET/SET
33 CanFly GET/SET
34 CanHover GET/SET
35 Amphibious GET/SET
36 Floater GET/SET
37 MovementClass_Safe SET - Given value is index of movement class from moveinfo.tdf
38 MovementClass SET -
40 MaxDamage GET/SET
41 DamageModifier GET/SET
42 HideDamage GET/SET
43 HealTime GET/SET
44 BMcode GET/SET
45 FootprintX GET
46 FootprintZ GET
47 BuildDistance GET/SET
48 Builder GET/SET
49 WorkerTime GET/SET
51 SightDistance GET/SET
52 SonarDistance GET/SET
53 SonarDistanceJam GET/SET
54 RadarDistance GET/SET
55 RadarDistanceJam GET/SET
56 Kamikaze GET/SET
57 KamikazeDistance GET/SET
58 MinCloakDistance GET/SET
59 ShieldRange GET/SET
63 OnOffable GET/SET
64 Commander GET/SET
65 TransportCapacity GET/SET
66 TransportSize GET/SET
67 CantBeTransported GET/SET
68 IsAirBase GET/SET
69 IsTargetingUpgrade GET/SET
70 Teleporter GET/SET
71 Digger GET/SET
72 Stealth GET/SET
73 ImmuneToParalyzer GET/SET
74 HasWeapons GET/SET
75 AntiWeapons GET/SET
81 CanStop GET/SET
82 CanAttack GET/SET
83 CanGuard GET/SET
84 CanPatrol GET/SET
85 CanMove GET/SET
86 CanLoad GET/SET
87 CanReclamate GET/SET
88 CanResurrect GET/SET
89 CanCapture GET/SET
90 CanDgun GET/SET
94 ExplodeAs SET
95 SelfDestructAs SET
96 SoundCategory SET
97 IsFeature GET
98 ShowPlayerName GET/SET