Events (Civ5 Type)

From Civilization Modding Wiki
Jump to: navigation, search

This page is a part of the Lua and UI Reference (Civ5).


Usage

This object exposes events designed to make the UI react to data changes. You may try to use them to implement gameplay changes but be aware that those events may not be fired in circumstances where the UI do not need it. For example the events used by the city screen may not be fired for cities controlled by the AI.


Static Events

Events can be subscribed by using Events.SomeEvent.Add(SomeFunction). Regular events can also be fired through a dot by using Events.SomeEvent(<args>). This will invoke all subscribers with the provided arguments.

A

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png ActivePlayerTurnEnd()
Check.png Check.png Star.png Speech.png ActivePlayerTurnStart()
Check.png Check.png Star.png Speech.png AddPopupTextEvent(Vector3 worldPosition, unknown text, int delay)
Check.png Check.png Star.png Speech.png AddUnitMoveHexRangeHex(float i, float j, unknown k, bool attackMove, unknown unitID)
Check.png Check.png Star.png Speech.png AdvisorDisplayHide()
Check.png Check.png Star.png Speech.png AdvisorDisplayShow(AdvisorEventInfo info)
Check.png Check.png Star.png Speech.png AfterModsActivate()
Check.png Check.png Star.png Speech.png AfterModsDeactivate()
Check.png Check.png Star.png Speech.png AILeaderMessage(PlayerID player, DiploUIStateType diploUIState, string leaderMessage, int animationAction, int data1)
Check.png Check.png Star.png Speech.png AudioDebugChangeMusic(bool arg0, bool arg1, bool arg2)
Check.png Check.png Star.png Speech.png AudioPlay2DSound(string audio)

B

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png BuildingLibrarySwap(int assetCulture, int assetEra)

C

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png CameraStartPitchingDown()
Check.png Check.png Star.png Speech.png CameraStartPitchingUp()
Check.png Check.png Star.png Speech.png CameraStartRotatingCCW()
Check.png Check.png Star.png Speech.png CameraStartRotatingCW()
Check.png Check.png Star.png Speech.png CameraStopPitchingDown()
Check.png Check.png Star.png Speech.png CameraStopPitchingUp()
Check.png Check.png Star.png Speech.png CameraStopRotatingCCW()
Check.png Check.png Star.png Speech.png CameraStopRotatingCW()
Check.png Check.png Star.png Speech.png CameraViewChanged()
Check.png Check.png Star.png Speech.png ClearDiplomacyTradeTable()
Check.png Check.png Star.png Speech.png ClearHexHighlights()
Check.png Check.png Star.png Speech.png ClearHexHighlightStyle(string highlightStyle)
Check.png Check.png Star.png Speech.png ClearUnitMoveHexRange()
Check.png Check.png Star.png Speech.png ConnectedToNetworkHost(PlayerID player)

D

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png DisplayMovementIndicator(bool show)

E

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png EndCombatSim(PlayerID attackingPlayer, UnitID attackingUnit, int attackingUnitDamage, int attackingUnitFinalDamage, int attackingUnitMaxHitPoints, PlayerID defendingPlayer, UnitID defendingUnit, int defendingUnitDamage, int defendingUnitFinalDamage, int defendingUnitMaxHitPoints)
Check.png Check.png Star.png Speech.png EndGameShow(EndGameType type, TeamID team)
Check.png Check.png Star.png Speech.png EndTurnBlockingChanged(EndTurnBlockingType prevEndTurnBlockingType, EndTurnBlockingType newEndTurnBlockingType)
Check.png Check.png Star.png Speech.png EndTurnTimerUpdate(int percentComplete)
Check.png Check.png Star.png Speech.png EventOpenOptionsScreen()
Check.png Check.png Star.png Speech.png EventPoliciesDirty()
Check.png Check.png Star.png Speech.png ExitToMainMenu()

F

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png FrontEndPopup(string string)

G

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png GameMessageChat(PlayerID fromPlayer, PlayerID toPlayer, string text, ChatTargetType targetType)
Check.png Check.png Star.png Speech.png GameOptionsChanged()
Check.png Check.png Star.png Speech.png GameplayAlertMessage(unknown data)
Check.png Check.png Star.png Speech.png GameplayFX(float arg0, float arg1, int arg2)
Check.png Check.png Star.png Speech.png GameplaySetActivePlayer(PlayerID activePlayer, int prevActivePlayer)
Check.png Check.png Star.png Speech.png GenericWorldAnchor(GenericWorldAnchorType type, bool show, int plotX, int plotY, FeatureType data1 = nil)
Check.png Check.png Star.png Speech.png GoToPediaHomePage(ImprovementType homePage)
Check.png Check.png Star.png Speech.png GraphicsOptionsChanged()

H

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png HexFOWStateChanged(Vector2 hexPos, int fowType, bool wholeMap)
Check.png Check.png Star.png Speech.png HexYieldMightHaveChanged(int gridX, int gridY)

I

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png InitCityRangeStrike(PlayerID Player, CityID CityID)
Check.png Check.png Star.png Speech.png InstalledModsUpdated()
Check.png Check.png Star.png Speech.png InterfaceModeChanged(InterfaceMode oldInterfaceMode, InterfaceMode newInterfaceMode)

K

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png KeyUpEvent(KeyType wParam)

L

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png LandmarkLibrarySwap()
Check.png Check.png Star.png Speech.png LeavingLeaderViewMode()
Check.png Check.png Star.png Speech.png LoadScreenClose()
Check.png Check.png Star.png Speech.png LocalMachineAppUpdate(unknown tickCount, int timeIncrement)
Check.png Check.png Star.png Speech.png LocalMachineUnitPositionChanged(PlayerID player, UnitID unitID, Vector3 unitPosition)

M

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png MinimapClickedEvent(int x, int y)
Check.png Check.png Star.png Speech.png MinimapTextureBroadcastEvent(unknown uiHandle, int width, int height, unknown paddingX)
Check.png Check.png Star.png Speech.png MultiplayerConnectionFailed()
Check.png Check.png Star.png Speech.png MultiplayerGameAbandoned(NetKicked reason)
Check.png Check.png Star.png Speech.png MultiplayerGameInvite()
Check.png Check.png Star.png Speech.png MultiplayerGameLaunched()
Check.png Check.png Star.png Speech.png MultiplayerGameListClear()
Check.png Check.png Star.png Speech.png MultiplayerGameListComplete()
Check.png Check.png Star.png Speech.png MultiplayerGamePlayerDisconnected(PlayerID player)
Check.png Check.png Star.png Speech.png MultiplayerGamePlayerUpdated()
Check.png Check.png Star.png Speech.png MultiplayerJoinRoomComplete()
Check.png Check.png Star.png Speech.png MultiplayerJoinRoomFailed(NetError extendedError, unknown aExtendedErrorText)
Check.png Check.png Star.png Speech.png MultiplayerPingTimesChanged()

N

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png NaturalWonderRevealed(float i, int j)
Check.png Check.png Star.png Speech.png NotificationAdded(CityAIFocusType notification, NotificationType notificationType, string toolTip, string summary, int gameValue, TechType extraGameData)
Check.png Check.png Star.png Speech.png NotificationRemoved(CityAIFocusType )

O

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png OpenInfoCorner(InfoCornerID infoType)
Check.png Check.png Star.png Speech.png OpenPlayerDealScreenEvent(PlayerID player, int target = nil)

P

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png ParticleEffectReloadRequested()
Check.png Check.png Star.png Speech.png ParticleEffectStatsRequested()
Check.png Check.png Star.png Speech.png ParticleEffectStatsResponse(unknown responseData)
Check.png Check.png Star.png Speech.png PlayerChoseToLoadGame(string thisLoadFile, bool arg1 = nil)
Check.png Check.png Star.png Speech.png PlayerVersionMismatchEvent(PlayerID player, unknown playerName, bool isHost)
Check.png Check.png Star.png Speech.png PreGameDirty()

R

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png RemotePlayerTurnEnd()
Check.png Check.png Star.png Speech.png RemoveAllArrowsEvent()
Check.png Check.png Star.png Speech.png RequestYieldDisplay(YieldDisplayType type, ResourceType arg1 = nil, ResourceType gridX = nil, int gridY = nil)
Check.png Check.png Star.png Speech.png RunCombatSim(PlayerID attackingPlayer, UnitID attackingUnit, int attackingUnitDamage, int attackingUnitFinalDamage, int attackingUnitMaxHitPoints, PlayerID defendingPlayer, UnitID defendingUnit, int defendingUnitDamage, int defendingUnitFinalDamage, int defendingUnitMaxHitPoints)

S

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png SearchForPediaEntry(string searchString)
Check.png Check.png Star.png Speech.png SequenceGameInitComplete()
Check.png Check.png Star.png Speech.png SerialEventBuildingSizeChanged(int arg0)
Check.png Check.png Star.png Speech.png SerialEventCameraIn(Vector2 arg0)
Check.png Check.png Star.png Speech.png SerialEventCameraOut(Vector2 arg0)
Check.png Check.png Star.png Speech.png SerialEventCameraStartMovingBack()
Check.png Check.png Star.png Speech.png SerialEventCameraStartMovingForward()
Check.png Check.png Star.png Speech.png SerialEventCameraStartMovingLeft()
Check.png Check.png Star.png Speech.png SerialEventCameraStartMovingRight()
Check.png Check.png Star.png Speech.png SerialEventCameraStopMovingBack()
Check.png Check.png Star.png Speech.png SerialEventCameraStopMovingForward()
Check.png Check.png Star.png Speech.png SerialEventCameraStopMovingLeft()
Check.png Check.png Star.png Speech.png SerialEventCameraStopMovingRight()
Check.png Check.png Star.png Speech.png SerialEventCityCaptured(Vector2 hexPos, PlayerID player, int cityID, PlayerID newPlayer)
Check.png Check.png Star.png Speech.png SerialEventCityContinentChanged(float hexX, int hexY, int arg2)
Check.png Check.png Star.png Speech.png SerialEventCityCreated(Vector2 vHexPos, PlayerID player, CityID cityID, ArtStyleType artStyleType, EraType eraType, int continent, int populationSize, int size, int fogState)
Check.png Check.png Star.png Speech.png SerialEventCityCultureChanged(float hexX, int hexY, int arg2)
Check.png Check.png Star.png Speech.png SerialEventCityDestroyed(Vector2 hexPos, PlayerID player, int cityID, PlayerID newPlayer)
Check.png Check.png Star.png Speech.png SerialEventCityHexHighlightDirty()
Check.png Check.png Star.png Speech.png SerialEventCityInfoDirty()
Check.png Check.png Star.png Speech.png SerialEventCityPopulationChanged(float hexX, int hexY, int newPop, int unknown)
Check.png Check.png Star.png Speech.png SerialEventCityScreenDirty()
Check.png Check.png Star.png Speech.png SerialEventCitySetDamage(PlayerID player, CityID cityID, int damage, int previousDamage)
Check.png Check.png Star.png Speech.png SerialEventDawnOfManHide(int civID)
Check.png Check.png Star.png Speech.png SerialEventDawnOfManShow(int civID)
Check.png Check.png Star.png Speech.png SerialEventEndTurnDirty()
Check.png Check.png Star.png Speech.png SerialEventEnterCityScreen()
Check.png Check.png Star.png Speech.png SerialEventEraChanged(int arg0, PlayerID currPlayer)
Question.png Check.png Star.png Speech.png SerialEventEspionageScreenDirty()
Check.png Check.png Star.png Speech.png SerialEventExitCityScreen()
Check.png Check.png Star.png Speech.png SerialEventGameDataDirty()
Check.png Check.png Star.png Speech.png SerialEventGameMessagePopup(PopupInfo popupInfo)
Check.png Check.png Star.png Speech.png SerialEventGameMessagePopupProcessed(ButtonPopupType mostRecentPopup, int arg1)
Check.png Check.png Star.png Speech.png SerialEventGameMessagePopupShown(PopupInfo PopupInfo)
Question.png Question.png Star.png Speech.png SerialEventHexCultureChanged(int hexX, int hexY, PlayerID player, bool unknown)
Check.png Check.png Star.png Speech.png SerialEventHexDeSelected(float hexX, int hexY)
Check.png Check.png Star.png Speech.png SerialEventHexGridOff()
Check.png Check.png Star.png Speech.png SerialEventHexGridOn()
Check.png Check.png Star.png Speech.png SerialEventHexHighlight(Vector2 hex, bool highlight, Vector4 highlightColor, string highlightStyle)
Check.png Check.png Star.png Speech.png SerialEventHexSelected(float hexX, int hexY)
Check.png Check.png Star.png Speech.png SerialEventImprovementCreated(float hexX, int hexY, ArtStyleType continent1, ArtStyleType continent2, PlayerID player, int createImprovementType, ImprovementType createImprovementRRType, int createImprovementEra, int createImprovementState, unknown ImprovementEra = nil)
Question.png Question.png Star.png Speech.png SerialEventImprovementDestroyed(int hexX, int hexY, int continent1, int continent2)
Check.png Check.png Star.png Speech.png SerialEventMouseOverHex(int hexX, int hexY)
Check.png Check.png Star.png Speech.png SerialEventRawResourceCreated(float hexX, int hexY, ArtStyleType continent, ArtStyleType continent, PlayerID player, int arg5, int createResourceType, int arg7, int arg8)
Check.png Check.png Star.png Speech.png SerialEventRawResourceIconCreated(float hexPosX, int hexPosY, unknown ImprovementType, ResourceType ResourceType)
Check.png Check.png Star.png Speech.png SerialEventResearchDirty()
Check.png Check.png Star.png Speech.png SerialEventRoadCreated(int hexX, int hexY, PlayerID player, int routeType)
Check.png Check.png Star.png Speech.png SerialEventRoadDestroyed(int hexX, int hexY)
Check.png Check.png Star.png Speech.png SerialEventScoreDirty()
Check.png Check.png Star.png Speech.png SerialEventStartGame(int arg0 = nil)
Check.png Check.png Star.png Speech.png SerialEventTurnTimerDirty()
Check.png Check.png Star.png Speech.png SerialEventUnitCreated(PlayerID player, UnitID unitID, int hexVec, int unitType, int cultureType, int civID, int primaryColor, int secondaryColor, int unitFlagIndex, int fogState)
Check.png Check.png Star.png Speech.png SerialEventUnitDestroyed(PlayerID player, UnitID unitID)
Check.png Check.png Star.png Speech.png SerialEventUnitFlagSelected(PlayerID player, HandicapType unit)
Check.png Check.png Star.png Speech.png SerialEventUnitInfoDirty()
Check.png Check.png Star.png Speech.png SerialEventUnitMove()
Check.png Check.png Star.png Speech.png SerialEventUnitMoveToHexes()
Check.png Check.png Star.png Speech.png SerialEventUnitSetDamage(PlayerID player, UnitID unitID, int damage, int previousDamage)
Check.png Check.png Star.png Speech.png SerialEventUnitTeleportedToHex(unknown i, unknown j, PlayerID player, UnitID unitID)
Check.png Check.png Star.png Speech.png ShowAttackTargets(PlayerID player, UnitID arg1)
Check.png Check.png Star.png Speech.png ShowHexYield(int x, int y, bool show)
Check.png Check.png Star.png Speech.png ShowMovementRange(PlayerID player, UnitID arg1)
Check.png Check.png Star.png Speech.png SpawnArrowEvent(ResourceType arg0, ResourceType arg1, int hexX, int hexY)
Check.png Check.png Star.png Speech.png SpecificCityInfoDirty(PlayerID player, CityID cityID, CityUpdateType updateType)
Check.png Check.png Star.png Speech.png StartUnitMoveHexRange()
Check.png Check.png Star.png Speech.png StrategicViewStateChanged(int strategicView, int cityBanners)
Check.png Check.png Star.png Speech.png SystemUpdateUI(SystemUpdateUIType type)

T

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png TaskListUpdate(PopupInfo TaskListInfo)
Check.png Check.png Star.png Speech.png TechAcquired()

U

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png UIPathFinderUpdate(unknown data)
Check.png Check.png Star.png Speech.png UnitActionChanged(PlayerID player, UnitID unitID)
Check.png Check.png Star.png Speech.png UnitDataEdited(int floatVarList, int memberCount, int memberIndex, bool isDebugFSM, SpecialistType specRender, bool isFromLua = nil)
Check.png Check.png Star.png Speech.png UnitDataRequested(int arg0)
Check.png Check.png Star.png Speech.png UnitDebugFSM(int arg0)
Check.png Check.png Star.png Speech.png UnitEmbark(PlayerID player, UnitID unitID)
Check.png Check.png Star.png Speech.png UnitFlagUpdated(int unitCulture, int unitType, float unitHealth, bool unitFortified)
Check.png Check.png Star.png Speech.png UnitGarrison(PlayerID player, UnitID unitID, int garrisoned)
Check.png Check.png Star.png Speech.png UnitHexHighlight(float i, int j, unknown k, bool on, int unitId)
Check.png Check.png Star.png Speech.png UnitLibrarySwap()
Check.png Check.png Star.png Speech.png UnitMarkThreatening(PlayerID player, UnitID unitID, bool mark)
Check.png Check.png Star.png Speech.png UnitMemberCombatStateChanged(PlayerID player, UnitID unitID, int memberID, unknown stateID)
Check.png Check.png Star.png Speech.png UnitMemberCombatTargetChanged(PlayerID player, UnitID unitID, int memberID, unknown targetPlayerID, unknown targetUnitID, int targetMemberID)
Check.png Check.png Star.png Speech.png UnitMemberOverlayAdd(PlayerID player, UnitID unitID, int memberID, unknown position)
Check.png Check.png Star.png Speech.png UnitMemberOverlayRemove(PlayerID player, UnitID unitID, int memberID)
Check.png Check.png Star.png Speech.png UnitMemberOverlayShowHide(PlayerID player, UnitID unitID, int memberID, bool show)
Check.png Check.png Star.png Speech.png UnitMemberPositionChanged(PlayerID player, UnitID unitID, int memberID, unknown unitPosition)
Check.png Check.png Star.png Speech.png UnitMoveQueueChanged(PlayerID player, UnitID unitID, bool remainingMoves)
Check.png Check.png Star.png Speech.png UnitSelectionChanged(PlayerID player, UnitID u, float hexX, float hexY, int k, bool isSelected, bool arg6)
Check.png Check.png Star.png Speech.png UnitSelectionCleared()
Check.png Check.png Star.png Speech.png UnitShouldDimFlag(PlayerID player, UnitID unitID, int dim)
Check.png Check.png Star.png Speech.png UnitStateChangeDetected(PlayerID player, UnitID unitID, int fogState)
Check.png Check.png Star.png Speech.png UnitTypeChanged(string arg0)
Check.png Check.png Star.png Speech.png UnitVisibilityChanged(PlayerID player, UnitID unitID, bool visible, bool checkFlag, unknown blendTime)
Check.png Check.png Star.png Speech.png UserRequestClose()

W

Base game Gods & Kings ___________________________
Check.png Check.png Star.png Speech.png WarStateChanged(TeamID team1, TeamID team2, bool war)
Check.png Check.png Star.png Speech.png WorldMouseOver(int worldHasMouseOver)



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.