Events

Usage

This object exposes events designed to make the UI react to data changes. You may try to use them to implement gameplay changes.

Static Events

Events can be subscribed by using Events.SomeEvent.Add(SomeFunction).

NameParameters
Events.AllianceAvailableplayerID [number]
otherplayerID [number]
AllianceType [number]
Events.AllianceEndedplayerID [number]
otherplayerID [number]
AllianceType [number]
Events.AnarchyBegins
Events.AnarchyEnds
Events.BarbarianRaidStarted
Events.BarbarianSpottedCityplayerID [number]
unitID [number]
cityOwner [number]
cityID [number]
Events.BeginWonderReveal
Events.BeliefAddedplayerID [number]
beliefID [number]
Events.BuildingAddedToMapiX [number]
iY [number]
buildingID [number]
playerID [number]
misc2
misc3
Events.BuildingBuildProgressChanged
Events.BuildingChangediX [number]
iY [number]
buildingID [number]
playerID [number]
iPercentComplete [number]
iUnknown
Events.BuildingPillaged
Events.BuildingRemovedFromMapiX [number]
iY [number]
Events.BuildingVisibilityChanged
Events.CacheUpdate
Events.CameraUpdatedvFocusX [number]
vFocusY [number]
fZoomLevel [number]
Events.CapitalCityChangedplayerID [number]
cityID [number]
Events.CityAddedToMapplayerID [number]
cityID [number]
iX [number]
iY [number]
Events.CityChanged
Events.CityCommandStartedcityOwnerID [number]
cityID [number]
districtOwnerID [number]
commandType [number]
iData1 [number]
Events.CityDefenseStatusChangedplayerID [number]
iValue [number]
Events.CityFocusChangedplayerID [number]
cityID [number]
Events.CityInitializedplayerID [number]
cityID [number]
iX [number]
iY [number]
Events.CityLiberatedplayerID [number]
cityID [number]
Events.CityLoyaltyChangedplayerID [number]
cityID [number]
Events.CityMadePurchaseplayerID [number]
cityID [number]
iX [number]
iY [number]
purchaseType [number]
objectType [number]
Events.CityNameChangedplayerID [number]
cityID [number]
Events.CityOccupationChangedplayerID [number]
cityID [number]
Events.CityPopulationChangedplayerID [number]
cityID [number]
cityPopulation [number]
Events.CityProductionChangedplayerID [number]
cityID [number]
productionID [number]
objectID [number]
bCancelled [boolean]
Events.CityProductionCompletedplayerID [number]
cityID [number]
iConstructionType [number]
unitID [number]
bCancelled [boolean]
Events.CityProductionUpdatedplayerID [number]
cityID [number]
objectID [number]
productionID [number]
Events.CityProjectCompletedplayerID [number]
cityID [number]
projectID [number]
buildingIndex [number]
iX [number]
iY [number]
bCancelled [boolean]
Events.CityReligionChangedplayerID [number]
cityID [number]
eVisibility [number]
city
Events.CityReligionFollowersChangedplayerID [number]
cityID [number]
eVisibility [number]
city
Events.CityRemovedFromMapplayerID [number]
cityID [number]
Events.CitySiegeStatusChangedplayerID [number]
cityID [number]
bIsBesieged [boolean]
Events.CityTileOwnershipChangedowner [number]
cityID [number]
Events.CityTransferedplayerID [number]
cityID [number]
Events.CityUnitsChangedplayerID [number]
cityID [number]
Events.CityVisibilityChangedplayerID [number]
cityID [number]
eVisibility [number]
Events.CityWorkerChangedownerPlayerID [number]
cityID [number]
iX [number]
iY [number]
Events.CivicBoostTriggeredplayerID [number]
iBoostedCivic [number]
iUnknownA [number]
iUnknownB [number]
Events.CivicChangedePlayer [number]
eCivic [number]
Events.CivicCompletedplayerID [number]
iCivic [number]
bCancelled [boolean]
Events.CivicQueueChanged
Events.CivicsUnlocked
Events.CliffAddedToMap
Events.CliffRemovedFromMap
Events.CombatcombatResult [table]
Events.CulturalIdentityCitizenConverted
Events.CulturalIdentityCityConvertedplayer [number]
cityID [number]
fromPlayer [number]
Events.CulturalIdentityConversionOutcomeChangedplayer [number]
cityID [number]
eOutcome [number]
Events.CultureChanged
Events.CultureYieldChangedePlayer [number]
Events.DiplomacyDealEnacted
Events.DiplomacyDealExpired
Events.DiplomacyDeclareWarfirstPlayerID [number]
secondPlayerID [number]
Events.DiplomacyIncomingDealeFromPlayer [number]
eToPlayer [number]
eAction [number]
Events.DiplomacyMakePeacefirstPlayerID [number]
secondPlayerID [number]
Events.DiplomacyMeetplayer1ID [number]
player2ID [number]
Events.DiplomacyMeetMajorMinor
Events.DiplomacyMeetMajors
Events.DiplomacyRefusePeaceeActingPlayer [number]
eReactingPlayer [number]
Events.DiplomacyRelationshipChangedplayer1ID [number]
player2ID [number]
Events.DiplomacySessionClosedsessionID [number]
Events.DiplomacyStatementeActingPlayer [number]
eReactingPlayer [number]
values [table]
Events.DistrictAddedToMapplayerID [number]
districtID [number]
cityID [number]
iX [number]
iY [number]
districtType [number]
percentComplete [number]
Events.DistrictBuildingRestore
Events.DistrictBuildProgressChangedplayerID [number]
districtID [number]
cityID [number]
iX [number]
iY [number]
districtType [number]
era [number]
civilization [number]
percentComplete [number]
iAppeal [number]
isPillaged [number]
Events.DistrictCombatChangedeventSubType [number]
playerID [number]
districtID [number]
Events.DistrictDamageChangedplayerID [number]
districtID [number]
damageType [number]
newDamage [number]
oldDamage [number]
Events.DistrictPillagedowner [number]
districtID [number]
cityID [number]
iX [number]
iY [number]
districtType [number]
percentComplete [number]
isPillaged [number]
Events.DistrictRemovedFromMapplayerID [number]
districtID [number]
Events.DistrictUnitsChangedplayerID [number]
districtID [number]
Events.DistrictVisibilityChangedplayerID [number]
districtID [number]
eVisibility [number]
Events.EmergenciesUpdated
Events.EmergencyAvailableplayerTarget [number]
emergencyType [number]
Events.EmergencyAvailableParticipant
Events.EmergencyCompletedplayerID [number]
eTargetPlayer [number]
iTurn [number]
Events.EmergencyCompleteParticipants
Events.EmergencyRejected
Events.EmergencyStartedplayerID [number]
eTargetPlayer [number]
iTurn [number]
Events.EndTurnBlockingChangedePrevEndTurnBlockingType [number]
eNewEndTurnBlockingType [number]
Events.EndTurnDirty
Events.EndWonderReveal
Events.EventPopupRequest
Events.EventSoundRequest
Events.FaithChangedplayerID [number]
yield [number]
balance [number]
Events.FeatureAddedToMap
Events.FeatureChanged
Events.FeatureRemovedFromMap
Events.FeatureVisibilityChanged
Events.GameEraChangedpreviousEra [number]
newEra [number]
Events.GameHistoryMomentRecordedmomentIndex [number]
iUnknown [number]
Events.GoodyHutRewardplayerID [number]
unitID [number]
iUnknown1 [number]
iUnknown2 [number]
Events.GovDistrictPolicyLocked
Events.GovDistrictPolicyUnlockedplayer [number]
policyType [number]
Events.GovernmentChangedplayerID [number]
governmentID [number]
Events.GovernmentPolicyChangedplayerID [number]
policyID [number]
Events.GovernmentPolicyObsoletedePlayer [number]
Events.GovernorAppointedplayerID [number]
governorID [number]
Events.GovernorAssignedcityOwner [number]
cityID [number]
governorOwner [number]
governorType [number]
Events.GovernorChangedplayerID [number]
governorID [number]
Events.GovernorEstablished
Events.GovernorPointsChangedplayer [number]
iDelta [number]
Events.GovernorPromotedePlayer [number]
eGovernor [number]
ePromotion [number]
Events.GreatPeoplePointsChangedplayerID [number]
Events.GreatPeopleTimelineChanged
Events.GreatWorkCreatedplayerID [number]
unitID [number]
iCityPlotX [number]
iCityPlotY [number]
buildingID [number]
greatWorkID [number]
Events.GreatWorkMovedfromCityOwner [number]
fromCityID [number]
toCityOwner [number]
toCityID [number]
buildingID [number]
greatWorkType [number]
Events.ImprovementActivatediX [number]
iY [number]
unitOwner [number]
unitID [number]
improvementType [number]
improvementOwner [number]
activationType [number]
Events.ImprovementAddedToMapiX [number]
iY [number]
eImprovement [number]
playerID [number]
Events.ImprovementChangediX [number]
iY [number]
improvementType [number]
improvementOwner [number]
resource [number]
isPillaged [boolean]
isWorked [boolean]
Events.ImprovementOwnershipChanged
Events.ImprovementRemovedFromMapiX [number]
iY [number]
eOwner [number]
Events.ImprovementVisibilityChangediX [number]
iY [number]
eImprovementType [number]
eVisibility [number]
Events.InfluenceChanged
Events.InfluenceGivencitystateID [number]
playerID [number]
Events.LevyCounterChangedoriginalOwnerID [number]
Events.LocalPlayerChangedlocalPlayerID [number]
prevLocalPlayerID [number]
Events.LocalPlayerTurnBegin
Events.LocalPlayerTurnEnd
Events.LocalPlayerTurnUnready
Events.MapYieldsChanged
Events.NationalParkAdded
Events.NationalParkRemoved
Events.NationalParkVisibilityChanged
Events.NaturalWonderRevealediX [number]
iY [number]
eFeature [number]
bIsFirstToFind [boolean]
Events.NotificationActivatedplayerID [number]
notificationID [number]
bActivatedByUser [boolean]
Events.NotificationAddedplayerID [number]
notificationID [number]
Events.NotificationDismissedplayerID [number]
notificationID [number]
Events.NotificationRefreshRequested
Events.ObjectPairingeSubType [number]
parentOwner [number]
parentType [number]
parentID [number]
childOwner [number]
childType [number]
childID [number]
Events.OnAiAdvisorUpdated
Events.UnitGreatPersonActivatedunitOwner [number]
unitID [number]
greatPersonClassID [number]
greatPersonIndividualID [number]
unitOwner [number]
unitID [number]
greatPersonClassID [number]
greatPersonIndividualID [number]
Events.PantheonFoundedePlayer [number]
Events.PhaseBegin
Events.PhaseEnd
Events.PlayerAgeChangedplayerID [number]
Events.PlayerBordersChanged
Events.PlayerDarkAgeChangedplayerID [number]
Events.PlayerDefeatplayerID [number]
defeatType [number]
eventID [number]
Events.PlayerDestroyed
Events.PlayerEraChangedplayerID [number]
eraID [number]
Events.PlayerEraScoreChangedplayerID [number]
amountAwarded [number]
Events.PlayerEraTransitionBeginsplayerID [number]
Events.PlayerOperationComplete
Events.PlayerResourceChangedownerPlayerID [number]
resourceTypeID [number]
Events.PlayerRestored
Events.PlayerRevived
Events.PlayerTurnActivatedplayerID [number]
bIsFirstTime [boolean]
Events.PlayerTurnDeactivatedplayerID [number]
Events.PlayerVictory
Events.PlotAppealChanged
Events.PlotMarkerChangediX [number]
iY [number]
Events.PlotVisibilityChangediX [number]
iY [number]
visibilityType [number]
Events.PlotYieldChangediX [number]
iY [number]
Events.QuestChangedCityStateID [number]
CompletedQuestPlayerID [number]
Events.QueueFlushed
Events.ReligionFoundedplayerID [number]
religionID [number]
Events.RemotePlayerTurnBegin
Events.RemotePlayerTurnEnd
Events.RemotePlayerTurnUnready
Events.ResearchChangedePlayer [number]
eTech [number]
Events.ResearchCompletedePlayer [number]
eTech [number]
Events.ResearchQueueChangedePlayer [number]
eTech [number]
Events.ResearchYieldChangedePlayer [number]
Events.ResourceAddedToMapiX [number]
iY [number]
resourceType [number]
Events.ResourceChanged
Events.ResourceRemovedFromMapiX [number]
iY [number]
resourceType [number]
Events.ResourceVisibilityChangediX [number]
iY [number]
resourceType [number]
visibilityType [number]
Events.RiverAddedToMap
Events.RiverRemovedFromMap
Events.RouteAddedToMap
Events.RouteChangediX [number]
iY [number]
Events.RouteRemovedFromMap
Events.RouteVisibilityChanged
Events.SpyAddedspyOwner [number]
spyUnitID [number]
Events.SpyMissionCompletedplayerID [number]
missionID [number]
Events.SpyMissionUpdated
Events.SpyRemovedspyOwner [number]
counterSpyPlayer [number]
Events.SpyUpdated
Events.StatusMessage
Events.SystemUpdateUItype [number]
tag [string]
iData1 [number]
iData2 [number]
strData1 [string]
Events.TeamVictory
Events.TechBoostTriggeredplayerID [number]
iTechBoosted [number]
iUnknownA [number]
iUnknownB [number]
Events.TerrainTypeChanged
Events.TradeRouteActivityChangedplayerID [number]
OriginPlayerID [number]
OriginCityID [number]
TargetPlayerID [number]
TargetCityID [number]
Events.TradeRouteAddedToMapplayerID [number]
iX [number]
iY [number]
Events.TradeRouteCapacityChangedplayerID [number]
Events.TradeRouteRangeChanged
Events.TradeRouteRemovedFromMapplayerID [number]
iX [number]
iY [number]
Events.TreasuryChangedplayerID [number]
yield [number]
balance [number]
Events.TurnBegin
Events.TurnEnd
Events.UnitAbilityGainedplayerID [number]
unitID [number]
eAbilityType [number]
Events.UnitActivate
Events.UnitActivityChangedplayerID [number]
unitID [number]
eActivityType [number]
Events.UnitAirlifted
Events.UnitArtifactChangedplayerID [number]
unitID [number]
Events.UnitCapturedcurrentUnitOwner [number]
unitID [number]
owningPlayer [number]
capturingPlayer [number]
Events.UnitChargesChangedplayerID [number]
unitID [number]
newCharges [number]
oldCharges [number]
Events.UnitCommandStartedplayerID [number]
unitID [number]
hCommand [number]
iData1 [number]
Events.UnitDamageChangedPlayerID [number]
UnitID [number]
newDamage [number]
prevDamage [number]
Events.UnitEmbarkedStateChangedplayerID [number]
unitID [number]
bEmbarkedState [boolean]
Events.UnitEnterFormationfirstUnitOwner [number]
firstUnitID [number]
secondUnitOwner [number]
secondUnitID [number]
Events.UnitExitFormationfirstUnitOwner [number]
firstUnitID [number]
secondUnitOwner [number]
secondUnitID [number]
Events.UnitExperienceChanged
Events.UnitFormArmyplayerID [number]
unitID [number]
Events.UnitFormationChanged
Events.UnitFormCorpsplayerID [number]
unitID [number]
Events.UnitFortificationChangedplayerID [number]
unitID [number]
Events.UnitGreatPersonChanged
Events.UnitGreatPersonCreatedplayerID [number]
unitID [number]
greatPersonClassID [number]
greatPersonIndividualID [number]
Events.UnitKilledInCombatkilledPlayerID [number]
killedUnitID [number]
playerID [number]
unitID [number]
Events.UnitMoveCompleteplayerID [number]
unitID [number]
iX [number]
iY [number]
Events.UnitMovedplayerID [number]
unitID [number]
iX [number]
iY [number]
locallyVisible
stateChange
Events.UnitMovementPointsChangedplayerID [number]
unitID [number]
MovementPoints [number]
Events.UnitMovementPointsClearedplayerID [number]
unitID [number]
Events.UnitMovementPointsRestoredplayerID [number]
unitID [number]
MovementPoints [number]
Events.UnitOperationAddedplayerID [number]
unitID [number]
iUnknown [number]
hOperation [number]
Events.UnitOperationDeactivatedplayerID [number]
unitID [number]
hOperation [number]
iData1 [number]
Events.UnitOperationSegmentCompleteplayerID [number]
unitID [number]
hCommand [number]
iData1 [number]
Events.UnitOperationStartedownerID [number]
unitID [number]
operationID [number]
Events.UnitOperationsClearedplayerID [number]
unitID [number]
hCommand [number]
iData1 [number]
Events.UnitParadropped
Events.UnitPromotedplayerID [number]
unitID [number]
Events.UnitPromotionAvailableplayerID [number]
unitID [number]
promotionID [number]
Events.UnitRemovedFromMapplayerID [number]
unitID [number]
Events.UnitTeleportedplayerID [number]
unitID [number]
iX [number]
iY [number]
Events.UnitTradeChangedplayerID [number]
unitID [number]
Events.UnitUpgradedplayerID [number]
unitID [number]
Events.UnitVisibilityChangedplayerID [number]
unitID [number]
Events.WMDCountChangedplayerID [number]
eWMD [number]
Events.WMDDetonated
Events.WMDFalloutChanged
Events.WMDFalloutVisibilityChanged
Events.WonderCompletediX [number]
iY [number]
buildingIndex [number]
playerIndex [number]
cityID [number]
iPercentComplete [number]
iUnknown [number]
Events.WorldTextMessagemessageType [number]
delay [number]
iX [number]
iY [number]
text [number]