Skip to content
HungryForFood edited this page Jan 25, 2021 · 7 revisions

Events will be listed in alphabetical order using the following format:

Category Return Event (parameters) Description
category type SomeEvent(type par1, type par2, ...) desc

Where:

  • category - The event's category.
  • type - Variable data type.
  • SomeEvent - Event name.
  • par - Parameters.
  • desc - Short description on the event. Not present for every event, as many are self explanatory.

For categories:

  • Hook - Event does not expect a value to be returned. Cannot be directly used to change or override game behaviour and calculations. A method is required to change something.
  • TestAny - Event expects a boolean to be returned. If any of the Lua subscribed to the event returns the expected value, the game will be triggered to change.
  • TestAll - Event expects a boolean to be returned. All Lua subscribed to the event needs to agree and return the expected value, before the game will change its behaviour.
  • Value - Event expects an integer to be returned. The returned integer from all Lua subscribed to the event are used to increment or override a calculation in the game.

The return column indicates the data type the event expects to be returned.

Most of the events will require the modder to enable them using CustomModOptions. See CustomModOptions.xml for more information.

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.