Unit
Browse its members and the signatures that accept or return this type.
Members
117Expand a member to read its notes or open its full entry. Each overload keeps its own identity.
| Member | Signature and description |
|---|---|
| Unit | int Unit::speed()Reads the linked speed dword for a Unit handle. |
| 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. |
| Unit | int Unit::stamina()Reads the stamina dword for a Unit handle. |
| Unit | int Unit::user()Reads the user dword for a Unit handle. |
| Unit | int Unit::food()Reads the food dword for a Unit handle. |
| Unit | int Unit::maxfood()Reads the linked maximum food dword for a Unit handle. |
| Unit | int Unit::maxstamina()Reads the linked maximum stamina dword for a Unit handle. |
| int Unit::experience()Scripting VM bridge reading the cumulative raw experience counter directly from unit [field]. |
| int Unit::level()Scripting VM bridge calling virtual method vtable[[field]]() to obtain effective unit or hero level. |
| int Unit::inherentlevel()Scripting VM bridge computing unit inherent level on-the-fly from raw experience via LevelFromExp. |
| Unit | void Unit::SetSpeedFactor(int)Stores a speed factor dword on a resolved Unit. |
| Unit | void Unit::SetUser(int)Stores a user dword on a resolved Unit. |
| void Unit::SetFood(int)Stores the supplied food value on a resolved Unit and dispatches a value-dependent virtual state update. |
| Unit | bool Unit::feeds()Returns the resolved Unit's feeding flag as a byte. |
| Unit | void Unit::SetFeeding(bool)Updates the resolved Unit's feeding flag from a bool argument. |
| 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. |
| 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. |
| 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. |
| Unit | bool Unit::GotoAttack(Obj, int, bool, int)Prepares target tracking and delegates cooperative attack routing. |
| 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. |
| 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. |
| 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. |
| 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). |
| int Unit::TimeWithoutWalking()Unit::TimeWithoutWalking returns zero for sentinel -1 at Unit [field], otherwise subtracting it from the dword reached through Unit [field]. |
| bool Unit::InHolder()Checks whether the resolved Unit records a holder reference different from the invalid-reference sentinel. |
| Settlement Unit::GetHolderSett()Unit::GetHolderSett derives a returned slot word through Unit [field], registry entry [field], and final entry [field]. |
| bool Unit::InShip()Follows the Unit holder handle and a linked registry handle, then returns whether the latter resolves. |
| Ship Unit::GetShip()Follows the Unit holder object's linked registry handle and returns that object's handle or an invalid Ship handle. |
| 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. |
| void Unit::EnterHolder(Obj)CKS-exposed Unit::EnterHolder, resolving a Building argument's Settlement Holder and force-entering it. |
| Unit | ObjList Unit::GetUnitsInSameHolder()Returns the objects in the unit's holder as a new ObjList. |
| bool Unit::TrainAttack(Obj)A Unit training-attack primitive that can start native attack mode 2 and return VM handler status 3. |
| Obj Unit::BestTrainingTarget()Searches nearby candidates around a resolved Unit and returns the selected object's handle or an invalid handle. |
| void Unit::StartTraining()Invokes the flag-setting operation on the resolved Unit for a particular flag. |
| void Unit::StopTraining()Invokes the flag-clearing operation on the resolved Unit for a particular flag. |
| bool Unit::IsTraining()Unit::IsTraining extracts bit 28 from the resolved Unit object's dword at offset [field] and returns it as a boolean. |
| bool Unit::Attack(Obj)Implements a cooperative single-target attack sequence using continuation state, eligibility checks, attack dispatch, and wait status. |
| bool Unit::AttackEveryone(Obj)Implements a cooperative attack sequence with range and eligibility checks before dispatch. |
| int Unit::TimeWithoutAttack()Unit::TimeWithoutAttack returns the 32-bit subtraction [[shared state][field]] - [Unit[field]], with zero as the invalid-unit fallback. |
| void Unit::SetLastAttackTime()Unit::SetLastAttackTime copies one 32-bit value from [shared state] offset [field] to the resolved Unit at offset [field]. |
| 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. |
| Obj Unit::BestTargetInSquadSight()Calls the squad-sight target search with zero option arguments after validating the Unit. |
| Obj Unit::BestNoIndependentTargetInSquadSight()Calls squad-sight target search with the no-independent option set. |
| Obj Unit::BestTargetInSquadSight(str)Finds the best tactical target within squad sight matching the supplied class filter string. |
| Obj Unit::BestTargetInSquadSightExclusive(str)Calls squad-sight target search with string data and the exclusive option set. |
| Obj Unit::BestTargetInSquadSight_PreferUndiseased()Calls squad-sight target search with the prefer-undiseased option set. |
| Obj Unit::BestTargetForPos()searches for the best combat target for a unit using its current position and sight radius. |
| Obj Unit::BestTargetInRange(point, int)Forwards explicit point coordinates and integer radius to the common target-search helper. |
| bool Unit::IsEnemyInSquadSight()For a valid live unit, returns whether the enemy record associated with its squad contains entries. |
| bool Unit::EnemiesInSight()Builds a diplomacy-filtered spatial query around the Unit and returns whether a matching candidate was found. |
| bool Unit::InRange(Obj)Checks a resolved target against a resolved Unit using the common attack-range helper. |
| Hero Unit::hero()Returns an eight-byte Hero handle containing the resolved Unit's linked Hero slot. |
| bool Unit::AttachTo(Hero)Resolves Unit and Hero, rejects invalid or virtual [field] positive operands, then returns whether Unit helper [field] accepts the Hero. |
| void Unit::DetachFrom(Hero)After valid/dead checks, calls Unit helper [field] only when Hero [field] matches Unit [field]. |
| 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. |
| 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. |
| void Unit::SetExperience(int)Scripting VM bridge writing a raw experience value directly through the shared virtual experience setter. |
| void Unit::SetLevel(int)Scripting VM bridge clamping input level, looking up experience threshold, and calling virtual experience setter. |
| Unit | void Unit::IncKills(int)Adds an integer to the resolved Unit's kill counter field. |
| 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. |
| 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. |
| 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. |
| 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. |
| void Unit::SetParty(bool)Dispatches a resolved Unit to one of two game virtual operations according to a boolean argument. |
| Unit | bool Unit::GetParty()Returns the registered Unit GetParty boolean for this function. |
| Sacrifice Unit::GetSacrifice()Invokes a Unit virtual handle provider and returns its first word as a Sacrifice handle. |
| bool Unit::_OnImpassable()Tests a packed global-map bit at the resolved Unit's virtual position. |
| point Unit::GetUnexploredPoint(int)Returns a random unexplored point near the unit, or the point (-1, -1) when it finds none. |
| Unit | bool Unit::HasFreedom()Combines a Unit flag test with a class helper to return a boolean. |
| Unit | bool Unit::GetFlags(int)Returns the registered Unit GetFlags boolean for this function. |
| int Unit::PathLeft()Returns a value from the Unit's [field] controller virtual method, or sentinel 900000000 when unavailable. |
| Ship Unit::GetShipToBoard()Description pendingDescription pending. |
| int Unit::GetStaminaDecTime()Returns the nonnegative part of a resolved Unit's signed stamina decrement time field. |
| Unit | bool Unit::SameHolderAs(Unit)Compares the holder-handle words of two resolved Units. |
| Unit | void Unit::SetCommanded(bool)Sets or clears bit 19 of a resolved Unit's state flags. |
| Unit | bool Unit::GetCommanded()Reads bit 19 of a resolved Unit's state flags as a boolean. |
| Unit | void Unit::SetEntering(bool)Sets or clears bit 20 of a resolved Unit's state flags. |
| Unit | bool Unit::GetEntering()Reads bit 20 of a resolved Unit's state flags as a boolean. |
| void Unit::SetWalkAnim(int)Selects the unit's walking animation from the supplied index. This call does not issue a movement order. |
| 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. |
| 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. |
| void Unit::SetCarryGoodsAnim()Maps recognized villager ambient template names to one of two carry-goods animation state values. |
| Unit | bool Unit::DoCarryNothing()Tests whether a resolved Unit's carry animation selector is zero. |
| 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. |
| void Unit::SetNoselectFlag(bool)Clears Unit [field] bit [field] and sets it when the bool argument is nonzero. |
| Unit | void Unit::SetMinimapFlag(bool)Sets or clears the Unit minimap flag from a bool argument. |
| Unit | void Unit::SetNoAIFlag(bool)Clears a unit flag, then sets it if the boolean argument is nonzero. |
| point Unit::PathDestFound()When Unit [field] exists and its virtual [field] returns nonzero, returns the point from path virtual [field]; otherwise returns (-1,-1). |
| 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]. |
| void Unit::Talk()Passes a resolved Unit to helper [field] and returns native status zero; invalid Unit skips the call. |
| Unit | bool Unit::IsCursed()Reads one Unit flag bit as a CKS bool. |
| Unit | bool Unit::IsDiseased()Reads one Unit flag bit as a CKS bool. |
| Unit Unit::GetBestCurseTarget()Configures target filters and delegates curse-target selection to spatial or squad-aware search helpers. |
| Building Unit::GetBuilding()Returns a Building handle containing the resolved Unit's linked Building slot. |
| 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. |
| Unit | bool Unit::HasSpecial(int)Tests an indexed bit in the Unit special mask. |
| 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. |
| str Unit::SpecialName(int)Builds a script string from a Unit special-name table entry or fallback. |
| int Unit::GetParryMode()Unit[field] bit 0 gates parry support, while Unit[field] stores the Boolean mode changed by SetParryMode and returned by GetParryMode. |
| Unit | void Unit::SetParryMode(bool)Changes parry mode when the Unit capability bit allows it. |
| Unit | void Unit::Curse()Delegates a resolved Unit to a status-effect helper with mode zero. |
| Unit | void Unit::Bless()Delegates a resolved Unit to a status-effect helper with mode one. |
| Unit | void Unit::Disease()Sets a Unit disease flag and creates an effect when its slot is empty. |
| Unit | Obj Unit::RamBestTarget()Runs a bounded spatial candidate query and emits an Obj handle. |
| void Unit::Mutate(str)Resolves a named class template and dispatches Unit mutation or a deferred mutation state. |
| Unit | void Unit::RecalcBonuses()Calls a resolved Unit's virtual bonus recalculation slot. |
| void Unit::AddBonus(int, int, int, int, int)Builds a bonus descriptor, adds it to a Unit-linked collection, and recalculates bonuses. |
| void Unit::RemoveBonus(int, int, int, int, int)Subtracts a bonus descriptor from a Unit-linked collection and recalculates bonuses. |
| Unit | int Unit::GetAnimDuration(int)Description pendingDescription pending. |
| Unit | point Unit::dir()Returns two 32-bit components from the resolved Unit as a point. |
| Unit | Squad Unit::GetSquad()Returns the zero-extended squad word linked from a resolved Unit. |
| Obj Unit::BestTargetInGAIKA()Returns a target object handle selected by the GAIKA target search helper for a resolved 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. |
| 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. |
| 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. |
| int Unit::GetAnimState()Maps the resolved Unit's [field] state integer according to a global animation mode predicate. |
| Unit | void Unit::SetFreedom(bool)Applies a bool argument to the Unit freedom state bit. |
Return this type
13| Member | Signature and description |
|---|---|
Obj::AsUnitObj | Unit Obj::AsUnit()Returns a Unit reference when the object has a compatible unit category. |
Unit::GetBestCurseTargetUnit | Unit Unit::GetBestCurseTarget()Configures target filters and delegates curse-target selection to spatial or squad-aware search helpers. |
Druid::FindUnitToHealDruid | Unit Druid::FindUnitToHeal()Description pendingDescription pending. |
Druid::FindUnitToLearnDruid | Unit 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::FindUnitToHideDruid | Unit 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::GetBestCrippleTargetDruid | Unit 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::FindUnitToRevitalizeDruid | Unit 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::FindUnitBelowILevelDruid | Unit 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::FindUnitBelowILevelDruid | Unit Druid::FindUnitBelowILevel(int, int)Description pendingDescription pending. |
Druid::GetJupiterAngerTargetDruid | Unit Druid::GetJupiterAngerTarget()CKS Jupiter Anger target adapter that allocates an output registry slot for an eligible target without clearing the stored target field. |
Ship::BestCandidateToBoardShip | Unit Ship::BestCandidateToBoard()Description pendingDescription pending. |
Squad::LeaderSquad | Unit Squad::Leader()CKS scripting bridge resolving a squad's leading unit handle from the head of its member collection. |
seluGlobal | Unit selu()Returns the currently selected unit handle, or the null handle when the selected object is not a unit. |
Accept this type
16| Member | Signature and description |
|---|---|
Building::GetEnterPointBuilding | point Building::GetEnterPoint(Unit)calculates the entrance point coordinates of a building relative to an approaching unit. |
Unit::SameHolderAsUnit | bool Unit::SameHolderAs(Unit)Compares the holder-handle words of two resolved Units. |
Druid::SetJupiterAngerTargetDruid | void Druid::SetJupiterAngerTarget(Unit)Description pendingDescription pending. |
Settlement::ForceAddUnitSettlement | void Settlement::ForceAddUnit(Unit)CKS-exposed Settlement::ForceAddUnit, adding a unit to the settlement's Holder bypassing capacity. |
Settlement::AddUnitSettlement | bool Settlement::AddUnit(Unit)CKS-exposed Settlement::AddUnit, adding a unit to the settlement's Holder without bypassing capacity. |
Settlement::CanBeCapturedSettlement | bool Settlement::CanBeCaptured(Unit)Description pendingDescription pending. |
Conversation::SetActorConversation | void Conversation::SetActor(str, Unit)Description pendingDescription pending. |
StartViewFollowGlobal | void 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]. |
CreateFeedbackGlobal | void CreateFeedback(str, Unit)Resolves a Unit and a feedback class name, looks up its class template, and spawns the feedback visual/audio effect. |
CreateFeedbackGlobal | void CreateFeedback(str, Unit, int)Resolves a unit and named class and dispatches feedback construction with the supplied duration integer. |
Ship::NotifyBoardUnitShip | void Ship::NotifyBoardUnit(Unit)Resolves Ship and Unit references and conditionally invokes the native boarding notification admission helper. |
Ship::BoardUnitShip | bool Ship::BoardUnit(Unit)Description pendingDescription pending. |
Ship::NotifyBoardUnitCancelShip | void Ship::NotifyBoardUnitCancel(Unit)Description pendingDescription pending. |
Squad::EvalAttachSquad | int Squad::EvalAttach(Unit, int)Scores a candidate unit using squad size, affiliation equality and its virtual level result. |
GAIKA::GetDestPointGAIKA | point GAIKA::GetDestPoint(Unit)Returns a stored destination or derives an approach point for selected building configurations. |
AIH_UnitBuiltGlobal | void 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.