Skip to content

Unit

← CHK Functions · code catalog

Friendly names for CHK category 5. Each maps to a top-level CHK code.


CheckTotalUnits

CheckTotalUnits()  ·  chk 43

No in-game description provided; behaviour inferred from the function name.

Example: chk(43)


CheckUnitOwner

CheckUnitOwner(unit_Nr: int)  ·  chk 44

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(44,1)


CheckUnitHQ

CheckUnitHQ(unit_Nr: int)  ·  chk 45

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(45,1)


CheckUnitX

CheckUnitX(unit_Nr: int)  ·  chk 46

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(46,1)


CheckUnitY

CheckUnitY(unit_Nr: int)  ·  chk 47

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(47,1)


CheckUnitHistoricalID

CheckUnitHistoricalID(unit_Nr: int)  ·  chk 48

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(48,1)


CheckUnitIsHQ

CheckUnitIsHQ(unit_Nr: int)  ·  chk 49

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(49,1)


CheckUnitInHQChain

CheckUnitInHQChain(unit_Nr: int, hQ_Nr: int)  ·  chk 51

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr (int) — Unit Nr
  • hQ_Nr (int) — HQ Nr

Example: chk(51,1,1)


CheckUnitCommanderStaffPercent

CheckUnitCommanderStaffPercent(unit_Nr: int)  ·  chk 52

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(52,1)


CheckUnitHQPower

CheckUnitHQPower(unit_Nr: int)  ·  chk 53

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(53,1)


CheckFirstUnitWithHistoricalID

CheckFirstUnitWithHistoricalID(historical_ID: int)  ·  chk 54

No in-game description provided; behaviour inferred from the function name.

Parameters

  • historical_ID (int) — Historical ID

Example: chk(54,1)


CheckClosestCommanderUnit

CheckClosestCommanderUnit(x: int, y: int, regime: int)  ·  chk 57

No in-game description provided; behaviour inferred from the function name.

Parameters

  • x (int) — X
  • y (int) — Y
  • regime (int) — Regime

Example: chk(57,12,8,4)


CheckHistoricalUnitTempVar

CheckHistoricalUnitTempVar(unit_Nr_or_1_to_use_hist: int, tempVar_Nr_1_5_6_AiZoneListNr: int, use_Historical_Unit_ID: int)  ·  chk 61

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr_or_1_to_use_hist (int) — Unit Nr (or -1 to use hist.)
  • tempVar_Nr_1_5_6_AiZoneListNr (int) — TempVar Nr (1-5), 6=AiZoneListNr
  • use_Historical_Unit_ID (int) — Use Historical Unit ID

Example: chk(61,1,1,1)


CheckCommanderDescriptName

CheckCommanderDescriptName(unit_Nr: int, n0_Descript_1_Name: int, hisUnit_ID_overrule_0_is_no_overrule: int)  ·  chk 62

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr (int) — Unit Nr
  • n0_Descript_1_Name (int) — 0=Descript, 1=Name
  • hisUnit_ID_overrule_0_is_no_overrule (int) — HisUnit ID overrule (<=0 is no overrule)

Example: chk(62,1,1,1)


CheckCommanderXP

CheckCommanderXP(unit_Nr_or_1: int, overrule_His_Unit_ID_or_1: int, n0_Xp_1_Total_Cards_2_Specific_Card_3_Total_Ev_4_Spec_Ev: int, opt_card_or_ev: int)  ·  chk 63

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit_Nr_or_1 (int) — Unit Nr (or -1)
  • overrule_His_Unit_ID_or_1 (int) — Overrule His Unit ID (or -1)
  • n0_Xp_1_Total_Cards_2_Specific_Card_3_Total_Ev_4_Spec_Ev (int) — 0=Xp, 1=Total Cards, 2=Specific Card, 3=Total Ev, 4=Spec Ev
  • opt_card_or_ev (int) — Opt: card or ev#

Example: chk(63,1,1,10,1)


CheckUnitRdn

CheckUnitRdn(unit: int)  ·  chk 67

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit (int) — Unit#

Example: chk(67,1)


CheckUnitSFType

CheckUnitSFType(unit: int, sFType_Group_1_for_none: int, specific_SFType_1_for_none: int)  ·  chk 68

Returns the number of individuals in this unit

Parameters

  • unit (int) — Unit #
  • sFType_Group_1_for_none (int) — SFType Group (-1 for none)
  • specific_SFType_1_for_none (int) — Specific SFType (-1 for none)

Example: chk(68,1,1,1)


CheckUnitName

CheckUnitName(unit: int)  ·  chk 70

No in-game description provided; behaviour inferred from the function name.

Parameters

  • unit (int) — Unit#

Example: chk(70,1)


CheckUnitTempOwner

CheckUnitTempOwner(unit_Nr: int)  ·  chk 73

Returns the real owner. If this is a subregime it will actually give back the subregime regime # instead of the uberregime which the normal CheckUnitOwner will return.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(73,1)


CheckUnitPower

CheckUnitPower(unit_Nr: int)  ·  chk 75

Returns the real total power points in the unit.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(75,1)


CheckUnitSelectable

CheckUnitSelectable(unit_Nr: int)  ·  chk 78

Returns 0 if not selectable. returns 1 if selectable.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(78,1)


CheckUnitMor

CheckUnitMor(unit: int)  ·  chk 81

Keep in mind this is an average of the subformations.

Parameters

  • unit (int) — Unit#

Example: chk(81,1)


CheckHexUnitCounter

CheckHexUnitCounter(x: int, y: int)  ·  chk 118

Returns -1 if no units. Returns 0 is one unit (in slot 0). Returns 1 if two units present (one in slot 0, one in slot1), etc..

Parameters

  • x (int) — X
  • y (int) — Y

Example: chk(118,12,8)


CheckHexUnit

CheckHexUnit(x: int, y: int, unit_Slot: int)  ·  chk 119

You should use CheckHexUnitCounter to determine the number of units on the hex. Start with slot=0!

Parameters

  • x (int) — X
  • y (int) — Y
  • unit_Slot (int) — Unit Slot

Example: chk(119,12,8,1)


CheckUnitStaffPercent

CheckUnitStaffPercent(unit_Nr: int, checkMode_0_1_2: int)  ·  chk 121

Return the staff % of the unit... you might want to use this check in combination with CheckUnitHqPower since distance is not checked for in this event. Check Mode 0 returns staff%. Check Mode 1 returns combat mod%, Check Mode 2 returns morale mod%.

Parameters

  • unit_Nr (int) — Unit Nr
  • checkMode_0_1_2 (int) — CheckMode=0,1,2

Example: chk(121,1,1)


CheckHisVar

CheckHisVar(his_Unit_ID: int, type: int)  ·  chk 127

Returns value if type is present. If type is not present it returns 0.

Parameters

  • his_Unit_ID (int) — His Unit ID#
  • type (int) — Type#

Example: chk(127,1,1)


CheckUnitRecon

CheckUnitRecon(unit: int, include_land_theater_0_no_1_yes: bool, include_sea_theater_0_no_1_yes: bool, include_air_theater_0_no_1_yes: bool)  ·  chk 128

Returns total recon points in the unit.

Parameters

  • unit (int) — Unit#
  • include_land_theater_0_no_1_yes (bool) — Include land theater 0=no, 1=yes
  • include_sea_theater_0_no_1_yes (bool) — Include sea theater 0=no, 1=yes
  • include_air_theater_0_no_1_yes (bool) — Include air theater 0=no, 1=yes

Example: chk(128,1,1,1,1)


CheckHistoricalUnitAverageXP

CheckHistoricalUnitAverageXP(unit: int)  ·  chk 130

Will look up other units on map with the same historical unit and return average xp

Parameters

  • unit (int) — Unit#

Example: chk(130,1)


CheckTotalHistoricalUnits

CheckTotalHistoricalUnits()  ·  chk 133

No in-game description provided; behaviour inferred from the function name.

Example: chk(133)


CheckGetHistoricalUnitID

CheckGetHistoricalUnitID(slot: int)  ·  chk 134

Keep in mind that this function should be used to scroll through all historical units using a looper from 0 to CheckTotalHistoricalUnits. Use this function to get the actual ID to be used in other functions.

Parameters

  • slot (int) — Slot#

Example: chk(134,1)


CheckGetHistoricalUnitRegime

CheckGetHistoricalUnitRegime(historical_Unit_ID: int)  ·  chk 135

No in-game description provided; behaviour inferred from the function name.

Parameters

  • historical_Unit_ID (int) — Historical Unit ID#

Example: chk(135,1)


CheckPeopleUnderHQ

CheckPeopleUnderHQ(hQ_level_to_check: int, troop_people: int, hQ_people: int, regime: int)  ·  chk 136

A complicated function. HQ level 1 is HQs with historical unit set to Corps. HQ level 2 is only HQs with historical HQ set to Army, 3=armygroup, 4=high command.. Function returns % of total power points of people on map is under a hq whose historical unit people is set to hqppl. This function could for example be used to check if axis minor are under wehrmacht HQs or under their own.

Parameters

  • hQ_level_to_check (int) — HQ level to check
  • troop_people (int) — Troop people
  • hQ_people (int) — HQ people
  • regime (int) — regime#

Example: chk(136,1,2,2,4)


CheckGetHistoricalUnitPeople

CheckGetHistoricalUnitPeople(historical_Unit_ID: int)  ·  chk 137

No in-game description provided; behaviour inferred from the function name.

Parameters

  • historical_Unit_ID (int) — Historical Unit ID#

Example: chk(137,1)


CheckGetHistoricalUnitType

CheckGetHistoricalUnitType(historical_Unit_ID: int)  ·  chk 138

Returns the type. 5=corps, 6=army, etc..

Parameters

  • historical_Unit_ID (int) — Historical Unit ID#

Example: chk(138,1)


CheckGetHistoricalUnitOfficer

CheckGetHistoricalUnitOfficer(historical_Unit_ID: int)  ·  chk 139

returns 1 if officer, returns 0 if not. Basicly the length of officer name is checked.

Parameters

  • historical_Unit_ID (int) — Historical Unit ID#

Example: chk(139,1)


CheckGetHistoricalUnitName

CheckGetHistoricalUnitName(historical_Unit_ID: int)  ·  chk 143

No in-game description provided; behaviour inferred from the function name.

Parameters

  • historical_Unit_ID (int) — Historical Unit ID#

Example: chk(143,1)


CheckGetHistoricalSubparts

CheckGetHistoricalSubparts(historical_Unit_ID: int)  ·  chk 144

No in-game description provided; behaviour inferred from the function name.

Parameters

  • historical_Unit_ID (int) — Historical Unit ID#

Example: chk(144,1)


CheckUnitAP

CheckUnitAP(unit: int)  ·  chk 146

Keep in mind this is the lowest AP subformations.

Parameters

  • unit (int) — Unit#

Example: chk(146,1)


CheckIsUnitAPreDef

CheckIsUnitAPreDef(unr: int)  ·  chk 151

Returns -1 if not a predef. Returns the predef ID # if it is a predef.

Parameters

  • unr (int) — Unr#

Example: chk(151,1)


CheckUnitXP

CheckUnitXP(unit: int, only_if_staff_0_no_1_yes: bool)  ·  chk 153

Keep in mind that it returns the highest XP found in any subformation.

Parameters

  • unit (int) — Unit#
  • only_if_staff_0_no_1_yes (bool) — Only if staff (0=no,1=yes)

Example: chk(153,1,1)


CheckGetHistoricalUnitCommanderName

CheckGetHistoricalUnitCommanderName(historical_Unit_ID: int)  ·  chk 154

Returns the commandername (not the his.unit name!). If no commander empty string is returned.

Parameters

  • historical_Unit_ID (int) — Historical Unit ID#

Example: chk(154,1)


CheckFindHistoricalUnitWithCommanderName

CheckFindHistoricalUnitWithCommanderName(commander_Name: string)  ·  chk 155

Returns the first historical unit ID number of a unit ON the map with this commander name present. -1= none find.

Parameters

  • commander_Name (string) — Commander Name

Example: chk(155,'Name')


CheckUnitHQChanged

CheckUnitHQChanged(unit_Nr: int)  ·  chk 156

Returns 1 if the unit HQ has been changed in this turn. Returns 0 if not.

Parameters

  • unit_Nr (int) — Unit Nr

Example: chk(156,1)


CheckHistoricalUnitAirAndNavy

CheckHistoricalUnitAirAndNavy(his_Unit_ID: int, check_for_air_theater_troops_0_no_1_yes: bool, check_for_navy_theater_troops_0_no_1_yes: bool)  ·  chk 157

Returns 1 if those troops are present. 0 if not.

Parameters

  • his_Unit_ID (int) — His Unit ID#
  • check_for_air_theater_troops_0_no_1_yes (bool) — Check for air theater troops? 0=no,1=yes
  • check_for_navy_theater_troops_0_no_1_yes (bool) — Check for navy theater troops? 0=no,1=yes

Example: chk(157,1,1,1)


CheckHistoricalUnitMaster

CheckHistoricalUnitMaster(historical_Unit_ID: int)  ·  chk 185

Returns the historical unit model ID

Parameters

  • historical_Unit_ID (int) — Historical Unit ID

Example: chk(185,1)


CheckUnitActivity

CheckUnitActivity(unit_Nr: int, activity_Data_Type: int)  ·  chk 187

These stats are reset after lateTurn events are executed. Activity Data Types are 1=Offensive combat AP spent, 2=Defensive combat AP spent, 3=Move AP spent, 4=Off+Def AP spent, 5=Off+Def+Move AP spent. 6=Did unit spent move AP or moved (0=no, 1=yes)

Parameters

  • unit_Nr (int) — Unit Nr
  • activity_Data_Type (int) — Activity Data Type

Example: chk(187,1,1)


CheckGetHistoricalUnitSlot

CheckGetHistoricalUnitSlot(iD: int)  ·  chk 196

Supply the historical unit ID# and get the slot# in return. If not found it will return -1.

Parameters

  • iD (int) — ID#

Example: chk(196,1)


CheckGetCommanderPoolValue

CheckGetCommanderPoolValue(iD: int)  ·  chk 199

Returns 1 if in pool. Returns 0 if not.

Parameters

  • iD (int) — ID#

Example: chk(199,1)


CheckUnitEntrench

CheckUnitEntrench(unit: int)  ·  chk 209

Keep in mind this is an average of the subformations.

Parameters

  • unit (int) — Unit#

Example: chk(209,1)


CheckUnitIntegrity

CheckUnitIntegrity(unit: int)  ·  chk 211

Returns a percentage between 0-100.

Parameters

  • unit (int) — Unit#

Example: chk(211,1)


CheckUnitSupplyConsumption

CheckUnitSupplyConsumption(unit: int, mode: int)  ·  chk 212

Mode<=1 : Returns a percentage between 0-100. Mode 2: Returns missing supply, Mode 3: Returns missing fuel

Parameters

  • unit (int) — Unit#
  • mode (int) — Mode

Example: chk(212,1,1)


This doc was generated from extracting data from Shadow Empire version 1.32a on 2026-06-05 06:56 UTC.