Events (Civ5 Type)

From Civilization Modding Wiki
Jump to navigationJump to 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 ___________________________
ActivePlayerTurnEnd()
ActivePlayerTurnStart()
AddPopupTextEvent(Vector3 worldPosition, unknown text, int delay)
AddUnitMoveHexRangeHex(float i, float j, unknown k, bool attackMove, unknown unitID)
AdvisorDisplayHide()
AdvisorDisplayShow(AdvisorEventInfo info)
AfterModsActivate()
AfterModsDeactivate()
AILeaderMessage(PlayerID player, DiploUIStateType diploUIState, string leaderMessage, int animationAction, int data1)
AudioDebugChangeMusic(bool arg0, bool arg1, bool arg2)
AudioPlay2DSound(string audio)

B

Base game Gods & Kings ___________________________
BuildingLibrarySwap(int assetCulture, int assetEra)

C

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

D

Base game Gods & Kings ___________________________
DisplayMovementIndicator(bool show)

E

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

F

Base game Gods & Kings ___________________________
FrontEndPopup(string string)

G

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

H

Base game Gods & Kings ___________________________
HexFOWStateChanged(Vector2 hexPos, int fowType, bool wholeMap)
HexYieldMightHaveChanged(int gridX, int gridY)

I

Base game Gods & Kings ___________________________
InitCityRangeStrike(PlayerID Player, CityID CityID)
InstalledModsUpdated()
InterfaceModeChanged(InterfaceMode oldInterfaceMode, InterfaceMode newInterfaceMode)

K

Base game Gods & Kings ___________________________
KeyUpEvent(KeyType wParam)

L

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

M

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

N

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

O

Base game Gods & Kings ___________________________
OpenInfoCorner(InfoCornerID infoType)
OpenPlayerDealScreenEvent(PlayerID player, int target = nil)

P

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

R

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

T

Base game Gods & Kings ___________________________
TaskListUpdate(PopupInfo TaskListInfo)
TechAcquired()

U

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

W

Base game Gods & Kings ___________________________
WarStateChanged(TeamID team1, TeamID team2, bool war)
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.