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)
.
Name | Parameters |
---|---|
Events.AllianceAvailable | playerID [number] otherplayerID [number] AllianceType [number] |
Events.AllianceEnded | playerID [number] otherplayerID [number] AllianceType [number] |
Events.AnarchyBegins | |
Events.AnarchyEnds | |
Events.BarbarianRaidStarted | |
Events.BarbarianSpottedCity | playerID [number] unitID [number] cityOwner [number] cityID [number] |
Events.BeginWonderReveal | |
Events.BeliefAdded | playerID [number] beliefID [number] |
Events.BuildingAddedToMap | iX [number] iY [number] buildingID [number] playerID [number] misc2 misc3 |
Events.BuildingBuildProgressChanged | |
Events.BuildingChanged | iX [number] iY [number] buildingID [number] playerID [number] iPercentComplete [number] iUnknown |
Events.BuildingPillaged | |
Events.BuildingRemovedFromMap | iX [number] iY [number] |
Events.BuildingVisibilityChanged | |
Events.CacheUpdate | |
Events.CameraUpdated | vFocusX [number] vFocusY [number] fZoomLevel [number] |
Events.CapitalCityChanged | playerID [number] cityID [number] |
Events.CityAddedToMap | playerID [number] cityID [number] iX [number] iY [number] |
Events.CityChanged | |
Events.CityCommandStarted | cityOwnerID [number] cityID [number] districtOwnerID [number] commandType [number] iData1 [number] |
Events.CityDefenseStatusChanged | playerID [number] iValue [number] |
Events.CityFocusChanged | playerID [number] cityID [number] |
Events.CityInitialized | playerID [number] cityID [number] iX [number] iY [number] |
Events.CityLiberated | playerID [number] cityID [number] |
Events.CityLoyaltyChanged | playerID [number] cityID [number] |
Events.CityMadePurchase | playerID [number] cityID [number] iX [number] iY [number] purchaseType [number] objectType [number] |
Events.CityNameChanged | playerID [number] cityID [number] |
Events.CityOccupationChanged | playerID [number] cityID [number] |
Events.CityPopulationChanged | playerID [number] cityID [number] cityPopulation [number] |
Events.CityProductionChanged | playerID [number] cityID [number] productionID [number] objectID [number] bCancelled [boolean] |
Events.CityProductionCompleted | playerID [number] cityID [number] iConstructionType [number] unitID [number] bCancelled [boolean] |
Events.CityProductionUpdated | playerID [number] cityID [number] objectID [number] productionID [number] |
Events.CityProjectCompleted | playerID [number] cityID [number] projectID [number] buildingIndex [number] iX [number] iY [number] bCancelled [boolean] |
Events.CityReligionChanged | playerID [number] cityID [number] eVisibility [number] city |
Events.CityReligionFollowersChanged | playerID [number] cityID [number] eVisibility [number] city |
Events.CityRemovedFromMap | playerID [number] cityID [number] |
Events.CitySiegeStatusChanged | playerID [number] cityID [number] bIsBesieged [boolean] |
Events.CityTileOwnershipChanged | owner [number] cityID [number] |
Events.CityTransfered | playerID [number] cityID [number] |
Events.CityUnitsChanged | playerID [number] cityID [number] |
Events.CityVisibilityChanged | playerID [number] cityID [number] eVisibility [number] |
Events.CityWorkerChanged | ownerPlayerID [number] cityID [number] iX [number] iY [number] |
Events.CivicBoostTriggered | playerID [number] iBoostedCivic [number] iUnknownA [number] iUnknownB [number] |
Events.CivicChanged | ePlayer [number] eCivic [number] |
Events.CivicCompleted | playerID [number] iCivic [number] bCancelled [boolean] |
Events.CivicQueueChanged | |
Events.CivicsUnlocked | |
Events.CliffAddedToMap | |
Events.CliffRemovedFromMap | |
Events.Combat | combatResult [table] |
Events.CulturalIdentityCitizenConverted | |
Events.CulturalIdentityCityConverted | player [number] cityID [number] fromPlayer [number] |
Events.CulturalIdentityConversionOutcomeChanged | player [number] cityID [number] eOutcome [number] |
Events.CultureChanged | |
Events.CultureYieldChanged | ePlayer [number] |
Events.DiplomacyDealEnacted | |
Events.DiplomacyDealExpired | |
Events.DiplomacyDeclareWar | firstPlayerID [number] secondPlayerID [number] |
Events.DiplomacyIncomingDeal | eFromPlayer [number] eToPlayer [number] eAction [number] |
Events.DiplomacyMakePeace | firstPlayerID [number] secondPlayerID [number] |
Events.DiplomacyMeet | player1ID [number] player2ID [number] |
Events.DiplomacyMeetMajorMinor | |
Events.DiplomacyMeetMajors | |
Events.DiplomacyRefusePeace | eActingPlayer [number] eReactingPlayer [number] |
Events.DiplomacyRelationshipChanged | player1ID [number] player2ID [number] |
Events.DiplomacySessionClosed | sessionID [number] |
Events.DiplomacyStatement | eActingPlayer [number] eReactingPlayer [number] values [table] |
Events.DistrictAddedToMap | playerID [number] districtID [number] cityID [number] iX [number] iY [number] districtType [number] percentComplete [number] |
Events.DistrictBuildingRestore | |
Events.DistrictBuildProgressChanged | playerID [number] districtID [number] cityID [number] iX [number] iY [number] districtType [number] era [number] civilization [number] percentComplete [number] iAppeal [number] isPillaged [number] |
Events.DistrictCombatChanged | eventSubType [number] playerID [number] districtID [number] |
Events.DistrictDamageChanged | playerID [number] districtID [number] damageType [number] newDamage [number] oldDamage [number] |
Events.DistrictPillaged | owner [number] districtID [number] cityID [number] iX [number] iY [number] districtType [number] percentComplete [number] isPillaged [number] |
Events.DistrictRemovedFromMap | playerID [number] districtID [number] |
Events.DistrictUnitsChanged | playerID [number] districtID [number] |
Events.DistrictVisibilityChanged | playerID [number] districtID [number] eVisibility [number] |
Events.EmergenciesUpdated | |
Events.EmergencyAvailable | playerTarget [number] emergencyType [number] |
Events.EmergencyAvailableParticipant | |
Events.EmergencyCompleted | playerID [number] eTargetPlayer [number] iTurn [number] |
Events.EmergencyCompleteParticipants | |
Events.EmergencyRejected | |
Events.EmergencyStarted | playerID [number] eTargetPlayer [number] iTurn [number] |
Events.EndTurnBlockingChanged | ePrevEndTurnBlockingType [number] eNewEndTurnBlockingType [number] |
Events.EndTurnDirty | |
Events.EndWonderReveal | |
Events.EventPopupRequest | |
Events.EventSoundRequest | |
Events.FaithChanged | playerID [number] yield [number] balance [number] |
Events.FeatureAddedToMap | |
Events.FeatureChanged | |
Events.FeatureRemovedFromMap | |
Events.FeatureVisibilityChanged | |
Events.GameEraChanged | previousEra [number] newEra [number] |
Events.GameHistoryMomentRecorded | momentIndex [number] iUnknown [number] |
Events.GoodyHutReward | playerID [number] unitID [number] iUnknown1 [number] iUnknown2 [number] |
Events.GovDistrictPolicyLocked | |
Events.GovDistrictPolicyUnlocked | player [number] policyType [number] |
Events.GovernmentChanged | playerID [number] governmentID [number] |
Events.GovernmentPolicyChanged | playerID [number] policyID [number] |
Events.GovernmentPolicyObsoleted | ePlayer [number] |
Events.GovernorAppointed | playerID [number] governorID [number] |
Events.GovernorAssigned | cityOwner [number] cityID [number] governorOwner [number] governorType [number] |
Events.GovernorChanged | playerID [number] governorID [number] |
Events.GovernorEstablished | |
Events.GovernorPointsChanged | player [number] iDelta [number] |
Events.GovernorPromoted | ePlayer [number] eGovernor [number] ePromotion [number] |
Events.GreatPeoplePointsChanged | playerID [number] |
Events.GreatPeopleTimelineChanged | |
Events.GreatWorkCreated | playerID [number] unitID [number] iCityPlotX [number] iCityPlotY [number] buildingID [number] greatWorkID [number] |
Events.GreatWorkMoved | fromCityOwner [number] fromCityID [number] toCityOwner [number] toCityID [number] buildingID [number] greatWorkType [number] |
Events.ImprovementActivated | iX [number] iY [number] unitOwner [number] unitID [number] improvementType [number] improvementOwner [number] activationType [number] |
Events.ImprovementAddedToMap | iX [number] iY [number] eImprovement [number] playerID [number] |
Events.ImprovementChanged | iX [number] iY [number] improvementType [number] improvementOwner [number] resource [number] isPillaged [boolean] isWorked [boolean] |
Events.ImprovementOwnershipChanged | |
Events.ImprovementRemovedFromMap | iX [number] iY [number] eOwner [number] |
Events.ImprovementVisibilityChanged | iX [number] iY [number] eImprovementType [number] eVisibility [number] |
Events.InfluenceChanged | |
Events.InfluenceGiven | citystateID [number] playerID [number] |
Events.LevyCounterChanged | originalOwnerID [number] |
Events.LocalPlayerChanged | localPlayerID [number] prevLocalPlayerID [number] |
Events.LocalPlayerTurnBegin | |
Events.LocalPlayerTurnEnd | |
Events.LocalPlayerTurnUnready | |
Events.MapYieldsChanged | |
Events.NationalParkAdded | |
Events.NationalParkRemoved | |
Events.NationalParkVisibilityChanged | |
Events.NaturalWonderRevealed | iX [number] iY [number] eFeature [number] bIsFirstToFind [boolean] |
Events.NotificationActivated | playerID [number] notificationID [number] bActivatedByUser [boolean] |
Events.NotificationAdded | playerID [number] notificationID [number] |
Events.NotificationDismissed | playerID [number] notificationID [number] |
Events.NotificationRefreshRequested | |
Events.ObjectPairing | eSubType [number] parentOwner [number] parentType [number] parentID [number] childOwner [number] childType [number] childID [number] |
Events.OnAiAdvisorUpdated | |
Events.UnitGreatPersonActivated | unitOwner [number] unitID [number] greatPersonClassID [number] greatPersonIndividualID [number] unitOwner [number] unitID [number] greatPersonClassID [number] greatPersonIndividualID [number] |
Events.PantheonFounded | ePlayer [number] |
Events.PhaseBegin | |
Events.PhaseEnd | |
Events.PlayerAgeChanged | playerID [number] |
Events.PlayerBordersChanged | |
Events.PlayerDarkAgeChanged | playerID [number] |
Events.PlayerDefeat | playerID [number] defeatType [number] eventID [number] |
Events.PlayerDestroyed | |
Events.PlayerEraChanged | playerID [number] eraID [number] |
Events.PlayerEraScoreChanged | playerID [number] amountAwarded [number] |
Events.PlayerEraTransitionBegins | playerID [number] |
Events.PlayerOperationComplete | |
Events.PlayerResourceChanged | ownerPlayerID [number] resourceTypeID [number] |
Events.PlayerRestored | |
Events.PlayerRevived | |
Events.PlayerTurnActivated | playerID [number] bIsFirstTime [boolean] |
Events.PlayerTurnDeactivated | playerID [number] |
Events.PlayerVictory | |
Events.PlotAppealChanged | |
Events.PlotMarkerChanged | iX [number] iY [number] |
Events.PlotVisibilityChanged | iX [number] iY [number] visibilityType [number] |
Events.PlotYieldChanged | iX [number] iY [number] |
Events.QuestChanged | CityStateID [number] CompletedQuestPlayerID [number] |
Events.QueueFlushed | |
Events.ReligionFounded | playerID [number] religionID [number] |
Events.RemotePlayerTurnBegin | |
Events.RemotePlayerTurnEnd | |
Events.RemotePlayerTurnUnready | |
Events.ResearchChanged | ePlayer [number] eTech [number] |
Events.ResearchCompleted | ePlayer [number] eTech [number] |
Events.ResearchQueueChanged | ePlayer [number] eTech [number] |
Events.ResearchYieldChanged | ePlayer [number] |
Events.ResourceAddedToMap | iX [number] iY [number] resourceType [number] |
Events.ResourceChanged | |
Events.ResourceRemovedFromMap | iX [number] iY [number] resourceType [number] |
Events.ResourceVisibilityChanged | iX [number] iY [number] resourceType [number] visibilityType [number] |
Events.RiverAddedToMap | |
Events.RiverRemovedFromMap | |
Events.RouteAddedToMap | |
Events.RouteChanged | iX [number] iY [number] |
Events.RouteRemovedFromMap | |
Events.RouteVisibilityChanged | |
Events.SpyAdded | spyOwner [number] spyUnitID [number] |
Events.SpyMissionCompleted | playerID [number] missionID [number] |
Events.SpyMissionUpdated | |
Events.SpyRemoved | spyOwner [number] counterSpyPlayer [number] |
Events.SpyUpdated | |
Events.StatusMessage | |
Events.SystemUpdateUI | type [number] tag [string] iData1 [number] iData2 [number] strData1 [string] |
Events.TeamVictory | |
Events.TechBoostTriggered | playerID [number] iTechBoosted [number] iUnknownA [number] iUnknownB [number] |
Events.TerrainTypeChanged | |
Events.TradeRouteActivityChanged | playerID [number] OriginPlayerID [number] OriginCityID [number] TargetPlayerID [number] TargetCityID [number] |
Events.TradeRouteAddedToMap | playerID [number] iX [number] iY [number] |
Events.TradeRouteCapacityChanged | playerID [number] |
Events.TradeRouteRangeChanged | |
Events.TradeRouteRemovedFromMap | playerID [number] iX [number] iY [number] |
Events.TreasuryChanged | playerID [number] yield [number] balance [number] |
Events.TurnBegin | |
Events.TurnEnd | |
Events.UnitAbilityGained | playerID [number] unitID [number] eAbilityType [number] |
Events.UnitActivate | |
Events.UnitActivityChanged | playerID [number] unitID [number] eActivityType [number] |
Events.UnitAirlifted | |
Events.UnitArtifactChanged | playerID [number] unitID [number] |
Events.UnitCaptured | currentUnitOwner [number] unitID [number] owningPlayer [number] capturingPlayer [number] |
Events.UnitChargesChanged | playerID [number] unitID [number] newCharges [number] oldCharges [number] |
Events.UnitCommandStarted | playerID [number] unitID [number] hCommand [number] iData1 [number] |
Events.UnitDamageChanged | PlayerID [number] UnitID [number] newDamage [number] prevDamage [number] |
Events.UnitEmbarkedStateChanged | playerID [number] unitID [number] bEmbarkedState [boolean] |
Events.UnitEnterFormation | firstUnitOwner [number] firstUnitID [number] secondUnitOwner [number] secondUnitID [number] |
Events.UnitExitFormation | firstUnitOwner [number] firstUnitID [number] secondUnitOwner [number] secondUnitID [number] |
Events.UnitExperienceChanged | |
Events.UnitFormArmy | playerID [number] unitID [number] |
Events.UnitFormationChanged | |
Events.UnitFormCorps | playerID [number] unitID [number] |
Events.UnitFortificationChanged | playerID [number] unitID [number] |
Events.UnitGreatPersonChanged | |
Events.UnitGreatPersonCreated | playerID [number] unitID [number] greatPersonClassID [number] greatPersonIndividualID [number] |
Events.UnitKilledInCombat | killedPlayerID [number] killedUnitID [number] playerID [number] unitID [number] |
Events.UnitMoveComplete | playerID [number] unitID [number] iX [number] iY [number] |
Events.UnitMoved | playerID [number] unitID [number] iX [number] iY [number] locallyVisible stateChange |
Events.UnitMovementPointsChanged | playerID [number] unitID [number] MovementPoints [number] |
Events.UnitMovementPointsCleared | playerID [number] unitID [number] |
Events.UnitMovementPointsRestored | playerID [number] unitID [number] MovementPoints [number] |
Events.UnitOperationAdded | playerID [number] unitID [number] iUnknown [number] hOperation [number] |
Events.UnitOperationDeactivated | playerID [number] unitID [number] hOperation [number] iData1 [number] |
Events.UnitOperationSegmentComplete | playerID [number] unitID [number] hCommand [number] iData1 [number] |
Events.UnitOperationStarted | ownerID [number] unitID [number] operationID [number] |
Events.UnitOperationsCleared | playerID [number] unitID [number] hCommand [number] iData1 [number] |
Events.UnitParadropped | |
Events.UnitPromoted | playerID [number] unitID [number] |
Events.UnitPromotionAvailable | playerID [number] unitID [number] promotionID [number] |
Events.UnitRemovedFromMap | playerID [number] unitID [number] |
Events.UnitTeleported | playerID [number] unitID [number] iX [number] iY [number] |
Events.UnitTradeChanged | playerID [number] unitID [number] |
Events.UnitUpgraded | playerID [number] unitID [number] |
Events.UnitVisibilityChanged | playerID [number] unitID [number] |
Events.WMDCountChanged | playerID [number] eWMD [number] |
Events.WMDDetonated | |
Events.WMDFalloutChanged | |
Events.WMDFalloutVisibilityChanged | |
Events.WonderCompleted | iX [number] iY [number] buildingIndex [number] playerIndex [number] cityID [number] iPercentComplete [number] iUnknown [number] |
Events.WorldTextMessage | messageType [number] delay [number] iX [number] iY [number] text [number] |