GameEvents (Civ5 Type)
This page is a part of the Lua and UI Reference (Civ5).
This object exposes events that you can use to modify the gameplay. As opposed to the events defined on Events and LuaEvents, most of those events are expected to return a value. This value may then be used by the game to prevent or trigger some game actions (such as a declaration of war), or to override some calculations (for example by adding a bonus or a malus to the diplomatic status between two civilizations). Please look at the events' pages to learn more.
Events can be subscribed by using
GameEvents.SomeEvent.Add(SomeFunction). Regular events can also be fired through a dot by using
GameEvents.SomeEvent(<args>). This will invoke all subscribers with the provided arguments.
Methods are functions that belong to an object. Static methods are invoked through a dot, as in
GameEvents.SomeMethod(<args>). When a dot is used the caller object is not implicitly provided as the first argument.
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.