Imperivm Modding WikiCKS · FORMATS · GUIDESEspañol
CKS TYPECKS reference

Settlement

Browse its members and the signatures that accept or return this type.

139 members14 return it20 accept it

Members

139

Expand a member to read its notes or open its full entry. Each overload keeps its own identity.

MemberSignature and description
population

Reads the settlement's current population count.

Open full entry →
Settlement
int Settlement::population()

Reads the settlement's current population count.

max_population

Reads the settlement's maximum population capacity.

Open full entry →
Settlement
int Settlement::max_population()

Reads the settlement's maximum population capacity.

name

Copies the selected settlement name bytes into a VM string result with a chained four-byte metadata trailer.

Open full entry →
Settlement
str Settlement::name()

Copies the selected settlement name bytes into a VM string result with a chained four-byte metadata trailer.

ForceAddUnit

CKS-exposed Settlement::ForceAddUnit, adding a unit to the settlement's Holder bypassing capacity.

Open full entry →
Settlement
void Settlement::ForceAddUnit(Unit)

CKS-exposed Settlement::ForceAddUnit, adding a unit to the settlement's Holder bypassing capacity.

AddUnit

CKS-exposed Settlement::AddUnit, adding a unit to the settlement's Holder without bypassing capacity.

Open full entry →
Settlement
bool Settlement::AddUnit(Unit)

CKS-exposed Settlement::AddUnit, adding a unit to the settlement's Holder without bypassing capacity.

IsFull

CKS-exposed Settlement::IsFull, comparing the settlement's Holder occupancy to capacity.

Open full entry →
Settlement
bool Settlement::IsFull()

CKS-exposed Settlement::IsFull, comparing the settlement's Holder occupancy to capacity.

AddUnits

Attempts nonforced holder entry for eligible members of a supplied ObjList and returns the number of successful entries.

Open full entry →
Settlement
int Settlement::AddUnits(ObjList)

Attempts nonforced holder entry for eligible members of a supplied ObjList and returns the number of successful entries.

Units

Returns an ObjList view of a settlement holder's unit collection for the Settlement::Units registration.

Open full entry →
Settlement
ObjList Settlement::Units()

Returns an ObjList view of a settlement holder's unit collection for the Settlement::Units registration.

UnitsCount

CKS-exposed Settlement::UnitsCount, returning the settlement's Holder member count at [field].

Open full entry →
Settlement
int Settlement::UnitsCount()

CKS-exposed Settlement::UnitsCount, returning the settlement's Holder member count at [field].

max_units

Returns the capacity at the Settlement's resolved Holder [field] field.

Open full entry →
Settlement
int Settlement::max_units()

Returns the capacity at the Settlement's resolved Holder [field] field.

health

Settlement::health resolves Settlement[field] and returns the linked Holder health field serialized at [field].

Open full entry →
Settlement
int Settlement::health()

Settlement::health resolves Settlement[field] and returns the linked Holder health field serialized at [field].

max_health

Settlement::max_health resolves Settlement[field] and returns the linked Holder maximum-health field serialized at [field].

Open full entry →
Settlement
int Settlement::max_health()

Settlement::max_health resolves Settlement[field] and returns the linked Holder maximum-health field serialized at [field].

stamina

The registered stamina getter returns a nested registry dword at [field].

Open full entry →
Settlement
int Settlement::stamina()

The registered stamina getter returns a nested registry dword at [field].

max_stamina

The registered max_stamina getter returns a nested registry dword at [field].

Open full entry →
Settlement
int Settlement::max_stamina()

The registered max_stamina getter returns a nested registry dword at [field].

loyalty

Reads raw loyalty and returns it scaled down by 10 for display.

Open full entry →
Settlement
int Settlement::loyalty()

Reads raw loyalty and returns it scaled down by 10 for display.

SetLoyalty

Writes raw loyalty directly from a 0-100 input, bypassing the change accumulator.

Open full entry →
Settlement
void Settlement::SetLoyalty(int)

Writes raw loyalty directly from a 0-100 input, bypassing the change accumulator.

DecreaseLoyalty

Subtracts a scaled non-negative amount from the loyalty change accumulator.

Open full entry →
Settlement
void Settlement::DecreaseLoyalty(int)

Subtracts a scaled non-negative amount from the loyalty change accumulator.

gold

Returns current gold from the settlement's registered resource store.

Open full entry →
Settlement
int Settlement::gold()

Returns current gold from the settlement's registered resource store.

max_gold

Returns maximum gold from the settlement's registered resource store.

Open full entry →
Settlement
int Settlement::max_gold()

Returns maximum gold from the settlement's registered resource store.

food

Returns current food from the settlement's registered resource store.

Open full entry →
Settlement
int Settlement::food()

Returns current food from the settlement's registered resource store.

max_food

Returns maximum food from the settlement's registered resource store.

Open full entry →
Settlement
int Settlement::max_food()

Returns maximum food from the settlement's registered resource store.

SetGold

Sets current gold on the resource store to an absolute value, clamped to the store's maximum gold.

Open full entry →
Settlement
void Settlement::SetGold(int)

Sets current gold on the resource store to an absolute value, clamped to the store's maximum gold.

SetFood

Sets current food on the resource store to an absolute value, clamped to the store's maximum food.

Open full entry →
Settlement
void Settlement::SetFood(int)

Sets current food on the resource store to an absolute value, clamped to the store's maximum food.

SetPopulation

Writes current population, clamped to at most the settlement's maximum population.

Open full entry →
Settlement
void Settlement::SetPopulation(int)

Writes current population, clamped to at most the settlement's maximum population.

AddToPopulation

Applies an unconditional signed delta to current population, with no guard or clamp.

Open full entry →
Settlement
void Settlement::AddToPopulation(int)

Applies an unconditional signed delta to current population, with no guard or clamp.

AddToMaxPopulation

CKS AddToMaxPopulation adapter that adds a dword delta after guarded receiver resolution.

Open full entry →
Settlement
void Settlement::AddToMaxPopulation(int)

CKS AddToMaxPopulation adapter that adds a dword delta after guarded receiver resolution.

player

Converts the settlement's owning PlayerInfo identifier to the one-based scripting player number.

Open full entry →
Settlement
int Settlement::player()

Converts the settlement's owning PlayerInfo identifier to the one-based scripting player number.

SetPlayer

Changes the settlement's owner. When the player differs from the current one, the stored gold moves to the new owner's statistics and every building of the settlement gets the new owner.

An object joining a settlement keeps its owner; only this change of the settlement's owner re-owns its buildings. The loop over the buildings was not checked instruction by instruction.

Open full entry →
Settlement
void Settlement::SetPlayer(int)

Changes the settlement's owner. When the player differs from the current one, the stored gold moves to the new owner's statistics and every building of the settlement gets the new owner.

IsValid

CKS native primitive that tests whether an Obj handle is valid; used generically, including on settlement handles.

Open full entry →
Settlement
bool Settlement::IsValid()

CKS native primitive that tests whether an Obj handle is valid; used generically, including on settlement handles.

loan

CKS loan adapter that performs wrapped signed scaling of settlement offset [field].

Open full entry →
Settlement
int Settlement::loan()

CKS loan adapter that performs wrapped signed scaling of settlement offset [field].

SetLoan

CKS SetLoan adapter that overwrites settlement offset [field] with wrapped signed scaling and calls a helper.

Open full entry →
Settlement
void Settlement::SetLoan(int)

CKS SetLoan adapter that overwrites settlement offset [field] with wrapped signed scaling and calls a helper.

GetCentralBuilding

Returns the registry handle stored in the settlement's central-building field.

Open full entry →
Settlement
Building Settlement::GetCentralBuilding()

Returns the registry handle stored in the settlement's central-building field.

FoodProduction

CKS FoodProduction adapter that reads the settlement dword at offset [field].

Open full entry →
Settlement
int Settlement::FoodProduction()

CKS FoodProduction adapter that reads the settlement dword at offset [field].

GoldProduction

CKS GoldProduction adapter that reads the settlement dword at offset [field].

Open full entry →
Settlement
int Settlement::GoldProduction()

CKS GoldProduction adapter that reads the settlement dword at offset [field].

SetFoodProduction

Writes the settlement's food production rate unconditionally.

Open full entry →
Settlement
void Settlement::SetFoodProduction(int)

Writes the settlement's food production rate unconditionally.

SetGoldProduction

Writes the settlement's gold production rate unconditionally.

Open full entry →
Settlement
void Settlement::SetGoldProduction(int)

Writes the settlement's gold production rate unconditionally.

Buildings

Settlement::Buildings returns an ObjList view at settlement [field], or an allocated empty list for an invalid settlement handle.

Open full entry →
Settlement
ObjList Settlement::Buildings()

Settlement::Buildings returns an ObjList view at settlement [field], or an allocated empty list for an invalid settlement handle.

Find

Find consumes str then Settlement, compares template string bytes and returns the first equal member handle.

Open full entry →
Settlement
Building Settlement::Find(str)

Find consumes str then Settlement, compares template string bytes and returns the first equal member handle.

FirstBldClass

CKS FirstBldClass adapter returning a copy of the Settlement string at [field].

Open full entry →
Settlement
str Settlement::FirstBldClass()

CKS FirstBldClass adapter returning a copy of the Settlement string at [field].

CanBeCaptured

Behavior awaiting documentation.

Open full entry →
Settlement
bool Settlement::CanBeCaptured(Unit)Description pending

Description pending.

AllowCapture

AllowCapture stores the zero-extended argument byte at Settlement [field].

Open full entry →
Settlement
void Settlement::AllowCapture(bool)

AllowCapture stores the zero-extended argument byte at Settlement [field].

ObjectsAround

Builds an ObjList of settlement-associated objects matching a requested script class.

Open full entry →
Settlement
ObjList Settlement::ObjectsAround(str)

Builds an ObjList of settlement-associated objects matching a requested script class.

GetEnterExit

Delegates to a random building with point lookup using point type 12. The meaning of that type is not documented here.

Open full entry →
Settlement
Building Settlement::GetEnterExit()

Delegates to a random building with point lookup using point type 12. The meaning of that type is not documented here.

GetWaterSource

Delegates to a random building with point lookup using point type 13. The meaning of that type is not documented here.

Open full entry →
Settlement
Building Settlement::GetWaterSource()

Delegates to a random building with point lookup using point type 13. The meaning of that type is not documented here.

GetGoodsSource

Delegates to a random building with point lookup using point type 14. The meaning of that type is not documented here.

Open full entry →
Settlement
Building Settlement::GetGoodsSource()

Delegates to a random building with point lookup using point type 14. The meaning of that type is not documented here.

GetFixSite

Delegates to a random building with point lookup using point type 15. The meaning of that type is not documented here.

Open full entry →
Settlement
Building Settlement::GetFixSite()

Delegates to a random building with point lookup using point type 15. The meaning of that type is not documented here.

MostDamagedBuilding

Selects the first eligible settlement member with the greatest strictly positive signed damage accumulator and template mask 4096.

Open full entry →
Settlement
Building Settlement::MostDamagedBuilding()

Selects the first eligible settlement member with the greatest strictly positive signed damage accumulator and template mask 4096.

ClearDamageTaken

ClearDamageTaken writes zero to dword [field] of every iterated settlement member.

Open full entry →
Settlement
void Settlement::ClearDamageTaken()

ClearDamageTaken writes zero to dword [field] of every iterated settlement member.

FindNearEnterExit

Searches settlement type12 points and selects the first strict minimum of a transformed integer distance metric.

Open full entry →
Settlement
point Settlement::FindNearEnterExit(point)

Searches settlement type12 points and selects the first strict minimum of a transformed integer distance metric.

IsCity

Tests whether the settlement's central building's own UnitTemplate name string matches "GTownhall" or "RTownhall", distinguishing a template-name comparison from a class-name identity test.

Open full entry →
Settlement
bool Settlement::IsCity()

Tests whether the settlement's central building's own UnitTemplate name string matches "GTownhall" or "RTownhall", distinguishing a template-name comparison from a class-name identity test.

PopulationDied

Settlement::PopulationDied resolves the settlement handle and returns the integer count at offset [field], returning 0 on failure.

Open full entry →
Settlement
int Settlement::PopulationDied()

Settlement::PopulationDied resolves the settlement handle and returns the integer count at offset [field], returning 0 on failure.

GoldConverted

Adds an amount to a player-level gold-converted accounting counter without mutating the resource store.

Open full entry →
Settlement
void Settlement::GoldConverted(int)

Adds an amount to a player-level gold-converted accounting counter without mutating the resource store.

GoldSpent

CKS GoldSpent adapter that adds an amount to a selected structure's dword at offset [field].

Open full entry →
Settlement
void Settlement::GoldSpent(int)

CKS GoldSpent adapter that adds an amount to a selected structure's dword at offset [field].

GetSentry

GetSentry calls [field] with field [field] minus one when that field is signed positive, returning integer one; otherwise it returns zero.

Open full entry →
Settlement
int Settlement::GetSentry()

GetSentry calls [field] with field [field] minus one when that field is signed positive, returning integer one; otherwise it returns zero.

PutSentry

PutSentry calls [field] with wrapped [field] plus one and then increments dword [field].

Open full entry →
Settlement
void Settlement::PutSentry()

PutSentry calls [field] with wrapped [field] plus one and then increments dword [field].

DelSentry

Decrements one of two settlement sentry counters with a zero floor on the fallback field.

Open full entry →
Settlement
void Settlement::DelSentry()

Decrements one of two settlement sentry counters with a zero floor on the fallback field.

GetNumSentries

GetNumSentries and GetMaxSentries copy the resolved Settlement dwords [field] and [field] respectively, with zero fallback.

Open full entry →
Settlement
int Settlement::GetNumSentries()

GetNumSentries and GetMaxSentries copy the resolved Settlement dwords [field] and [field] respectively, with zero fallback.

AddSentries

AddSentries adds its integer argument modulo 2^32 to [field], then calls [field] with wrapped [field] plus the same argument.

Open full entry →
Settlement
void Settlement::AddSentries(int)

AddSentries adds its integer argument modulo 2^32 to [field], then calls [field] with wrapped [field] plus the same argument.

GetMaxSentries

GetNumSentries and GetMaxSentries copy the resolved Settlement dwords [field] and [field] respectively, with zero fallback.

Open full entry →
Settlement
int Settlement::GetMaxSentries()

GetNumSentries and GetMaxSentries copy the resolved Settlement dwords [field] and [field] respectively, with zero fallback.

AddMaxSentries

Settlement::AddMaxSentries adds its signed integer argument directly to the resolved Settlement's dword at [field].

Open full entry →
Settlement
void Settlement::AddMaxSentries(int)

Settlement::AddMaxSentries adds its signed integer argument directly to the resolved Settlement's dword at [field].

EvalSentries

Behavior awaiting documentation.

The extension records this primitive, but does not yet provide a description of its behavior.

Open full entry →
Settlement
int Settlement::EvalSentries()Description pending

Description pending.

CreateMuleFood

Delegates wagon creation with food mode one and returns a Wagon handle or sentinel.

Open full entry →
Settlement
Wagon Settlement::CreateMuleFood(int)

Delegates wagon creation with food mode one and returns a Wagon handle or sentinel.

CreateMuleGold

Resolves a Settlement and delegates the amount to helper [field], returning a Wagon handle or sentinel.

Open full entry →
Settlement
Wagon Settlement::CreateMuleGold(int)

Resolves a Settlement and delegates the amount to helper [field], returning a Wagon handle or sentinel.

CreateBoatFood

Calls the linked building spawn helper with the script amount and mode values one, one, then returns a Wagon handle or null.

Open full entry →
Settlement
Wagon Settlement::CreateBoatFood(int)

Calls the linked building spawn helper with the script amount and mode values one, one, then returns a Wagon handle or null.

CreateBoatGold

Calls the linked building spawn helper with the script amount and mode values zero, one, then returns a Wagon handle or null.

Open full entry →
Settlement
Wagon Settlement::CreateBoatGold(int)

Calls the linked building spawn helper with the script amount and mode values zero, one, then returns a Wagon handle or null.

CreateShip

CreateShip constructs a class-named object, applies owner and placement calls, attempts forced holder entry, and restores temporary global state on its normal valid-receiver path.

Open full entry →
Settlement
Ship Settlement::CreateShip(str)

CreateShip constructs a class-named object, applies owner and placement calls, attempts forced holder entry, and restores temporary global state on its normal valid-receiver path.

SendMule

SendMule and SendBoat call the same helper with mode zero or one when their linked target passes a relation-bit gate, otherwise clearing that target id.

Open full entry →
Settlement
void Settlement::SendMule()

SendMule and SendBoat call the same helper with mode zero or one when their linked target passes a relation-bit gate, otherwise clearing that target id.

SendBoat

SendMule and SendBoat call the same helper with mode zero or one when their linked target passes a relation-bit gate, otherwise clearing that target id.

Open full entry →
Settlement
void Settlement::SendBoat()

SendMule and SendBoat call the same helper with mode zero or one when their linked target passes a relation-bit gate, otherwise clearing that target id.

StartSupplyFood

Behavior awaiting documentation.

Open full entry →
Settlement
void Settlement::StartSupplyFood(Settlement)Description pending

Description pending.

StopSupply

Behavior awaiting documentation.

Open full entry →
Settlement
void Settlement::StopSupply()Description pending

Description pending.

UnloadWagon

UnloadWagon adds the wagon quantity to the linked settlement resource dword and clamps the wrapping sum by a signed comparison to its capacity.

Open full entry →
Settlement
void Settlement::UnloadWagon(Wagon)

UnloadWagon adds the wagon quantity to the linked settlement resource dword and clamps the wrapping sum by a signed comparison to its capacity.

supplied

Follows a fixed chain of settlement registry references and returns the final settlement handle.

Open full entry →
Settlement
Settlement Settlement::supplied()

Follows a fixed chain of settlement registry references and returns the final settlement handle.

Run

Compiles the requested script with a Settlement argument declaration and dispatches it after successful compilation.

Open full entry →
Settlement
void Settlement::Run(str)

Compiles the requested script with a Settlement argument declaration and dispatches it after successful compilation.

UnitsInHolderEval

Sums a native evaluation value across live members of the settlement holder.

Open full entry →
Settlement
int Settlement::UnitsInHolderEval()

Sums a native evaluation value across live members of the settlement holder.

NumTowers

Counts settlement members whose class inherits from Tower.

Open full entry →
Settlement
int Settlement::NumTowers()

Counts settlement members whose class inherits from Tower.

NumTowersBroken

NumTowersBroken counts live Tower descendants whose broken-state field equals 3.

Open full entry →
Settlement
int Settlement::NumTowersBroken()

NumTowersBroken counts live Tower descendants whose broken-state field equals 3.

NumGates

Counts live settlement members that can be converted to Gate.

Open full entry →
Settlement
int Settlement::NumGates()

Counts live settlement members that can be converted to Gate.

NumGatesBroken

Counts settlement members convertible to Gate whose original-object broken state is 3.

Open full entry →
Settlement
int Settlement::NumGatesBroken()

Counts settlement members convertible to Gate whose original-object broken state is 3.

EvalDefences

EvalDefences computes a presence score of 300 or 1000 for towers plus 4000 for gates.

Open full entry →
Settlement
int Settlement::EvalDefences()

EvalDefences computes a presence score of 300 or 1000 for towers plus 4000 for gates.

FindCatapultSpot

CKS adapter with unreconciled twenty-byte native input consumption that forwards an extra selector to class lookup and cached point selection.

⚠ Only partly documented so far.

Open full entry →
Settlement
point Settlement::FindCatapultSpot(point)

CKS adapter with unreconciled twenty-byte native input consumption that forwards an extra selector to class lookup and cached point selection.

BestGate

BestGate selects the first Gate with a strictly smaller native position score plus signed field [field] divided by five.

Open full entry →
Settlement
Gate Settlement::BestGate(point)

BestGate selects the first Gate with a strictly smaller native position score plus signed field [field] divided by five.

OpenAllGates

OpenAllGates traverses gate members and submits opengate commands for gates whose target-state field is not 1.

Open full entry →
Settlement
void Settlement::OpenAllGates()

OpenAllGates traverses gate members and submits opengate commands for gates whose target-state field is not 1.

IdleAllGates

IdleAllGates invokes gate virtual slot [field] with argument 1 when its current string does not equal idle.

Open full entry →
Settlement
void Settlement::IdleAllGates()

IdleAllGates invokes gate virtual slot [field] with argument 1 when its current string does not equal idle.

CanBeCaptured

Behavior awaiting documentation.

Open full entry →
Settlement
bool Settlement::CanBeCaptured()Description pending

Description pending.

IsStronghold

Calls the BaseTownhall-family predicate on a resolved settlement.

Open full entry →
Settlement
bool Settlement::IsStronghold()

Calls the BaseTownhall-family predicate on a resolved settlement.

IsVillage

Returns the village-class predicate for a valid Settlement.

Open full entry →
Settlement
bool Settlement::IsVillage()

Returns the village-class predicate for a valid Settlement.

IsOutpost

Tests whether the supplied settlement object inherits from the Outpost script class.

Open full entry →
Settlement
bool Settlement::IsOutpost()

Tests whether the supplied settlement object inherits from the Outpost script class.

IsTTent

Behavior awaiting documentation.

The extension records this primitive, but does not yet provide a description of its behavior.

Open full entry →
Settlement
bool Settlement::IsTTent()Description pending

Description pending.

IsShipyard

Returns whether the linked object template inherits BaseShipyard, including the ordinary first-use literal lookup and cache path.

Open full entry →
Settlement
bool Settlement::IsShipyard()

Returns whether the linked object template inherits BaseShipyard, including the ordinary first-use literal lookup and cache path.

IsAlly

Settlement IsAlly resolves the settlement owner and tests bit zero of the indexed player-relation table entry.

Open full entry →
Settlement
bool Settlement::IsAlly(int)

Settlement IsAlly resolves the settlement owner and tests bit zero of the indexed player-relation table entry.

IsEnemy

Returns the inverse low-bit predicate from a player relation table for a valid settlement.

Open full entry →
Settlement
bool Settlement::IsEnemy(int)

Returns the inverse low-bit predicate from a player relation table for a valid settlement.

IsOwn

Settlement::IsOwn returns true only when a valid Settlement owner's zero-based index equals idPlayer minus one.

Open full entry →
Settlement
bool Settlement::IsOwn(int)

Settlement::IsOwn returns true only when a valid Settlement owner's zero-based index equals idPlayer minus one.

IsIndependent

Returns true when the resolved settlement has linked owner code 14 or 15.

Open full entry →
Settlement
bool Settlement::IsIndependent()

Returns true when the resolved settlement has linked owner code 14 or 15.

IsIndependentGuarded

Behavior awaiting documentation.

The extension records this primitive, but does not yet provide a description of its behavior.

Open full entry →
Settlement
bool Settlement::IsIndependentGuarded()Description pending

Description pending.

GetRel

Returns a numeric relation code from the associated owner index and the queried player matrix bit.

Open full entry →
Settlement
int Settlement::GetRel(int)

Returns a numeric relation code from the associated owner index and the queried player matrix bit.

MaxPopulation

Settlement::MaxPopulation resolves a Settlement and returns its dword at [field], with zero as the invalid-object fallback.

Open full entry →
Settlement
int Settlement::MaxPopulation()

Settlement::MaxPopulation resolves a Settlement and returns its dword at [field], with zero as the invalid-object fallback.

SupplyCount

Counts same-owner buildings of a requested class that are associated with the specified settlement.

Open full entry →
Settlement
int Settlement::SupplyCount(str)

Counts same-owner buildings of a requested class that are associated with the specified settlement.

BestToSupply

Behavior awaiting documentation.

The extension records this primitive, but does not yet provide a description of its behavior.

Open full entry →
Settlement
Settlement Settlement::BestToSupply()Description pending

Description pending.

BestBarrack

Selects an eligible barracks in the settlement with the lowest score accepted by its selection procedure. Returns an invalid reference if no candidate is selected.

Selection filters settlement members and excludes barracks in a particular state. The exact meaning of that state, the score, and the integer argument is not fully documented; this entry does not identify them as distance, level, or unit count.

Open full entry →
Settlement
Barrack Settlement::BestBarrack(int)

Selects an eligible barracks in the settlement with the lowest score accepted by its selection procedure. Returns an invalid reference if no candidate is selected.

FindBuilding

Returns the first settlement member whose template derives from a requested class name.

Open full entry →
Settlement
Building Settlement::FindBuilding(str)

Returns the first settlement member whose template derives from a requested class name.

FindResearchLab

Finds a unit linked to a named research descriptor and returns its Building handle.

Open full entry →
Settlement
Building Settlement::FindResearchLab(str)

Finds a unit linked to a named research descriptor and returns its Building handle.

CanAfford

Tests positive signed resource quotients after subtracting the keyed reservation from available gold.

Open full entry →
Settlement
bool Settlement::CanAfford(int, int)

Tests positive signed resource quotients after subtracting the keyed reservation from available gold.

CanAfford

Resolves a Settlement and named command, then returns whether a cost check succeeds.

Open full entry →
Settlement
bool Settlement::CanAfford(str)

Resolves a Settlement and named command, then returns whether a cost check succeeds.

CanAfford

Compares the requested count with the signed native command affordability count.

Open full entry →
Settlement
bool Settlement::CanAfford(str, int)

Compares the requested count with the signed native command affordability count.

MaxAffordCount

Returns the signed native command affordability count after selecting reservation treatment.

Open full entry →
Settlement
int Settlement::MaxAffordCount(str)

Returns the signed native command affordability count after selecting reservation treatment.

CanResearch

CKS scripting primitive reporting whether a settlement is permitted to begin researching an upgrade that is not already researched or in progress.

Open full entry →
Settlement
bool Settlement::CanResearch(str)

CKS scripting primitive reporting whether a settlement is permitted to begin researching an upgrade that is not already researched or in progress.

Research

Resolves a Settlement and named upgrade, then conditionally submits a research command.

Open full entry →
Settlement
void Settlement::Research(str)

Resolves a Settlement and named upgrade, then conditionally submits a research command.

Reserve

Returns a signed percentage of army expenditure since the reservation snapshot.

Open full entry →
Settlement
int Settlement::Reserve()

Returns a signed percentage of army expenditure since the reservation snapshot.

StopReserving

Behavior awaiting documentation.

The extension records this primitive, but does not yet provide a description of its behavior.

Open full entry →
Settlement
void Settlement::StopReserving()Description pending

Description pending.

ReserveFor

Updates keyed reservation percent and command, preserving or initializing the army snapshot by branch.

Open full entry →
Settlement
bool Settlement::ReserveFor(str, int)

Updates keyed reservation percent and command, preserving or initializing the army snapshot by branch.

GoldSpentOnArmy

Returns the parsed army expenditure key on a valid receiver and omits the integer output on an invalid one.

Open full entry →
Settlement
int Settlement::GoldSpentOnArmy()

Returns the parsed army expenditure key on a valid receiver and omits the integer output on an invalid one.

SpentGoldOnArmy

Accumulates an amount in a per-game, per-settlement and per-player persistent army-spending counter.

Open full entry →
Settlement
void Settlement::SpentGoldOnArmy(int)

Accumulates an amount in a per-game, per-settlement and per-player persistent army-spending counter.

GoldSpentOnTech

Returns the parsed technology expenditure key on a valid receiver and omits the integer output on an invalid one.

Open full entry →
Settlement
int Settlement::GoldSpentOnTech()

Returns the parsed technology expenditure key on a valid receiver and omits the integer output on an invalid one.

SpentGoldOnTech

Adds a signed amount with 32-bit wrap to the keyed technology expenditure value.

Open full entry →
Settlement
void Settlement::SpentGoldOnTech(int)

Adds a signed amount with 32-bit wrap to the keyed technology expenditure value.

CheckTechBudget

Tests technology expenditure plus adjusted command cost against a signed percentage budget.

Open full entry →
Settlement
bool Settlement::CheckTechBudget(str, int)

Tests technology expenditure plus adjusted command cost against a signed percentage budget.

WaterLsa

Settlement WaterLsa and LandLsa return unsigned linked-object words at [field] or [field] when its template inherits BaseShipyard, otherwise returning zero.

Open full entry →
Settlement
int Settlement::WaterLsa()

Settlement WaterLsa and LandLsa return unsigned linked-object words at [field] or [field] when its template inherits BaseShipyard, otherwise returning zero.

LandLsa

Settlement WaterLsa and LandLsa return unsigned linked-object words at [field] or [field] when its template inherits BaseShipyard, otherwise returning zero.

Open full entry →
Settlement
int Settlement::LandLsa()

Settlement WaterLsa and LandLsa return unsigned linked-object words at [field] or [field] when its template inherits BaseShipyard, otherwise returning zero.

GetEconomyScript

Behavior awaiting documentation.

The extension records this primitive, but does not yet provide a description of its behavior.

Open full entry →
Settlement
int Settlement::GetEconomyScript(int)Description pending

Description pending.

RunEconomyScript

Behavior awaiting documentation.

The extension records this primitive, but does not yet provide a description of its behavior.

Open full entry →
Settlement
void Settlement::RunEconomyScript(int)Description pending

Description pending.

EconomyScript

Behavior awaiting documentation.

The extension records this primitive, but does not yet provide a description of its behavior.

Open full entry →
Settlement
int Settlement::EconomyScript()Description pending

Description pending.

GetTacticScript

CKS handler that invokes the tactic-selection script for a Settlement and player index.

Open full entry →
Settlement
int Settlement::GetTacticScript(int)

CKS handler that invokes the tactic-selection script for a Settlement and player index.

RunTacticScript

CKS handler that forwards a tactic ID and resolved settlement to the player-AI tactic-task starter.

Open full entry →
Settlement
void Settlement::RunTacticScript(int)

CKS handler that forwards a tactic ID and resolved settlement to the player-AI tactic-task starter.

TacticScript

CKS property handler that returns the settlement's current tactic ID after checking whether its task slot remains active.

Open full entry →
Settlement
int Settlement::TacticScript()

CKS property handler that returns the settlement's current tactic ID after checking whether its task slot remains active.

GetGaika

Returns the global AI table word associated with a Settlement.

Open full entry →
Settlement
GAIKA Settlement::GetGaika()

Returns the global AI table word associated with a Settlement.

CancelSupply

CancelSupply resolves stoptribute by name and forwards a seven-dword packet beginning with a partially initialized linked-object id to the native dispatch helper.

Open full entry →
Settlement
void Settlement::CancelSupply()

CancelSupply resolves stoptribute by name and forwards a seven-dword packet beginning with a partially initialized linked-object id to the native dispatch helper.

UpgradeBestBarrack

Behavior awaiting documentation.

Open full entry →
Settlement
bool Settlement::UpgradeBestBarrack(int)Description pending

Description pending.

RepairAll

Scans eligible settlement members and requests one repair command for each member that provides that command and passes the admission checks.

For each considered member, the first command named repair is used. Preliminary calculations determine whether a request is admitted; an admitted request submits one command. The name RepairAll does not guarantee admission of every building or immediate completion. The complete meaning of the costs, timing and subsequent effects remains unresolved.

Open full entry →
Settlement
void Settlement::RepairAll()

Scans eligible settlement members and requests one repair command for each member that provides that command and passes the admission checks.

TSRecruitArmy

Builds an ObjList and delegates Settlement tactical recruitment through TSH_RecruitArmy.vs and the universal command path.

Open full entry →
Settlement
ObjList Settlement::TSRecruitArmy(str, int)

Builds an ObjList and delegates Settlement tactical recruitment through TSH_RecruitArmy.vs and the universal command path.

TSGetAllBarracks

Filters settlement building handles into an ObjList of barracks candidates.

Open full entry →
Settlement
ObjList Settlement::TSGetAllBarracks()

Filters settlement building handles into an ObjList of barracks candidates.

TSGetAllArenae

Filters settlement building handles into an ObjList of arena candidates.

Open full entry →
Settlement
ObjList Settlement::TSGetAllArenae()

Filters settlement building handles into an ObjList of arena candidates.

TSGetAllTemples

Builds an ObjList of eligible settlement members derived from the race-specific temple class.

Open full entry →
Settlement
ObjList Settlement::TSGetAllTemples()

Builds an ObjList of eligible settlement members derived from the race-specific temple class.

BestArena

Selects a settlement member derived from BaseArena by the minimum unsigned adjusted score stored in an implementation field.

Open full entry →
Settlement
Building Settlement::BestArena()

Selects a settlement member derived from BaseArena by the minimum unsigned adjusted score stored in an implementation field.

TSArenaRecruit

Builds an ObjList and delegates Settlement tactical recruitment through TSH_ArenaRecruit.vs and the universal command path.

Open full entry →
Settlement
ObjList Settlement::TSArenaRecruit(int)

Builds an ObjList and delegates Settlement tactical recruitment through TSH_ArenaRecruit.vs and the universal command path.

TSRecruitHero

Dispatches a hero recruitment strategy script for a Settlement.

Open full entry →
Settlement
Hero Settlement::TSRecruitHero()

Dispatches a hero recruitment strategy script for a Settlement.

TSResearch

Applies a TSH_Research command script with a Settlement, research name and temporary result reference.

Open full entry →
Settlement
bool Settlement::TSResearch(str)

Applies a TSH_Research command script with a Settlement, research name and temporary result reference.

TSTempleRecruit

Builds an ObjList and delegates Settlement tactical recruitment through TSH_TempleRecruit.vs and the universal command path.

Open full entry →
Settlement
ObjList Settlement::TSTempleRecruit(int)

Builds an ObjList and delegates Settlement tactical recruitment through TSH_TempleRecruit.vs and the universal command path.

BestTemple

Chooses the lowest-scoring eligible race-specific temple in a settlement.

Open full entry →
Settlement
Building Settlement::BestTemple()

Chooses the lowest-scoring eligible race-specific temple in a settlement.

IsTeutonTent

Compares an associated settlement object's string to TTent and returns a one-byte boolean.

Open full entry →
Settlement
bool Settlement::IsTeutonTent()

Compares an associated settlement object's string to TTent and returns a one-byte boolean.

AIRun

Looks up the named AI script in the owning player's context and, if found, invokes it with the settlement as its context.

The argument is the name used to resolve the AI script path. The reviewed path directly invokes execution with a temporary context representing the same settlement. A missing script produces a diagnostic. Use a valid settlement. Resumption of scripts that wait and their subsequent effects are outside this entry.

Open full entry →
Settlement
void Settlement::AIRun(str)

Looks up the named AI script in the owning player's context and, if found, invokes it with the settlement as its context.

Return this type

14
MemberSignature and description
Building::settlementBuildingSettlement Building::settlement()

Resolves a Building's own Settlement-link field into a CKS Settlement reference.

Unit::GetHolderSettUnitSettlement Unit::GetHolderSett()

Unit::GetHolderSett derives a returned slot word through Unit [field], registry entry [field], and final entry [field].

GetSettlementGlobalSettlement GetSettlement(str)

Returns the first settlement whose name matches the supplied text.

Settlement::suppliedSettlementSettlement Settlement::supplied()

Follows a fixed chain of settlement registry references and returns the final settlement handle.

GAIKA::settlementGAIKASettlement GAIKA::settlement()

Returns the settlement handle attached to a GAIKA record, or a null handle.

Settlement::BestToSupplySettlementSettlement Settlement::BestToSupply()Description pending

Description pending.

IdxToSetGlobalSettlement IdxToSet(int)

IdxToSet returns the handle ID from an indexed global-map settlement pointer, or a null handle for an invalid or empty slot.

NearestStrongholdGlobalSettlement NearestStronghold(point, int, int)Description pending

Description pending.

NearestStrongholdGlobalSettlement NearestStronghold(point, int)Description pending

Description pending.

NearestStrongholdGlobalSettlement NearestStronghold(point)

NearestStronghold point overload selects the unfiltered BaseTownhall search.

NearestSetGlobalSettlement NearestSet(point, str, int, int)

NearestSet four-argument overload forwards the class, decremented player and supplied relation mask.

NearestSetGlobalSettlement NearestSet(point, str, int)

NearestSet three-argument overload forwards the class, decremented player and fixed mask one.

NearestSetGlobalSettlement NearestSet(point)

NearestSet point overload searches the Building central-building class without player filtering.

selsGlobalSettlement sels()

Returns the settlement associated with the currently selected settlement object, or the null handle.

Accept this type

20
MemberSignature and description
UnitsInSettlementGlobalQuery UnitsInSettlement(Settlement, str)Description pending

Description pending.

UnitsAroundSettlementGlobalQuery UnitsAroundSettlement(Settlement, str)Description pending

Description pending.

UnitsGuardingSettlementGlobalQuery UnitsGuardingSettlement(Settlement, str)Description pending

Description pending.

==Globalbool ==(Settlement, Settlement)Description pending

Description pending.

=Globalvoid =(Settlement&, Settlement)Description pending

Description pending.

Settlement::StartSupplyFoodSettlementvoid Settlement::StartSupplyFood(Settlement)Description pending

Description pending.

EnvWriteStringGlobalvoid EnvWriteString(Settlement, str, str)

CKS native primitive that writes a string value under a key into a settlement's Env key-value store.

EnvWriteIntGlobalvoid EnvWriteInt(Settlement, str, int)

Formats a settlement-scoped environment path and writes a decimal integer value.

EnvReadStringGlobalstr EnvReadString(Settlement, str)

Builds a settlement-scoped environment path and returns the string obtained from the environment lookup helper.

EnvReadIntGlobalint EnvReadInt(Settlement, str)

EnvReadInt builds a settlement property path and reads its integer value.

EnvWriteObjGlobalvoid EnvWriteObj(Settlement, str, Obj)Description pending

Description pending.

EnvReadObjGlobalObj EnvReadObj(Settlement, str)Description pending

Description pending.

EnvListGlobalvoid EnvList(Settlement, str)Description pending

Description pending.

RegisterSettlementUpgradeGlobalvoid RegisterSettlementUpgrade(Settlement, str)

Parses command-definition triples and dispatches settlement property writes.

AIRunGlobalint AIRun(str, Settlement, ObjList, Obj, int)

Starts a typed AI script task in the current script player's AI context and returns its task identifier.

AIRunGlobalint AIRun(int, str, Settlement, ObjList, Obj, int)

Attempts to start an AI script task for the supplied one-based player and returns its task identifier or -1.

SetToIdxGlobalint SetToIdx(Settlement)

SetToIdx reads the resolved Settlement slot-index field.

IsResearchedGlobalbool IsResearched(Settlement, str)

CKS scripting primitive evaluating whether a technology or upgrade has been researched, supporting both settlement-anchored and player-direct overloads.

IsResearchingGlobalbool IsResearching(Settlement, str)

CKS scripting primitive reporting whether a technology or upgrade is currently in the "researching" state, with a settlement-anchored overload and a player-direct overload.

GetCounterUnitsGlobalvoid GetCounterUnits(Settlement, IntArray)

Tries indexed AI candidates and dispatches a settlement fallback into the resolved integer-array destination.

Coverage and limits

126 / 139 members with a published description.

These lists come from published signatures. “Accept” counts explicit parameters, excluding the method receiver; reference variants (&) are included. No inheritance hierarchy is asserted. Undocumented names, units and effects remain unresolved.