Home › Lua API › GameRandomEvents

Available out of the box. Usable from Lua in the unmodified game.

GameRandomEvents

5 methods. Symbol/current columns are function addresses (RVA) of the native wrapper.

Community reference for this object: GameRandomEvents (Sukrit Tan, external).

Signatures are recovered from the game code. ⚠ = partly understood (arguments may be missing or approximate). ? after a name = optional argument. Types: integer/number are Lua numbers, enum-typed arguments show the C++ type in brackets. Two signatures mean the method is registered separately for the UI and the gameplay state and each wrapper was decoded on its own. "same code as" in the Symbol column means the compiler merged identical functions: those methods share one wrapper and cannot be told apart by address.

Method Signature Where Reference Symbol Current
ApplyEvent GameRandomEvents.ApplyEvent(kEventIn: table) (or nothing) gameplay yes ↗ 0x5b8a80 0x5b99c0
GetCurrentAffectedCities GameRandomEvents.GetCurrentAffectedCities() → table{CityOwner: number, CityID: number}[] gameplay yes ↗ 0x5b8fc0 0x5b9f00
GetCurrentTurnEvent GameRandomEvents.GetCurrentTurnEvent() gameplay yes ↗ 0x5b91c0 0x5ba100
GetCurrentTurnEventAtPlot GameRandomEvents.GetCurrentTurnEventAtPlot(kPlotIndex?: number) gameplay yes ↗ 0x5b9210 0x5ba150
GetEventsForTurn GameRandomEvents.GetEventsForTurn(iTurn?: number) gameplay yes ↗ 0x5b9290 0x5ba1d0