LUA Events

Bhruic

Emperor
Joined
Nov 15, 2005
Messages
1,457
This should be a complete list of the various Events.XX that you can hook into. Wanted a list for myself, figured others might be interested as well.

AppInitComplete
CameraViewChanged
CameraProjectionChanged
AnimationSamplingChanged
DontRecordCommandStreams
RecordCommandStreams
CityHandleCreated
UnitHandleCreated
UnitTypeChanged
WonderTypeChanged
WonderStateChanged
WonderTogglePlacement
ToggleDisplayUnits
GlobalUnitScale
LandmarkLibrarySwap
UnitLibrarySwap
BuildingLibrarySwap
SequenceGameInitComplete
StateMachineDumpStates
StateMachineRequestStates
StrategicViewStateChanged
SerialEventHexSelected
SerialEventHexDeSelected
SerialEventMouseOverHex
SerialEventTest
SerialEventTestAnimations
SerialEventStartGame
SerialEventCameraBack
SerialEventCameraStartMovingBack
SerialEventCameraStopMovingBack
SerialEventCameraForward
SerialEventCameraStartMovingForward
SerialEventCameraStopMovingForward
SerialEventCameraLeft
SerialEventCameraStartMovingLeft
SerialEventCameraStopMovingLeft
SerialEventCameraRight
SerialEventCameraStartMovingRight
SerialEventCameraStopMovingRight
CameraStartRotatingCW
CameraStopRotatingCW
CameraStartRotatingCCW
CameraStopRotatingCCW
CameraStartPitchingUp
CameraStopPitchingUp
CameraStartPitchingDown
CameraStopPitchingDown
SerialEventCameraIn
SerialEventCameraOut
SerialEventCameraSetCenterAndZoom
SerialEventScreenShot
SerialEventHexGridOn
SerialEventHexGridOff
SerialEventHexHighlight
SerialEventHexCultureChanged
ClearHexHighlights
ClearHexHighlightStyle
SerialEventTerrainOverlayMod
SerialEventTerrainDecalCreated
SerialEventEraChanged
SerialEventCityCreated
CityRuinsCreated
SerialEventCityCaptured
SerialEventCityDestroyed
SerialEventCityCultureChanged
SerialEventCityPopulationChanged
SerialEventCitySetDamage
SerialEventEnterCityScreen
SerialEventExitCityScreen
SerialEventBuildingSizeChanged
EventOpenOptionsScreen
SerialEventCityContinentChanged
SerialEventRoadCreated
SerialEventRoadDestroyed
SerialEventFeatureCreated
SerialEventFeatureDestroyed
SerialEventRawResourceCreated
SerialEventRawResourceDestroyed
SerialEventRawResourceIconCreated
SerialEventRawResourceIconDestroyed
SerialEventImprovementCreated
SerialEventImprovementDestroyed
SerialEventImprovementIconCreated
SerialEventImprovementIconDestroyed
SerialEventForestCreated
SerialEventForestRemoved
SerialEventJungleCreated
SerialEventJungleRemoved
SerialEventUnitCreated
SerialEventUnitDestroyed
UnitVisibilityChanged
UnitHexHighlight
SerialEventUnitSetDamage
UnitActionChanged
UnitEmbark
UnitGarrison
UnitShouldDimFlag
UnitMarkThreatening
SerialEventUnitMoveToHexes
SerialEventUnitMove
SerialEventUnitTeleportedToHex
SerialEventUnitFacingChanged
UnitSelectionChanged
UnitSelectionCleared
UnitFlagUpdated
UnitDataEdited
UnitDataRequested
UnitDebugFSM
GameOptionsChanged
GraphicsOptionsChanged
SerialEventLeaderToggleDebugCam
SerialEventUnitFlagSelected
SerialEventGameMessagePopup
SerialEventGameMessagePopupShown
SerialEventGameMessagePopupProcessed
SerialEventDawnOfManShow
SerialEventDawnOfManHide
HexFOWStateChanged
GameplayAlertMessage
InterfaceModeChanged
HexYieldMightHaveChanged
ExitToMainMenu
NotificationAdded
NotificationRemoved
NotificationActivated
ActivePlayerTurnStart
ActivePlayerTurnEnd
RemotePlayerTurnEnd
TechAcquired
PlayerChoseToLoadGame
PlayerChoseToLoadMap
UIPathFinderUpdate
DisplayMovementIndicator
NotifyAILeaderInGame
AILeaderMessage
TeamMet
WarStateChanged
SerialEventCityScreenDirty
SerialEventCityInfoDirty
SerialEventCityHexHighlightDirty
EventPoliciesDirty
SerialEventInfoPaneDirty
SerialEventUnitInfoDirty
SerialEventGameDataDirty
SerialEventTurnTimerDirty
SerialEventResearchDirty
SerialEventEndTurnDirty
SerialEventScoreDirty
SpecificCityInfoDirty
ClearDiplomacyTradeTable
ShowMovementRange
ShowAttackTargets
SpawnArrowEvent
RemoveAllArrowsEvent
AdvisorDisplayShow
AdvisorDisplayHide
EndGameShow
TaskListUpdate
EndTurnTimerUpdate
AddPopupTextEvent
MultiplayerConnectionComplete
MultiplayerConnectionFailed
MultiplayerJoinRoomAttempt
MultiplayerJoinRoomComplete
MultiplayerJoinRoomFailed
MultiplayerGameLaunched
MultiplayerProfileDisconnected
MultiplayerProfileFailed
MultiplayerGameListClear
MultiplayerGameListUpdated
MultiplayerGameListComplete
MultiplayerGamePlayerUpdated
MultiplayerGameAbandoned
ConnectedToNetworkHost
PreGameDirty
MultiplayerGamePlayerDisconnected
SearchForPediaEntry GoToPediaHomePage
GameplaySetActivePlayer
GameMessageChat
OpenPlayerDealScreenEvent
OpenInfoCorner
NaturalWonderRevealed
GameplayFX
UnitMoveQueueChanged
FrontEndPopup
GenericWorldAnchor
LoadScreenClose
InitCityRangeStrike
LocalMachineUnitPositionChanged
LocalMachineAppUpdate
UnitStateChangeDetected
UnitHexHighlight
AudioDebugChangeMusic
AudioVolumeChanged
ParticleEffectReloadRequested
ParticleEffectStatsRequested
ParticleEffectStatsResponse
KeyUpEvent
ToolTipEvent
VisibilityUpdated
UnitMemberOverlayAdd
UnitMemberOverlayRemove
UnitMemberOverlayShowHide
UnitMemberOverlayMessage
UnitMemberOverlayTargetColor
UnitMemberPositionChanged
UnitMemberCombatTargetChanged
UnitMemberCombatStateChanged
ClearUnitMoveHexRange
StartUnitMoveHexRange
AddUnitMoveHexRangeHex
EndUnitMoveHexRange
AudioPlay2DSound
RequestYieldDisplay
ShowHexYield
LanguageChanging
ModDownloadStarted
ModDownloadComplete
InstalledModsUpdated
BeforeModsActivate
AfterModsActivate
BeforeModsDeactivate
AfterModsDeactivate
MinimapClickedEvent
MinimapTextureBroadcastEvent
RunCombatSim
EndCombatSim
DragCamera
SystemUpdateUI
WorldMouseOver
UserRequestClose
LeavingLeaderViewMode

Bh
 
Or if you what them alphabetically which may not be perfect either because of all the "SerialEvent" and "MultiplayerGame" prefixes.

AppInitComplete
ActivePlayerTurnEnd
ActivePlayerTurnStart
AddPopupTextEvent
AddUnitMoveHexRangeHex
AdvisorDisplayHide
AdvisorDisplayShow
AfterModsActivate
AfterModsDeactivate
AILeaderMessage
AnimationSamplingChanged
AudioDebugChangeMusic
AudioPlay2DSound
AudioVolumeChanged
BeforeModsActivate
BeforeModsDeactivate
BuildingLibrarySwap
CameraProjectionChanged
CameraStartPitchingDown
CameraStartPitchingUp
CameraStartRotatingCCW
CameraStartRotatingCW
CameraStopPitchingDown
CameraStopPitchingUp
CameraStopRotatingCCW
CameraStopRotatingCW
CameraViewChanged
CityHandleCreated
CityRuinsCreated
ClearDiplomacyTradeTable
ClearHexHighlights
ClearHexHighlightStyle
ClearUnitMoveHexRange
ConnectedToNetworkHost
DisplayMovementIndicator
DontRecordCommandStreams
DragCamera
EndCombatSim
EndGameShow
EndTurnTimerUpdate
EndUnitMoveHexRange
EventOpenOptionsScreen
EventPoliciesDirty
ExitToMainMenu
FrontEndPopup
GameMessageChat
GameOptionsChanged
GameplayAlertMessage
GameplayFX
GameplaySetActivePlayer
GenericWorldAnchor
GlobalUnitScale
GraphicsOptionsChanged
HexFOWStateChanged
HexYieldMightHaveChanged
InitCityRangeStrike
InstalledModsUpdated
InterfaceModeChanged
KeyUpEvent
LandmarkLibrarySwap
LanguageChanging
LeavingLeaderViewMode
LoadScreenClose
LocalMachineAppUpdate
LocalMachineUnitPositionChanged
MinimapClickedEvent
MinimapTextureBroadcastEvent
ModDownloadComplete
ModDownloadStarted
MultiplayerConnectionComplete
MultiplayerConnectionFailed
MultiplayerGameAbandoned
MultiplayerGameLaunched
MultiplayerGameListClear
MultiplayerGameListComplete
MultiplayerGameListUpdated
MultiplayerGamePlayerDisconnected
MultiplayerGamePlayerUpdated
MultiplayerJoinRoomAttempt
MultiplayerJoinRoomComplete
MultiplayerJoinRoomFailed
MultiplayerProfileDisconnected
MultiplayerProfileFailed
NaturalWonderRevealed
NotificationActivated
NotificationAdded
NotificationRemoved
NotifyAILeaderInGame
OpenInfoCorner
OpenPlayerDealScreenEvent
ParticleEffectReloadRequested
ParticleEffectStatsRequested
ParticleEffectStatsResponse
PlayerChoseToLoadGame
PlayerChoseToLoadMap
PreGameDirty
RecordCommandStreams
RemotePlayerTurnEnd
RemoveAllArrowsEvent
RequestYieldDisplay
RunCombatSim
SearchForPediaEntry GoToPediaHomePage
SequenceGameInitComplete
SerialEventBuildingSizeChanged
SerialEventCameraBack
SerialEventCameraForward
SerialEventCameraIn
SerialEventCameraLeft
SerialEventCameraOut
SerialEventCameraRight
SerialEventCameraSetCenterAndZoom
SerialEventCameraStartMovingBack
SerialEventCameraStartMovingForward
SerialEventCameraStartMovingLeft
SerialEventCameraStartMovingRight
SerialEventCameraStopMovingBack
SerialEventCameraStopMovingForward
SerialEventCameraStopMovingLeft
SerialEventCameraStopMovingRight
SerialEventCityCaptured
SerialEventCityContinentChanged
SerialEventCityCreated
SerialEventCityCultureChanged
SerialEventCityDestroyed
SerialEventCityHexHighlightDirty
SerialEventCityInfoDirty
SerialEventCityPopulationChanged
SerialEventCityScreenDirty
SerialEventCitySetDamage
SerialEventDawnOfManHide
SerialEventDawnOfManShow
SerialEventEndTurnDirty
SerialEventEnterCityScreen
SerialEventEraChanged
SerialEventExitCityScreen
SerialEventFeatureCreated
SerialEventFeatureDestroyed
SerialEventForestCreated
SerialEventForestRemoved
SerialEventGameDataDirty
SerialEventGameMessagePopup
SerialEventGameMessagePopupProcessed
SerialEventGameMessagePopupShown
SerialEventHexCultureChanged
SerialEventHexDeSelected
SerialEventHexGridOff
SerialEventHexGridOn
SerialEventHexHighlight
SerialEventHexSelected
SerialEventImprovementCreated
SerialEventImprovementDestroyed
SerialEventImprovementIconCreated
SerialEventImprovementIconDestroyed
SerialEventInfoPaneDirty
SerialEventJungleCreated
SerialEventJungleRemoved
SerialEventLeaderToggleDebugCam
SerialEventMouseOverHex
SerialEventRawResourceCreated
SerialEventRawResourceDestroyed
SerialEventRawResourceIconCreated
SerialEventRawResourceIconDestroyed
SerialEventResearchDirty
SerialEventRoadCreated
SerialEventRoadDestroyed
SerialEventScoreDirty
SerialEventScreenShot
SerialEventStartGame
SerialEventTerrainDecalCreated
SerialEventTerrainOverlayMod
SerialEventTest
SerialEventTestAnimations
SerialEventTurnTimerDirty
SerialEventUnitCreated
SerialEventUnitDestroyed
SerialEventUnitFacingChanged
SerialEventUnitFlagSelected
SerialEventUnitInfoDirty
SerialEventUnitMove
SerialEventUnitMoveToHexes
SerialEventUnitSetDamage
SerialEventUnitTeleportedToHex
ShowAttackTargets
ShowHexYield
ShowMovementRange
SpawnArrowEvent
SpecificCityInfoDirty
StartUnitMoveHexRange
StateMachineDumpStates
StateMachineRequestStates
StrategicViewStateChanged
SystemUpdateUI
TaskListUpdate
TeamMet
TechAcquired
ToggleDisplayUnits
ToolTipEvent
UIPathFinderUpdate
UnitActionChanged
UnitDataEdited
UnitDataRequested
UnitDebugFSM
UnitEmbark
UnitFlagUpdated
UnitGarrison
UnitHandleCreated
UnitHexHighlight
UnitHexHighlight
UnitLibrarySwap
UnitMarkThreatening
UnitMemberCombatStateChanged
UnitMemberCombatTargetChanged
UnitMemberOverlayAdd
UnitMemberOverlayMessage
UnitMemberOverlayRemove
UnitMemberOverlayShowHide
UnitMemberOverlayTargetColor
UnitMemberPositionChanged
UnitMoveQueueChanged
UnitSelectionChanged
UnitSelectionCleared
UnitShouldDimFlag
UnitStateChangeDetected
UnitTypeChanged
UnitVisibilityChanged
UserRequestClose
VisibilityUpdated
WarStateChanged
WonderStateChanged
WonderTogglePlacement
WonderTypeChanged
WorldMouseOver

I am having designers block so looking for documentation I can do :)
 
Until Firaxis releases some more info the easiest thing to do is probably to find an example of the event in the .lua files with Windows Grep.
 
Why should we waste our time doing that?
All that is needed is for Firaxis to release the information they already got that we are missing to get on with some more serious modding. :)

Documenting 100k+ lines of code takes time.

Bhruic, how did you compile this list?
 
Do you really think that they have been working with the code all along without having documented the structure of the various incomming/outgoing parameters for/from the various functions for internal use?!

In any case then we don't need detailed 'documentation' - just a list of what parameters each functions takes and delivers ... and if they haven't had a list like that ready for months then I am surprised the game is working at all.
 
Do you really think that they have been working with the code all along without having documented the structure of the various incomming/outgoing parameters for/from the various functions for internal use?!

Yes. Have you ever seen the Civ4 Source Code? 0 Documentation.

In any case then we don't need detailed 'documentation' - just a list of what parameters each functions takes and delivers ... and if they haven't had a list like that ready for months then I am surprised the game is working at all.

Last time, they wrote a script to do that, but that was months after Civ4 was out.
 
@Afforess:
I can only assume that you never actually worked on any major group effort programming project or if you have (but never kept a shared and constantly updated reference list of parameters for all functions among the group members) you now have the answer as to why it was such a painfull process.

It can pose enough problems if you don't keep such a list for your own personal use as a solo programmer, but it is the source of all evil if you don't keep such a list when several people are working on the same project - and Murphy's Law often apply here.

Also, you don't keep such a list within the actual code anyway (the odd brief comments for later debugging aside).

But even if we assume that Firaxis does not already have such a list, then compiling the various Civ5 equiliants of the Civ4 "Interface" code files would take less than an hour - and it would give us the parameters required for each function. If they were furthermore willing to spend a few more hours then they could easily add a brief detail on the format of the objects returned by the few functions that return object data.
 
I don't see your point. I'm not arguing against documentation, and I too want the full documentation for civ5. I was simply informing you of firaxis's past actions.
 
My point is just that it would take little to no effort on Firaxis' part to deliver the information we need to get properly started on using LUA for mods - and doing so would save us from having to waste time on making blind calls to the DLL trying to uncover the structure by trial and error.
 
Bhruic, how did you compile this list?

I ran a disassembler on the executable. I also picked up all of the available function calls, but there are too many of those to be able to post nicely. Hopefully someone from Firaxis will post them all on the wiki so that I don't have to. :)

Bh
 
I ran a disassembler on the executable. I also picked up all of the available function calls, but there are too many of those to be able to post nicely. Hopefully someone from Firaxis will post them all on the wiki so that I don't have to. :)

Bh

There are 1105 exported functions in the core dll. Most don't map 1:1 with the Lua API, but I can post them if people really want to see them. I am working on a project that should give us a better reference into the actual Lua API that I am hoping to have done in the next day or two.

Yes please. I was able to successfully able to guess a new function call for my first modcomp, but it took me ages to figure everything out. Even just a text file with a giant list would be fine. ;)
 
Lol, there was a Lua API included in Modbuddy all along. I found it in "C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization v sdk\ModBuddy\Help"
 
Back
Top Bottom