Events can be basically anything you can create through use of the accessories.xml file. They can be made to fire off after a set range of time or they can be made to occur randomly. Much of the data for an event is stored in the accessories file, the events file mostly contains the coniditions needed to fire off the event.
It should be noted that, as of v41, events can be made to fire from any landscape object that is given a <groupname> by using WeaponGroupSelect in the accessory that is fired off by your event.
Like most of the optional landscape features, event files can be called from either Definition_Files or Texture_Files. This is done by adding the following to the defn or tex file:
The event files should be located under your game installation's (or mod's) /data/landscapes folder. They are typically named eventsmyfilename.xml, where myfilename is the name of the event or group of events stored in that particular file.
The basic layout of each event file looks like this:
<events>
<event>
<condition type='...'> An event condition type
...
</condition>
<action type='...'> An event action type
...
</action>
</event>
<event>
...
</event>
</events>
Each event is defined through it's own set of <event></event> tags and all the necessary info for each event is contained within those tags where the "..." are above. More detail on what each event will contain can be found in the following section.
Each <event> tag must contain a condition type. The condition type determines when/how often the event is fired. Currently, the condition types available for use are time, random and groupsize. Tag descriptions are in yellow.
This condition returns true after a specified range of time passes.
<condition type="time">
<mintime>#</mintime>
Minimum amount of time before event can occur, in seconds
<maxtime>#</maxtime>
Maximum amount of time before event will occur, in seconds
<singletimeonly>true/false</singletimeonly>
Whether or not the event can occur multiple times per turn
</condition>
With the random condition type, you supply a random chance from 0% to 100% that the event might occur. Each turn, the condition is evaluated and the event will have that much of a chance to occur that turn.
<condition type="random">
<randomchance>0 to 1</randomchance>
Percent chance of event occuring0.5 = 50%, 1.0 = 100%, etc
<randomdelay>#, in seconds</randomdelay>
Amount of time to delay before the event fires
</condition>
The groupsize condition counts the number of objects within a group and fires the event when the count is a specified amount.
<condition type="groupsize">
<groupname>group</groupname>
Group of which we are counting
<groupsize>#</groupsize>
If there are this many objects, fire the event
</condition>
Currently, there is only one type of action available, and that is to fire off a predefined accessory contained in your accessories.xml file.
Type of event to fire.
<action type="fireweapon">
Fires a weapon from the accessories file
<weapon>WeaponName</weapon>
Name of the weapon to fire
</action>
Events are a cool way to add some liveliness or motion to your landscapes. Having lightning bolts, meteors, geysers, etc can be a nice enhancement to many landscape themes. Like all the optional landscape features, they are especially powerful when used to compliment the features found in many of the other landscape files.