Home › Native functions › Unit

Engine internals. No scripting access today. Listed for contributors and for understanding the game; using it needs a change to the game library.

Unit

Function Signature (Linux) Symbol Current From Lua Notes
Archaeology::SetHomeCityCallback void Unit::Archaeology::SetHomeCityCallback(Unit::Archaeology* this) 0x392a80 0x394fe0 Dev CE (experimental): Unit.SetHomeCityCallback writes
Espionage::AddEspionageTimeReduction void Unit::Espionage::AddEspionageTimeReduction(Unit::Espionage* this, UnitOperationTypes eOperation, int iReductionPercent) 0x393810 0x395d70 Dev CE (experimental): Unit.AddEspionageTimeReduction writes; called by EFFECT_ADJUST_UNIT_SPY_OFFENSIVE_OPERATION_TIME, EFFECT_ADJUST_UNIT_SPY_OPERATION_TIME
Espionage::RemoveEspionageTimeReduction void Unit::Espionage::RemoveEspionageTimeReduction(Unit::Espionage* this, UnitOperationTypes eOperation, int iReductionPercent) 0x393cb0 0x396210 Dev CE (experimental): Unit.RemoveEspionageTimeReduction writes; called by EFFECT_ADJUST_UNIT_SPY_OFFENSIVE_OPERATION_TIME, EFFECT_ADJUST_UNIT_SPY_OPERATION_TIME
Experience::ChangeGeneralExperienceModifier void Unit::Experience::ChangeGeneralExperienceModifier(Unit::Experience* this, int iDelta) 0x394810 0x396d70 Dev CE (experimental): UnitExperience.ChangeGeneralExperienceModifier writes; called by EFFECT_ADJUST_UNIT_EXPERIENCE_MODIFIER
Experience::GrantPromotion void Unit::Experience::GrantPromotion(Unit::Experience* this, UnitPromotionTypes ePromotion, bool bIgnoreRandomPromotionCheck) 0x394cd0 0x3970f0 Dev CE (experimental): UnitExperience.GrantPromotion writes; called by EFFECT_GRANT_PROMOTION
Experience::SetLevel void Unit::Experience::SetLevel(Unit::Experience* this, int iLevel) 0x395080 0x3974a0 Dev CE (experimental): UnitExperience.SetLevel event, writes; called by EFFECT_ADJUST_UNIT_EXPERIENCE_LEVEL
GreatPerson::ChangeActionCharges void Unit::GreatPerson::ChangeActionCharges(Unit::GreatPerson* this, int iChange) 0x396b50 0x398f70 Dev CE (experimental): UnitGreatPerson.ChangeActionCharges event, writes; called by EFFECT_ADJUST_UNIT_GREAT_PERSON_CHARGES
Instance::AddBypassWallsPromotionClass void Unit::Instance::AddBypassWallsPromotionClass(Unit::Instance* this, UnitPromotionClassTypes ePromotionClass) 0x39fb60 0x3a1f30 Dev CE (experimental): Unit.AddBypassWallsPromotionClass edit_call, writes; called by EFFECT_ADJUST_UNIT_BYPASS_WALLS_PROMOTION_CLASS
Instance::AddEnableWallAttackPromotionClass void Unit::Instance::AddEnableWallAttackPromotionClass(Unit::Instance* this, UnitPromotionClassTypes ePromotionClass) 0x39fc90 0x3a2060 Dev CE (experimental): Unit.AddEnableWallAttackPromotionClass edit_call, writes; called by EFFECT_ADJUST_UNIT_ENABLE_WALL_ATTACK_PROMOTION_CLASS
Instance::ChangeBonusPointsPerKill void Unit::Instance::ChangeBonusPointsPerKill(Unit::Instance* this, GreatPersonClassTypes eClass, int iChange) 0x3a0530 0x3a2900 Dev CE (experimental): Unit.ChangeBonusPointsPerKill edit_call, writes; called by EFFECT_ADJUST_GREAT_PEOPLE_POINTS_PER_KILL
Instance::ChangeBonusPointsPerKillStrength void Unit::Instance::ChangeBonusPointsPerKillStrength(Unit::Instance* this, GreatPersonClassTypes eClass, int iChange) 0x3a0570 0x3a2940 Dev CE (experimental): Unit.ChangeBonusPointsPerKillStrength edit_call, writes; called by EFFECT_ADJUST_GREAT_PEOPLE_POINTS_PER_KILL_BY_DEFEATED_STRENGTH
Instance::ChangeBuildCharges ★ void Unit::Instance::ChangeBuildCharges(Unit::Instance* this, int iChange) 0x3a05b0 0x3a2980 Dev CE (experimental): Unit.ChangeBuildCharges analysed, event, writes; called by EFFECT_ADJUST_UNIT_BUILD_CHARGES
Instance::ChangeDisasterCharges void Unit::Instance::ChangeDisasterCharges(Unit::Instance* this, int iChange) 0x3a0670 0x3a2a40 Dev CE (experimental): Unit.ChangeDisasterCharges event, writes; called by EFFECT_ADJUST_UNIT_DISASTER_CHARGES
Instance::ChangeSightRange void Unit::Instance::ChangeSightRange(Unit::Instance* this, int iRangeDelta) 0x3a08d0 0x3a2ca0 Dev CE (experimental): Unit.ChangeSightRange edit_call, writes; called by EFFECT_ADJUST_UNIT_SIGHT
Instance::ChangeTerritoryHealing void Unit::Instance::ChangeTerritoryHealing(Unit::Instance* this, TerritoryTypes eTerritory, int iChange) 0x3a0960 0x3a2d30 Dev CE (experimental): Unit.ChangeTerritoryHealing edit_call, writes; called by EFFECT_ADJUST_UNIT_HEALING_MODIFIERS
Instance::ChangeTerritoryHealingReligion void Unit::Instance::ChangeTerritoryHealingReligion(Unit::Instance* this, TerritoryTypes eTerritory, int iChange) 0x3a09e0 0x3a2db0 Dev CE (experimental): Unit.ChangeTerritoryHealingReligion edit_call, writes; called by EFFECT_ADJUST_UNIT_HEALING_RELIGION_MODIFIERS
Instance::RemoveInvalidTerrain void Unit::Instance::RemoveInvalidTerrain(Unit::Instance* this, TerrainTypes eTerrain) 0x3a28f0 0x3a4cc0 Dev CE (experimental): Unit.RemoveInvalidTerrain edit_call, writes; called by EFFECT_ADJUST_UNIT_VALID_TERRAIN
Instance::SetCanMoveAfterAttacking void Unit::Instance::SetCanMoveAfterAttacking(Unit::Instance* this, int delta) 0x3a3610 0x3a58d0 Dev CE (experimental): Unit.SetCanMoveAfterAttacking writes; called by EFFECT_ADJUST_UNIT_ATTACK_AND_MOVE
Instance::SetCanSeeThroughFeatures void Unit::Instance::SetCanSeeThroughFeatures(Unit::Instance* this, bool bCanSee) 0x3a3680 0x3a5940 Dev CE (experimental): Unit.SetCanSeeThroughFeatures writes; called by EFFECT_ADJUST_UNIT_SEE_THROUGH_FEATURES
Instance::SetCanSeeThroughTerrain void Unit::Instance::SetCanSeeThroughTerrain(Unit::Instance* this, bool bCanSee) 0x3a3710 0x3a59d0 Dev CE (experimental): Unit.SetCanSeeThroughTerrain writes; called by EFFECT_ADJUST_UNIT_SEE_THROUGH_TERRAIN
Instance::SetFormation void Unit::Instance::SetFormation(Unit::Instance* this, Formation::Instance* newFormation) 0x3a3910 0x3a5bd0 no writes
Instance::SetLevied void Unit::Instance::SetLevied(Unit::Instance* this, bool bLevied) 0x3a3990 0x3a5c50 Dev CE (experimental): Unit.SetLevied signal, writes
Instance::SetModifierObject void Unit::Instance::SetModifierObject(const Unit::Instance* this, ModifierObjectReference o) 0x3a3ad0 0x3a5d90 no writes
Instance::SetOperationDisabled void Unit::Instance::SetOperationDisabled(Unit::Instance* this, UnitOperationTypes eOperation, bool newValue) 0x3a3b90 0x3a5e50 Dev CE (experimental): Unit.SetOperationDisabled edit_call, writes; called by EFFECT_CHANGE_UNIT_OPERATION_AVAILABILITY
Instance::SetProcessedTurn void Unit::Instance::SetProcessedTurn(Unit::Instance* this, bool bNewValue) 0x3a3c20 0x3a5ee0 Dev CE (experimental): Unit.SetProcessedTurn event, writes
Instance::SetSeeHiddenType void Unit::Instance::SetSeeHiddenType(Unit::Instance* this, HiddenVisibilityTypes eHiddenVisibilityType) 0x3a3ca0 0x3a5f60 Dev CE (experimental): Unit.SetSeeHiddenType edit_call, writes; called by EFFECT_ADJUST_UNIT_SEE_HIDDEN
Manager::ChangeOwner void Unit::Manager::ChangeOwner(Unit::Manager* this, Unit::Instance* unit, PlayerTypes eNewOwner, bool bLevied, bool bMoveToValidLocation, Unit::Instance** pOutputUnit) 0x64ec00 0x64f420 via CE: UnitManager.ChangeOwner
Placement::CompleteMovement void Unit::Placement::CompleteMovement(Unit::Instance* pkUnit) (+2 overloads) 0x3ad930 0x3afd30 no event, writes
Religion::ChangeInitiationYieldPopulation void Unit::Religion::ChangeInitiationYieldPopulation(Unit::Religion* this, YieldTypes eYield, int iPopulationAmount) 0x3b0490 0x3b2890 Dev CE (experimental): UnitReligion.ChangeInitiationYieldPopulation writes; called by EFFECT_ADJUST_UNIT_INITIATION_YIELD_POPULATION

Notes (★)

Unit::Instance::ChangeBuildCharges

Adds a (possibly negative) amount to a unit's remaining build charges, never going below 0.