Part 6: Other event methods

SetFireCollapse(bool inActive)

This method is used to specify whether buildings can collapse or catch fire. (It is used in the Arretium tutorial to prevent fire/collapse until prefects are enabled.) Setting the input inActive to "false" will prevent collapse due to fire or structural damage. Note, however, that the TriggerFireDamage and TriggerStructureDamage methods can still be used to override this, and also that any earthquakes will still cause buildings to collapse. The following example of its use comes from the Arretium tutorial.

    fireCollapseState = true;

SetGodEvents(bool inActive)

This method is used to switch god events on or off (presumably including benevolences). For example, this code is used in the tutorials, so that god events do not interfere with progress through the tutorial.

    bool bGahds = false;

SetPlagueEvents(bool inActive)

This method is used to switch health events on or off. This is also used in the Arretium tutorial, thus:

    bool bHealth = false;

SetRomeStandardRate(bool inPlebWages, int inAmount)

This method is used to set the standard wage level for plebs or equites to the specified amount. It is the method to use if you want to trigger a change in wages increase by (for example) linking to the city's prosperity rating or the size of the treasury, or simply to have them occur after a specified point in time. The following example sets the standard wages for plebs and equites to 23 and 30dn respectively:

    int nPlebWages = 23;
    int nEquiteWages = 30;
    game.SetRomeStandardRate(true, nPlebWages);
    game.SetRomeStandardRate(false, nEquiteWages);

SetWeatherActive(bool inActive)

This method is used to disable or enable weather events – whether scripted or random. This method is used in the tutorials to prevent events such as thunderstorms from interfering with the scenario, as in the following example.

    bool bWeather = false;

DisableEvent(string inEventName)

This method has only been tested to a limited extent as it is not obvious what events can be disabled, and what the string input for inEventName would be needed to do so. No effects have been seen from attempts to use it so far

EnableEvent(string inEventName)

See the comment on the DisableEvent method given above.

< Previous: Triggered events | Editor Guide | Next: Trade & Empire map >