| Revision as of 21:05, 13 August 2006 Bobirov (Talk | contribs) First draft of event file syntax docs ← Previous diff |
Revision as of 02:33, 14 August 2006 Bobirov (Talk | contribs) Event Syntax - added random condition descriptions Next diff → |
||
| Line 48: | Line 48: | ||
| <condition type="random"> | <condition type="random"> | ||
| - | <font color=yellow><i>*</i></font> | + | <font color=yellow><i>Event might occur once per turn based on random chance</i></font> |
| - | <randomchance>#</randomchance> | + | <randomchance>0 to 1</randomchance> |
| - | <font color=yellow><i>*</i></font> | + | <font color=yellow><i>Percent chance of event occuring</i></font> |
| - | <randomdelay>#</randomdelay> | + | <font color=yellow><i>0.5 = 50%, 1.0 = 100%, etc</i></font> |
| - | <font color=yellow><i>*</i></font> | + | <randomdelay>#, in seconds</randomdelay> |
| + | <font color=yellow><i>Amount of time to delay before the event fires</i></font> | ||
| </condition> | </condition> | ||
| Line 63: | Line 64: | ||
| </event> | </event> | ||
| <HR> | <HR> | ||
| + | |||
| === Closing Remarks === | === Closing Remarks === | ||
| 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 [[Syntax_For_Landscapes|landscape files]]. | 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 [[Syntax_For_Landscapes|landscape files]]. | ||
Contents |
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. Like most of the optional landscape features, they can be called from either Definition_Files or Texture_Files.
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>
...
</condition>
<action>
...
</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 can contain the following information. Descriptions are in yellow.
<event>
The condition tag determines when/how often the event is fired.
The condition types available for use are time and random.
<condition type="time">
This condition returns true after a specified range of time passes.
<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>
- OR -
<condition type="random">
Event might occur once per turn based on random chance
<randomchance>0 to 1</randomchance>
Percent chance of event occuring
0.5 = 50%, 1.0 = 100%, etc
<randomdelay>#, in seconds</randomdelay>
Amount of time to delay before the event fires
</condition>
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>
</event>
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.