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

Unit

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

117 members13 return it16 accept it

Members

117

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

MemberSignature and description
speed

Reads the linked speed dword for a Unit handle.

Open full entry →
Unit
int Unit::speed()

Reads the linked speed dword for a Unit handle.

speed_factor

Unit[field] defaults to 100, is exposed by the speed-factor getter/setter, and divides base step duration as a percentage.

Open full entry →
Unit
int Unit::speed_factor()

Unit[field] defaults to 100, is exposed by the speed-factor getter/setter, and divides base step duration as a percentage.

stamina

Reads the stamina dword for a Unit handle.

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

Reads the stamina dword for a Unit handle.

user

Reads the user dword for a Unit handle.

Open full entry →
Unit
int Unit::user()

Reads the user dword for a Unit handle.

food

Reads the food dword for a Unit handle.

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

Reads the food dword for a Unit handle.

maxfood

Reads the linked maximum food dword for a Unit handle.

Open full entry →
Unit
int Unit::maxfood()

Reads the linked maximum food dword for a Unit handle.

maxstamina

Reads the linked maximum stamina dword for a Unit handle.

Open full entry →
Unit
int Unit::maxstamina()

Reads the linked maximum stamina dword for a Unit handle.

experience

Scripting VM bridge reading the cumulative raw experience counter directly from unit [field].

Open full entry →
Unit
int Unit::experience()

Scripting VM bridge reading the cumulative raw experience counter directly from unit [field].

level

Scripting VM bridge calling virtual method vtable[[field]]() to obtain effective unit or hero level.

Open full entry →
Unit
int Unit::level()

Scripting VM bridge calling virtual method vtable[[field]]() to obtain effective unit or hero level.

inherentlevel

Scripting VM bridge computing unit inherent level on-the-fly from raw experience via LevelFromExp.

Open full entry →
Unit
int Unit::inherentlevel()

Scripting VM bridge computing unit inherent level on-the-fly from raw experience via LevelFromExp.

SetSpeedFactor

Stores a speed factor dword on a resolved Unit.

Open full entry →
Unit
void Unit::SetSpeedFactor(int)

Stores a speed factor dword on a resolved Unit.

SetUser

Stores a user dword on a resolved Unit.

Open full entry →
Unit
void Unit::SetUser(int)

Stores a user dword on a resolved Unit.

SetFood

Stores the supplied food value on a resolved Unit and dispatches a value-dependent virtual state update.

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

Stores the supplied food value on a resolved Unit and dispatches a value-dependent virtual state update.

feeds

Returns the resolved Unit's feeding flag as a byte.

Open full entry →
Unit
bool Unit::feeds()

Returns the resolved Unit's feeding flag as a byte.

SetFeeding

Updates the resolved Unit's feeding flag from a bool argument.

Open full entry →
Unit
void Unit::SetFeeding(bool)

Updates the resolved Unit's feeding flag from a bool argument.

Goto

Clamps the point to map bounds and coordinates a Unit path controller, movement command, wait ticks and terminal bool through native status 0, 1 or 2; its path destination call passes final flag 1.

Open full entry →
Unit
bool Unit::Goto(point, int, int, bool, int)

Clamps the point to map bounds and coordinates a Unit path controller, movement command, wait ticks and terminal bool through native status 0, 1 or 2; its path destination call passes final flag 1.

GotoEnter

Follows the point-route wait and completion branches while passing final flag 0 to the path destination call at [field]; the sibling Goto point handler passes 1.

Open full entry →
Unit
bool Unit::GotoEnter(point, int, int, bool, int)

Follows the point-route wait and completion branches while passing final flag 0 to the path destination call at [field]; the sibling Goto point handler passes 1.

Goto

Resolves an optional Obj and required Unit, clears Unit tracking at [field] when set, then delegates the movement state machine to [field]; invalid Unit pushes false.

Open full entry →
Unit
bool Unit::Goto(Obj, int, int, bool, int)

Resolves an optional Obj and required Unit, clears Unit tracking at [field] when set, then delegates the movement state machine to [field]; invalid Unit pushes false.

GotoAttack

Prepares target tracking and delegates cooperative attack routing.

Open full entry →
Unit
bool Unit::GotoAttack(Obj, int, bool, int)

Prepares target tracking and delegates cooperative attack routing.

GotoStraight

Constructs a path object on the first blocking invocation or reuses its saved pointer, calls its virtual [field] with a calculated step time, and returns native status 1 while a step remains or 0 after destroying the object.

Open full entry →
Unit
void Unit::GotoStraight(point)

Constructs a path object on the first blocking invocation or reuses its saved pointer, calls its virtual [field] with a calculated step time, and returns native status 1 while a step remains or 0 after destroying the object.

Stop

For a nonzero continuation state, clears target tracking and requests an active-path stop with wait status 1, or clears the controller and returns true. For zero state, checks a virtual path operation, returns its boolean outcome and clears a unit flag.

Open full entry →
Unit
bool Unit::Stop(int)

For a nonzero continuation state, clears target tracking and requests an active-path stop with wait status 1, or clears the controller and returns true. For zero state, checks a virtual path operation, returns its boolean outcome and clears a unit flag.

HasPath

Returns false for an invalid Unit or when a unit state field differs from -1. Otherwise checks an implementation operation for hero units with a particular flag, or a unit field for nonhero units. The field meanings are not documented.

Open full entry →
Unit
bool Unit::HasPath()

Returns false for an invalid Unit or when a unit state field differs from -1. Otherwise checks an implementation operation for hero units with a particular flag, or a unit field for nonhero units. The field meanings are not documented.

dest

Returns two signed 16-bit components from path-controller virtual [field] when Unit [field] exists, otherwise from Unit virtual [field]; an invalid Unit returns (-1,-1).

Open full entry →
Unit
point Unit::dest()

Returns two signed 16-bit components from path-controller virtual [field] when Unit [field] exists, otherwise from Unit virtual [field]; an invalid Unit returns (-1,-1).

TimeWithoutWalking

Unit::TimeWithoutWalking returns zero for sentinel -1 at Unit [field], otherwise subtracting it from the dword reached through Unit [field].

Open full entry →
Unit
int Unit::TimeWithoutWalking()

Unit::TimeWithoutWalking returns zero for sentinel -1 at Unit [field], otherwise subtracting it from the dword reached through Unit [field].

InHolder

Checks whether the resolved Unit records a holder reference different from the invalid-reference sentinel.

Open full entry →
Unit
bool Unit::InHolder()

Checks whether the resolved Unit records a holder reference different from the invalid-reference sentinel.

GetHolderSett

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

Open full entry →
Unit
Settlement Unit::GetHolderSett()

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

InShip

Follows the Unit holder handle and a linked registry handle, then returns whether the latter resolves.

Open full entry →
Unit
bool Unit::InShip()

Follows the Unit holder handle and a linked registry handle, then returns whether the latter resolves.

GetShip

Follows the Unit holder object's linked registry handle and returns that object's handle or an invalid Ship handle.

Open full entry →
Unit
Ship Unit::GetShip()

Follows the Unit holder object's linked registry handle and returns that object's handle or an invalid Ship handle.

ExitHolder

CKS-exposed Unit::ExitHolder passes a position to a reserve and movement path that can detach the Unit from its Holder.

Open full entry →
Unit
void Unit::ExitHolder(point)

CKS-exposed Unit::ExitHolder passes a position to a reserve and movement path that can detach the Unit from its Holder.

EnterHolder

CKS-exposed Unit::EnterHolder, resolving a Building argument's Settlement Holder and force-entering it.

Open full entry →
Unit
void Unit::EnterHolder(Obj)

CKS-exposed Unit::EnterHolder, resolving a Building argument's Settlement Holder and force-entering it.

GetUnitsInSameHolder

Returns the objects in the unit's holder as a new ObjList.

Open full entry →
Unit
ObjList Unit::GetUnitsInSameHolder()

Returns the objects in the unit's holder as a new ObjList.

TrainAttack

A Unit training-attack primitive that can start native attack mode 2 and return VM handler status 3.

Open full entry →
Unit
bool Unit::TrainAttack(Obj)

A Unit training-attack primitive that can start native attack mode 2 and return VM handler status 3.

BestTrainingTarget

Searches nearby candidates around a resolved Unit and returns the selected object's handle or an invalid handle.

Open full entry →
Unit
Obj Unit::BestTrainingTarget()

Searches nearby candidates around a resolved Unit and returns the selected object's handle or an invalid handle.

StartTraining

Invokes the flag-setting operation on the resolved Unit for a particular flag.

Open full entry →
Unit
void Unit::StartTraining()

Invokes the flag-setting operation on the resolved Unit for a particular flag.

StopTraining

Invokes the flag-clearing operation on the resolved Unit for a particular flag.

Open full entry →
Unit
void Unit::StopTraining()

Invokes the flag-clearing operation on the resolved Unit for a particular flag.

IsTraining

Unit::IsTraining extracts bit 28 from the resolved Unit object's dword at offset [field] and returns it as a boolean.

Open full entry →
Unit
bool Unit::IsTraining()

Unit::IsTraining extracts bit 28 from the resolved Unit object's dword at offset [field] and returns it as a boolean.

Attack

Implements a cooperative single-target attack sequence using continuation state, eligibility checks, attack dispatch, and wait status.

Open full entry →
Unit
bool Unit::Attack(Obj)

Implements a cooperative single-target attack sequence using continuation state, eligibility checks, attack dispatch, and wait status.

AttackEveryone

Implements a cooperative attack sequence with range and eligibility checks before dispatch.

Open full entry →
Unit
bool Unit::AttackEveryone(Obj)

Implements a cooperative attack sequence with range and eligibility checks before dispatch.

TimeWithoutAttack

Unit::TimeWithoutAttack returns the 32-bit subtraction [[shared state][field]] - [Unit[field]], with zero as the invalid-unit fallback.

Open full entry →
Unit
int Unit::TimeWithoutAttack()

Unit::TimeWithoutAttack returns the 32-bit subtraction [[shared state][field]] - [Unit[field]], with zero as the invalid-unit fallback.

SetLastAttackTime

Unit::SetLastAttackTime copies one 32-bit value from [shared state] offset [field] to the resolved Unit at offset [field].

Open full entry →
Unit
void Unit::SetLastAttackTime()

Unit::SetLastAttackTime copies one 32-bit value from [shared state] offset [field] to the resolved Unit at offset [field].

BestTargetInSquadSightMisZeroDamage

Resolves a Unit, verifies it is alive, and queries the squad sight targeting search engine function, returning the best target object handle.

Open full entry →
Unit
Obj Unit::BestTargetInSquadSightMisZeroDamage()

Resolves a Unit, verifies it is alive, and queries the squad sight targeting search engine function, returning the best target object handle.

BestTargetInSquadSight

Calls the squad-sight target search with zero option arguments after validating the Unit.

Open full entry →
Unit
Obj Unit::BestTargetInSquadSight()

Calls the squad-sight target search with zero option arguments after validating the Unit.

BestNoIndependentTargetInSquadSight

Calls squad-sight target search with the no-independent option set.

Open full entry →
Unit
Obj Unit::BestNoIndependentTargetInSquadSight()

Calls squad-sight target search with the no-independent option set.

BestTargetInSquadSight

Finds the best tactical target within squad sight matching the supplied class filter string.

Open full entry →
Unit
Obj Unit::BestTargetInSquadSight(str)

Finds the best tactical target within squad sight matching the supplied class filter string.

BestTargetInSquadSightExclusive

Calls squad-sight target search with string data and the exclusive option set.

Open full entry →
Unit
Obj Unit::BestTargetInSquadSightExclusive(str)

Calls squad-sight target search with string data and the exclusive option set.

BestTargetInSquadSight_PreferUndiseased

Calls squad-sight target search with the prefer-undiseased option set.

Open full entry →
Unit
Obj Unit::BestTargetInSquadSight_PreferUndiseased()

Calls squad-sight target search with the prefer-undiseased option set.

BestTargetForPos

searches for the best combat target for a unit using its current position and sight radius.

Open full entry →
Unit
Obj Unit::BestTargetForPos()

searches for the best combat target for a unit using its current position and sight radius.

BestTargetInRange

Forwards explicit point coordinates and integer radius to the common target-search helper.

Open full entry →
Unit
Obj Unit::BestTargetInRange(point, int)

Forwards explicit point coordinates and integer radius to the common target-search helper.

IsEnemyInSquadSight

For a valid live unit, returns whether the enemy record associated with its squad contains entries.

Reads an existing record. Captures verified true results for counts of 1 and 2 and false results for a count of 0. They do not establish when the record is refreshed or justify treating this call as a fresh distance, visibility or diplomacy scan. Subsequent behavior with dead units or invalid references is not fully documented.

Open full entry →
Unit
bool Unit::IsEnemyInSquadSight()

For a valid live unit, returns whether the enemy record associated with its squad contains entries.

EnemiesInSight

Builds a diplomacy-filtered spatial query around the Unit and returns whether a matching candidate was found.

Open full entry →
Unit
bool Unit::EnemiesInSight()

Builds a diplomacy-filtered spatial query around the Unit and returns whether a matching candidate was found.

InRange

Checks a resolved target against a resolved Unit using the common attack-range helper.

Open full entry →
Unit
bool Unit::InRange(Obj)

Checks a resolved target against a resolved Unit using the common attack-range helper.

hero

Returns an eight-byte Hero handle containing the resolved Unit's linked Hero slot.

Open full entry →
Unit
Hero Unit::hero()

Returns an eight-byte Hero handle containing the resolved Unit's linked Hero slot.

AttachTo

Resolves Unit and Hero, rejects invalid or virtual [field] positive operands, then returns whether Unit helper [field] accepts the Hero.

Open full entry →
Unit
bool Unit::AttachTo(Hero)

Resolves Unit and Hero, rejects invalid or virtual [field] positive operands, then returns whether Unit helper [field] accepts the Hero.

DetachFrom

After valid/dead checks, calls Unit helper [field] only when Hero [field] matches Unit [field].

Open full entry →
Unit
void Unit::DetachFrom(Hero)

After valid/dead checks, calls Unit helper [field] only when Hero [field] matches Unit [field].

Idle

With nonzero continuation, waits on the special virtual [field] coordinate pair; otherwise dispatches action 4 through [field], clears target tracking and returns native status 3. Zero continuation returns 0.

Open full entry →
Unit
void Unit::Idle(int)

With nonzero continuation, waits on the special virtual [field] coordinate pair; otherwise dispatches action 4 through [field], clears target tracking and returns native status 3. Zero continuation returns 0.

Taunt

With nonzero continuation, waits on the special virtual [field] coordinate pair; otherwise dispatches action 5 through [field], clears target tracking and returns native status 3. Zero continuation returns 0.

Open full entry →
Unit
void Unit::Taunt(int)

With nonzero continuation, waits on the special virtual [field] coordinate pair; otherwise dispatches action 5 through [field], clears target tracking and returns native status 3. Zero continuation returns 0.

SetExperience

Scripting VM bridge writing a raw experience value directly through the shared virtual experience setter.

Open full entry →
Unit
void Unit::SetExperience(int)

Scripting VM bridge writing a raw experience value directly through the shared virtual experience setter.

SetLevel

Scripting VM bridge clamping input level, looking up experience threshold, and calling virtual experience setter.

Open full entry →
Unit
void Unit::SetLevel(int)

Scripting VM bridge clamping input level, looking up experience threshold, and calling virtual experience setter.

IncKills

Adds an integer to the resolved Unit's kill counter field.

Open full entry →
Unit
void Unit::IncKills(int)

Adds an integer to the resolved Unit's kill counter field.

FormAcceptMove

After formation-state checks and possible holder waits, clears target tracking, creates a path controller when absent, passes formation field [field] to controller virtual [field], sets Unit [field] to 3, and returns status 0; ineligible state returns 2.

Open full entry →
Unit
void Unit::FormAcceptMove()

After formation-state checks and possible holder waits, clears target tracking, creates a path controller when absent, passes formation field [field] to controller virtual [field], sets Unit [field] to 3, and returns status 0; ineligible state returns 2.

FormKeepMoving

For nonzero continuation, clears target tracking, sets movement state 3 and a unit flag, stores wait ticks and reports status 1. For zero continuation, may clear a satisfied controller, clears the flag and reports status 0.

Open full entry →
Unit
void Unit::FormKeepMoving(int)

For nonzero continuation, clears target tracking, sets movement state 3 and a unit flag, stores wait ticks and reports status 1. For zero continuation, may clear a satisfied controller, clears the flag and reports status 0.

PathTo

Prepares a point-centered path query for a Unit and returns the native pathfinder result code or a sentinel.

Open full entry →
Unit
int Unit::PathTo(point, int, int)

Prepares a point-centered path query for a Unit and returns the native pathfinder result code or a sentinel.

PathTo

Prepares an object-centered path query for a Unit and returns the native pathfinder result code or a sentinel.

Open full entry →
Unit
int Unit::PathTo(Obj, int, int)

Prepares an object-centered path query for a Unit and returns the native pathfinder result code or a sentinel.

SetParty

Dispatches a resolved Unit to one of two game virtual operations according to a boolean argument.

Open full entry →
Unit
void Unit::SetParty(bool)

Dispatches a resolved Unit to one of two game virtual operations according to a boolean argument.

GetParty

Returns the registered Unit GetParty boolean for this function.

Open full entry →
Unit
bool Unit::GetParty()

Returns the registered Unit GetParty boolean for this function.

GetSacrifice

Invokes a Unit virtual handle provider and returns its first word as a Sacrifice handle.

Open full entry →
Unit
Sacrifice Unit::GetSacrifice()

Invokes a Unit virtual handle provider and returns its first word as a Sacrifice handle.

_OnImpassable

Tests a packed global-map bit at the resolved Unit's virtual position.

Open full entry →
Unit
bool Unit::_OnImpassable()

Tests a packed global-map bit at the resolved Unit's virtual position.

GetUnexploredPoint

Returns a random unexplored point near the unit, or the point (-1, -1) when it finds none.

With argument -1 the search window is about four times a unit field (probably its sight), between 512 and 3000 map units square. It can return (-1, -1) while much of the map is still unexplored. The game uses it in the Explore order.

Open full entry →
Unit
point Unit::GetUnexploredPoint(int)

Returns a random unexplored point near the unit, or the point (-1, -1) when it finds none.

HasFreedom

Combines a Unit flag test with a class helper to return a boolean.

Open full entry →
Unit
bool Unit::HasFreedom()

Combines a Unit flag test with a class helper to return a boolean.

GetFlags

Returns the registered Unit GetFlags boolean for this function.

Open full entry →
Unit
bool Unit::GetFlags(int)

Returns the registered Unit GetFlags boolean for this function.

PathLeft

Returns a value from the Unit's [field] controller virtual method, or sentinel 900000000 when unavailable.

Open full entry →
Unit
int Unit::PathLeft()

Returns a value from the Unit's [field] controller virtual method, or sentinel 900000000 when unavailable.

GetShipToBoard

Behavior awaiting documentation.

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

Open full entry →
Unit
Ship Unit::GetShipToBoard()Description pending

Description pending.

GetStaminaDecTime

Returns the nonnegative part of a resolved Unit's signed stamina decrement time field.

Open full entry →
Unit
int Unit::GetStaminaDecTime()

Returns the nonnegative part of a resolved Unit's signed stamina decrement time field.

SameHolderAs

Compares the holder-handle words of two resolved Units.

Open full entry →
Unit
bool Unit::SameHolderAs(Unit)

Compares the holder-handle words of two resolved Units.

SetCommanded

Sets or clears bit 19 of a resolved Unit's state flags.

Open full entry →
Unit
void Unit::SetCommanded(bool)

Sets or clears bit 19 of a resolved Unit's state flags.

GetCommanded

Reads bit 19 of a resolved Unit's state flags as a boolean.

Open full entry →
Unit
bool Unit::GetCommanded()

Reads bit 19 of a resolved Unit's state flags as a boolean.

SetEntering

Sets or clears bit 20 of a resolved Unit's state flags.

Open full entry →
Unit
void Unit::SetEntering(bool)

Sets or clears bit 20 of a resolved Unit's state flags.

GetEntering

Reads bit 20 of a resolved Unit's state flags as a boolean.

Open full entry →
Unit
bool Unit::GetEntering()

Reads bit 20 of a resolved Unit's state flags as a boolean.

SetWalkAnim

Selects the unit's walking animation from the supplied index. This call does not issue a movement order.

The integer overload stores the supplied index minus one in a 16-bit selector. In verified captures, SetWalkAnim(13) selected internal index 12. The no-argument overload is distinct. Safe indices for each template and subsequent behavior with out-of-range indices or invalid references are not established.

Open full entry →
Unit
void Unit::SetWalkAnim(int)

Selects the unit's walking animation from the supplied index. This call does not issue a movement order.

SetWalkAnim

Unit[field] is the current zero-based animation index; the no-argument SetWalkAnim selects index zero and the int overload stores argument minus one.

Open full entry →
Unit
void Unit::SetWalkAnim()

Unit[field] is the current zero-based animation index; the no-argument SetWalkAnim selects index zero and the int overload stores argument minus one.

SetCarryWaterAnim

Selects the carry-water animation for recognized ambient-villager templates. The call selects an animation; it does not collect or transfer resources.

The implementation recognizes GWVillagerAmbient, RWVillagerAmbient, MWVillagerAmbient, TWVillagerAmbient, CWVillagerAmbient, IWVillagerAmbient, BWVillagerAmbient and EWVillagerAmbient, selecting internal index 16. A nonmatching template leaves the selector unchanged. Captures verified calls that reached the selection, but did not visually test all eight templates or exercise the nonmatching branch. Invalid references require separate verification.

Open full entry →
Unit
void Unit::SetCarryWaterAnim()

Selects the carry-water animation for recognized ambient-villager templates. The call selects an animation; it does not collect or transfer resources.

SetCarryGoodsAnim

Maps recognized villager ambient template names to one of two carry-goods animation state values.

Open full entry →
Unit
void Unit::SetCarryGoodsAnim()

Maps recognized villager ambient template names to one of two carry-goods animation state values.

DoCarryNothing

Tests whether a resolved Unit's carry animation selector is zero.

Open full entry →
Unit
bool Unit::DoCarryNothing()

Tests whether a resolved Unit's carry animation selector is zero.

Disappear

Clears the unit's command state. In verified calls, it also moved the unit to (-1, -1), away from its map position.

Captured units retained their health, and one visual representation became null. This does not establish death, removal of the reference or automatic restoration. Game scripts use additional operations to save the position and restore it later; that complete sequence was not verified in these captures. Subsequent effects and invalid references remain unresolved.

Open full entry →
Unit
void Unit::Disappear()

Clears the unit's command state. In verified calls, it also moved the unit to (-1, -1), away from its map position.

SetNoselectFlag

Clears Unit [field] bit [field] and sets it when the bool argument is nonzero.

Open full entry →
Unit
void Unit::SetNoselectFlag(bool)

Clears Unit [field] bit [field] and sets it when the bool argument is nonzero.

SetMinimapFlag

Sets or clears the Unit minimap flag from a bool argument.

Open full entry →
Unit
void Unit::SetMinimapFlag(bool)

Sets or clears the Unit minimap flag from a bool argument.

SetNoAIFlag

Clears a unit flag, then sets it if the boolean argument is nonzero.

Open full entry →
Unit
void Unit::SetNoAIFlag(bool)

Clears a unit flag, then sets it if the boolean argument is nonzero.

PathDestFound

When Unit [field] exists and its virtual [field] returns nonzero, returns the point from path virtual [field]; otherwise returns (-1,-1).

Open full entry →
Unit
point Unit::PathDestFound()

When Unit [field] exists and its virtual [field] returns nonzero, returns the point from path virtual [field]; otherwise returns (-1,-1).

ForceIdle

Unit::ForceIdle pops an 8-byte Unit handle, validates it through the global unit registry, and writes 32-bit integer 1 into unit offset [field].

Open full entry →
Unit
void Unit::ForceIdle()

Unit::ForceIdle pops an 8-byte Unit handle, validates it through the global unit registry, and writes 32-bit integer 1 into unit offset [field].

Talk

Passes a resolved Unit to helper [field] and returns native status zero; invalid Unit skips the call.

Open full entry →
Unit
void Unit::Talk()

Passes a resolved Unit to helper [field] and returns native status zero; invalid Unit skips the call.

IsCursed

Reads one Unit flag bit as a CKS bool.

Open full entry →
Unit
bool Unit::IsCursed()

Reads one Unit flag bit as a CKS bool.

IsDiseased

Reads one Unit flag bit as a CKS bool.

Open full entry →
Unit
bool Unit::IsDiseased()

Reads one Unit flag bit as a CKS bool.

GetBestCurseTarget

Configures target filters and delegates curse-target selection to spatial or squad-aware search helpers.

Open full entry →
Unit
Unit Unit::GetBestCurseTarget()

Configures target filters and delegates curse-target selection to spatial or squad-aware search helpers.

GetBuilding

Returns a Building handle containing the resolved Unit's linked Building slot.

Open full entry →
Unit
Building Unit::GetBuilding()

Returns a Building handle containing the resolved Unit's linked Building slot.

SetBuilding

Unit::SetBuilding writes the Building argument's 16-bit registry slot to Unit [field], or 65535 when the Building does not resolve.

Open full entry →
Unit
void Unit::SetBuilding(Building)

Unit::SetBuilding writes the Building argument's 16-bit registry slot to Unit [field], or 65535 when the Building does not resolve.

HasSpecial

Tests an indexed bit in the Unit special mask.

Open full entry →
Unit
bool Unit::HasSpecial(int)

Tests an indexed bit in the Unit special mask.

SetSpecial

For index below 36, a nonzero bool ORs its shifted bit into Unit [field], while false calls [field] to clear it; invalid Unit or out-of-range index is skipped.

Open full entry →
Unit
void Unit::SetSpecial(int, bool)

For index below 36, a nonzero bool ORs its shifted bit into Unit [field], while false calls [field] to clear it; invalid Unit or out-of-range index is skipped.

SpecialName

Builds a script string from a Unit special-name table entry or fallback.

Open full entry →
Unit
str Unit::SpecialName(int)

Builds a script string from a Unit special-name table entry or fallback.

GetParryMode

Unit[field] bit 0 gates parry support, while Unit[field] stores the Boolean mode changed by SetParryMode and returned by GetParryMode.

Open full entry →
Unit
int Unit::GetParryMode()

Unit[field] bit 0 gates parry support, while Unit[field] stores the Boolean mode changed by SetParryMode and returned by GetParryMode.

SetParryMode

Changes parry mode when the Unit capability bit allows it.

Open full entry →
Unit
void Unit::SetParryMode(bool)

Changes parry mode when the Unit capability bit allows it.

Curse

Delegates a resolved Unit to a status-effect helper with mode zero.

Open full entry →
Unit
void Unit::Curse()

Delegates a resolved Unit to a status-effect helper with mode zero.

Bless

Delegates a resolved Unit to a status-effect helper with mode one.

Open full entry →
Unit
void Unit::Bless()

Delegates a resolved Unit to a status-effect helper with mode one.

Disease

Sets a Unit disease flag and creates an effect when its slot is empty.

Open full entry →
Unit
void Unit::Disease()

Sets a Unit disease flag and creates an effect when its slot is empty.

RamBestTarget

Runs a bounded spatial candidate query and emits an Obj handle.

Open full entry →
Unit
Obj Unit::RamBestTarget()

Runs a bounded spatial candidate query and emits an Obj handle.

Mutate

Resolves a named class template and dispatches Unit mutation or a deferred mutation state.

Open full entry →
Unit
void Unit::Mutate(str)

Resolves a named class template and dispatches Unit mutation or a deferred mutation state.

RecalcBonuses

Calls a resolved Unit's virtual bonus recalculation slot.

Open full entry →
Unit
void Unit::RecalcBonuses()

Calls a resolved Unit's virtual bonus recalculation slot.

AddBonus

Builds a bonus descriptor, adds it to a Unit-linked collection, and recalculates bonuses.

Open full entry →
Unit
void Unit::AddBonus(int, int, int, int, int)

Builds a bonus descriptor, adds it to a Unit-linked collection, and recalculates bonuses.

RemoveBonus

Subtracts a bonus descriptor from a Unit-linked collection and recalculates bonuses.

Open full entry →
Unit
void Unit::RemoveBonus(int, int, int, int, int)

Subtracts a bonus descriptor from a Unit-linked collection and recalculates bonuses.

GetAnimDuration

Behavior awaiting documentation.

Open full entry →
Unit
int Unit::GetAnimDuration(int)Description pending

Description pending.

dir

Returns two 32-bit components from the resolved Unit as a point.

Open full entry →
Unit
point Unit::dir()

Returns two 32-bit components from the resolved Unit as a point.

GetSquad

Returns the zero-extended squad word linked from a resolved Unit.

Open full entry →
Unit
Squad Unit::GetSquad()

Returns the zero-extended squad word linked from a resolved Unit.

BestTargetInGAIKA

Returns a target object handle selected by the GAIKA target search helper for a resolved Unit.

Open full entry →
Unit
Obj Unit::BestTargetInGAIKA()

Returns a target object handle selected by the GAIKA target search helper for a resolved Unit.

AI

Queries whether a unit is controlled by AI by verifying player AI state and checking the squad record's active AI flag.

Open full entry →
Unit
bool Unit::AI()

Queries whether a unit is controlled by AI by verifying player AI state and checking the squad record's active AI flag.

BestMDPos

Ranks filtered hostile squad leaders by a circle relation count with optional friendly penalties and a distance bonus.

Open full entry →
Unit
point Unit::BestMDPos(int, int, int, int, bool)

Ranks filtered hostile squad leaders by a circle relation count with optional friendly penalties and a distance bonus.

BestProtPos

Scores hostile squad leader neighborhoods by relation-count balance and a product, preferring a normal leader result over a same-player sacrifice override.

Open full entry →
Unit
Obj Unit::BestProtPos(int, int, int, int)

Scores hostile squad leader neighborhoods by relation-count balance and a product, preferring a normal leader result over a same-player sacrifice override.

GetAnimState

Maps the resolved Unit's [field] state integer according to a global animation mode predicate.

Open full entry →
Unit
int Unit::GetAnimState()

Maps the resolved Unit's [field] state integer according to a global animation mode predicate.

SetFreedom

Applies a bool argument to the Unit freedom state bit.

Open full entry →
Unit
void Unit::SetFreedom(bool)

Applies a bool argument to the Unit freedom state bit.

Return this type

13
MemberSignature and description
Obj::AsUnitObjUnit Obj::AsUnit()

Returns a Unit reference when the object has a compatible unit category.

Unit::GetBestCurseTargetUnitUnit Unit::GetBestCurseTarget()

Configures target filters and delegates curse-target selection to spatial or squad-aware search helpers.

Druid::FindUnitToHealDruidUnit Druid::FindUnitToHeal()Description pending

Description pending.

Druid::FindUnitToLearnDruidUnit Druid::FindUnitToLearn()

CKS-exposed AI helper that scans for an ally to apply an experience-gain effect to, sharing the same vision-range/eligibility pattern as the druid's other target-search helpers.

Druid::FindUnitToHideDruidUnit Druid::FindUnitToHide()

CKS-exposed AI helper that scans for an ally to apply an invisibility-style effect to, sharing the same vision-range/eligibility pattern as the druid's other target-search helpers.

Druid::GetBestCrippleTargetDruidUnit Druid::GetBestCrippleTarget()

CKS target selector that chooses the greatest positive [field] score among eligible candidates from a squad-member traversal or a radius-bounded map traversal.

Druid::FindUnitToRevitalizeDruidUnit Druid::FindUnitToRevitalize()

CKS-exposed AI helper that scans for a drained ally to recharge, sharing the same vision-range/eligibility pattern as the druid's other target-search helpers.

Druid::FindUnitBelowILevelDruidUnit Druid::FindUnitBelowILevel(int)

CKS Druid adapter that searches within receiver [field] and validates one spatially selected candidate against a strict experience-derived level threshold.

Druid::FindUnitBelowILevelDruidUnit Druid::FindUnitBelowILevel(int, int)Description pending

Description pending.

Druid::GetJupiterAngerTargetDruidUnit Druid::GetJupiterAngerTarget()

CKS Jupiter Anger target adapter that allocates an output registry slot for an eligible target without clearing the stored target field.

Ship::BestCandidateToBoardShipUnit Ship::BestCandidateToBoard()Description pending

Description pending.

Squad::LeaderSquadUnit Squad::Leader()

CKS scripting bridge resolving a squad's leading unit handle from the head of its member collection.

seluGlobalUnit selu()

Returns the currently selected unit handle, or the null handle when the selected object is not a unit.

Accept this type

16
MemberSignature and description
Building::GetEnterPointBuildingpoint Building::GetEnterPoint(Unit)

calculates the entrance point coordinates of a building relative to an approaching unit.

Unit::SameHolderAsUnitbool Unit::SameHolderAs(Unit)

Compares the holder-handle words of two resolved Units.

Druid::SetJupiterAngerTargetDruidvoid Druid::SetJupiterAngerTarget(Unit)Description pending

Description pending.

Settlement::ForceAddUnitSettlementvoid Settlement::ForceAddUnit(Unit)

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

Settlement::AddUnitSettlementbool Settlement::AddUnit(Unit)

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

Settlement::CanBeCapturedSettlementbool Settlement::CanBeCaptured(Unit)Description pending

Description pending.

Conversation::SetActorConversationvoid Conversation::SetActor(str, Unit)Description pending

Description pending.

StartViewFollowGlobalvoid StartViewFollow(Unit)

StartViewFollow resolves the target unit and activates camera tracking by setting [shared state] at [field] to 1 and storing the unit ID at [field].

CreateFeedbackGlobalvoid CreateFeedback(str, Unit)

Resolves a Unit and a feedback class name, looks up its class template, and spawns the feedback visual/audio effect.

CreateFeedbackGlobalvoid CreateFeedback(str, Unit, int)

Resolves a unit and named class and dispatches feedback construction with the supplied duration integer.

Ship::NotifyBoardUnitShipvoid Ship::NotifyBoardUnit(Unit)

Resolves Ship and Unit references and conditionally invokes the native boarding notification admission helper.

Ship::BoardUnitShipbool Ship::BoardUnit(Unit)Description pending

Description pending.

Ship::NotifyBoardUnitCancelShipvoid Ship::NotifyBoardUnitCancel(Unit)Description pending

Description pending.

Squad::EvalAttachSquadint Squad::EvalAttach(Unit, int)

Scores a candidate unit using squad size, affiliation equality and its virtual level result.

GAIKA::GetDestPointGAIKApoint GAIKA::GetDestPoint(Unit)

Returns a stored destination or derives an approach point for selected building configurations.

AIH_UnitBuiltGlobalvoid AIH_UnitBuilt(Unit)

Resolves the Unit operand and dispatches the resulting pointer to a native AI hook.

Coverage and limits

115 / 117 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.