States are queried in a form States.STATE_NAME(STATE_PARAMETERS)
like so:
if States.StatPlayerCount > 5 then
unitCnt := States.StatUnitCount(1);
Version column description:
"-" Means this state was added from the start.
"5678" Means this state was introduced in revision 5678.
"-5678" Means this state was removed in revision 5678.
- CampaignMissionCount
- CampaignMissionWon
- EntityType
- FogRevealed
- GameTime
- GroupAt
- GroupColumnCount
- GroupDead
- GroupIsIdle
- GroupMember
- GroupMemberCount
- GroupOwner
- HouseAt
- HouseDamage
- HouseDeliveryBlocked
- HouseDestroyed
- HouseHasOccupant
- HouseHasWorker
- HouseIsComplete
- HouseOwner
- HousePositionX
- HousePositionY
- HouseRepair
- HouseTrainQueuePeek
- HouseType
- HouseWareBlock
- HouseWareInside
- HouseWaresBlock
- HouseWeaponsOrdered
- HouseWoodcutterChopOnly
- IsFieldAt
- IsOrchardAt
- IsRoadAt
- PeaceTime
- PlayerAllianceCheck
- PlayerColorText
- PlayerDefeated
- PlayerEnabled
- PlayerFogRevealed
- PlayerGetAllGroups
- PlayerGetAllHouses
- PlayerGetAllRoads
- PlayerGetAllUnits
- PlayerHouseBlocked
- PlayerHouseCanBuild
- PlayerHouseGranted
- PlayerIsNeutral
- PlayerName
- PlayerVictorious
- PlayerWareDistribution
- StatArmyCount
- StatCitizenCount
- StatHouseTypeCount
- StatPlayerCount
- StatUnitCount
- StatUnitKilledCount
- StatUnitLostCount
- StatUnitTypeCount
- StatWaresBalance
- StatWaresProduced
- StatWaresProducedValue
- SysRandom
- SysRandomI
- UnitAt
- UnitCarryCount
- UnitCarryType
- UnitDead
- UnitDirection
- UnitGroup
- UnitHunger
- UnitHungerLow
- UnitHungerMax
- UnitOwner
- UnitPositionX
- UnitPositionY
- UnitType
Ver sion |
State description | Parameters and types |
Returns |
---|---|---|---|
8721 | CampaignMissionCount Get total number of missions in the current campaign. Campaign-only action! |
Integer | |
8723 | CampaignMissionWon See if the mission was won. Campaign-only action! |
aMission: Integer; //mission index to check | Boolean |
7969 | EntityType Get the entity type by its UID (0 - unknown or none, 1 - Unit, 2 - House, 3 - UnitGroup, 4 - Stockpile) |
aEntityID: Integer; | Integer |
-8743 | FogRevealed ❌ Removed Method was removed, use PlayerFogRevealed instead |
aPlayer: Integer; aX: Word; aY: Word; |
Boolean |
- | GameTime Deprecated. Please use the time provided by OnTick event |
Cardinal | |
- | GroupAt Return UID of a group at requested coordinates |
aX: Word; aY: Word; |
Integer |
- | GroupColumnCount | aGroupID: Integer; | Integer |
- | GroupDead See if the group is dead (all members are dead) |
aGroupID: Integer; | Boolean |
5632 | GroupIsIdle See if the group is idle (ready to take orders) |
aGroupID: Integer; | Boolean |
- | GroupMember Get N-th group member |
aGroupID: Integer; aMemberIndex: Integer; |
Integer |
- | GroupMemberCount Returns how many member there are in this group |
aGroupID: Integer; | Integer |
- | GroupOwner Returns to which Hand this group belongs |
aGroupID: Integer; | Integer |
- | HouseAt Get the house at coordinates |
aX: Word; aY: Word; |
Integer |
- | HouseDamage Check house damage |
aHouseID: Integer; | Integer |
-7015 | HouseDeliveryBlocked ❌ Removed Method was removed, use HouseWareBlock instead |
aHouseID: Integer; aWareType: TKMWareType; |
Boolean |
- | HouseDestroyed | aHouseID: Integer; | Boolean |
-6102 | HouseHasOccupant ❌ Removed Method was removed, use HouseHasWorker instead |
aHouseID: Integer; | |
6102 | HouseHasWorker Check if the house has a worker assigned to it |
aHouseID: Integer; | Boolean |
- | HouseIsComplete Check if house is complete |
aHouseID: Integer; | Boolean |
- | HouseOwner See to which player the house belongs |
aHouseID: Integer; | Integer |
- | HousePositionX | aHouseID: Integer; | Integer |
- | HousePositionY | aHouseID: Integer; | Integer |
- | HouseRepair Check if house repair is enabled |
aHouseID: Integer; | Boolean |
4820 | HouseTrainQueuePeek Get the unit type in the houses training queue (School/Fort/Barracks) |
aHouseID: Integer; QueueIndex: Integer; |
TKMUnitType |
- | HouseType Get the house type |
aHouseID: Integer; | TKMHouseType |
7021 | HouseWareBlock Lookup spacious house ware delivery policy. Works only for spacious houses (Camp, Fort, Store, Barracks) |
aHouseID: Integer; aWareType: TKMWareType; |
Integer //0 - allow, 1 - block, 2 - evacuate |
- | HouseWareInside | aHouseID: Integer; aWareType: TKMWareType; |
Integer |
10399 | HouseWaresBlock Lookup common ware delivery policy. Works only for common houses |
aHouseID: Integer; | Integer //0 - allow, 1 - block |
- | HouseWeaponsOrdered Get the amount of weapons ordered in the house |
aHouseID: Integer; aWareType: TKMWareType; |
Integer |
- | HouseWoodcutterChopOnly | aHouseID: Integer; | Boolean |
- | IsFieldAt Check if there is a field owned by player at coordinates |
aPlayer: Integer; //Player - player to whom field must belong. -1 stands for any player aX: Word; aY: Word; |
Boolean |
- | IsOrchardAt Check if there is a orchard owned by player at coordinates |
aPlayer: Integer; //Player - player to whom orchard must belong. -1 stands for any player aX: Word; aY: Word; |
Boolean |
- | IsRoadAt Check if there is a road owned by player at coordinates |
aPlayer: Integer; //Player - player to whom road must belong. -1 stands for any player aX: Word; aY: Word; |
Boolean |
- | PeaceTime Get the peacetime (in game ticks) |
Cardinal | |
- | PlayerAllianceCheck | aPlayer1: Integer; aPlayer2: Integer; |
Boolean |
- | PlayerColorText Get the string with color code of the player (adjusted brighter for text display) |
aPlayer: Integer; | UnicodeString |
- | PlayerDefeated | aPlayer: Integer; | Boolean |
- | PlayerEnabled Check if hand is enabled (chosen to be played by anyone on mission start) |
aPlayer: Integer; | Boolean |
8743 | PlayerFogRevealed See if tile is revealed to the player (known or live) |
aPlayer: Integer; aX: Word; aY: Word; |
Boolean |
- | PlayerGetAllGroups Get list of all players groups |
aPlayer: Integer; | array of Integer |
- | PlayerGetAllHouses Return all players houses that are not destroyed |
aPlayer: Integer; | array of Integer |
- | PlayerGetAllRoads Get list of all players roads |
aPlayer: Integer; //Player - player to whom roads must belong. 0..N-1 | TKMPointArray |
- | PlayerGetAllUnits Return all players units that are not dead and not in training |
aPlayer: Integer; | array of Integer |
10697 | PlayerHouseBlocked Check if Player has the house type explicitly blocked from being built |
aPlayer: Integer; aHouseType: TKMHouseType; |
Boolean |
- | PlayerHouseCanBuild Check if Player can build certain house type |
aPlayer: Integer; aHouseType: TKMHouseType; |
Boolean |
10697 | PlayerHouseGranted Check if Player has the house explicitly granted (allowed to be built If house is both granted and blocked - it will be blocked |
aPlayer: Integer; aHouseType: TKMHouseType; |
Boolean |
10470 | PlayerIsNeutral Check if the player is neutral (animals) |
aPlayer: Integer; | Boolean |
- | PlayerName Get the players name |
aPlayer: Integer; | UnicodeString |
- | PlayerVictorious | aPlayer: Integer; | Boolean |
- | PlayerWareDistribution | aPlayer: Integer; aWareType: TKMWareType; aHouseType: TKMHouseType; |
Byte |
- | StatArmyCount | aPlayer: Integer; | Integer |
- | StatCitizenCount | aPlayer: Integer; | Integer |
- | StatHouseTypeCount | aPlayer: Integer; aHouseType: TKMHouseType; |
Integer |
- | StatPlayerCount See how many enabled players there are in the mission (chosen to be played by anyone on mission start) |
Integer | |
- | StatUnitCount See how many units player has alive |
aPlayer: Integer; | Integer |
- | StatUnitKilledCount See how many units player has killed |
aPlayer: Integer; aUnitType: TKMUnitType; |
Integer |
- | StatUnitLostCount See how many units player has lost |
aPlayer: Integer; aUnitType: TKMUnitType; |
Integer |
- | StatUnitTypeCount See how many units of certain type player has alive |
aPlayer: Integer; aUnitType: TKMUnitType; |
Integer |
5606 | StatWaresBalance See how many wares player has at the moment |
aPlayer: Integer; aWareType: TKMWareType; |
Integer |
5606 | StatWaresProduced See how many wares were produced by the player |
aPlayer: Integer; aWareType: TKMWareType; |
Integer |
8785 | StatWaresProducedValue Get total value of all wares produced by player |
aPlayer: Integer; | Integer |
-6683 | SysRandom ❌ Removed Method was removed, use Utils.Random instead |
Single | |
-6683 | SysRandomI ❌ Removed Method was removed, use Utils.RandomI instead |
aMax: Integer; | Integer |
- | UnitAt Return UID of the unit on requested coordinates |
aX: Word; aY: Word; |
Integer |
- | UnitCarryCount See how many wares that unit is carrying |
aUnitID: Integer; aWareType: TKMWareType; |
Integer |
- | UnitCarryType See ware type that unit is carrying |
aUnitID: Integer; | TKMWareType |
- | UnitDead Check if unit is dead |
aUnitID: Integer; | Boolean |
- | UnitDirection See unit facing direction (0 .. 7) -1 if direction is uninitialized |
aUnitID: Integer; | Integer |
4829 | UnitGroup Return UID of a group to which requested Unit belongs |
aUnitID: Integer; | Integer |
6692 | UnitHunger See unit hunger condition in seconds remaining till death Result within 0 and 2700 (45min) |
aUnitID: Integer; | Integer |
6692 | UnitHungerLow Return fullness level of a unit when it becomes hungry, in seconds |
Integer | |
6692 | UnitHungerMax Return maximum fullness level of a unit, in seconds |
Integer | |
- | UnitOwner See unit owner hand |
aUnitID: Integer; | Integer |
- | UnitPositionX Get rounded unit position X |
aUnitID: Integer; | Integer |
- | UnitPositionY Get rounded unit position Y |
aUnitID: Integer; | Integer |
- | UnitType See unit type |
aUnitID: Integer; | TKMUnitType |