Maps/Section: Events
Flag: | Maps/Section: Events |
File(s): | rules(md).ini |
Values: | ERROR – No value types set! Please edit this page and fix the Flag template! |
This entry was copied from DeeZire's Red Alert 2 and Yuris Revenge INI Editing Guide for the sake of completeness. As it is not our intention to rip off DeeZire's work, this article is subject to a re-write and update with the latest community knowledge. For further information, please read Inclusion of The Guide. |
Events are the fundamental backbone of Red Alert 2. The game engine constantly performs tests to see if certain conditions are met, and by specifying an Event matched to one of those conditions, you can tell the game what to do when that Event occurs.
When specifying an Event, you are telling the game to do something when something happens (a condition is met). If that condition is met, then a Trigger is fired which in turn tells the game to carry out an Action. A Tag is used to tie the whole process together and can be used to attach the Event to an object (structure or unit). A CellTag can be used to attach the Event to a particular cell (kind of a special Waypoint). An Event entry takes the following format;-
ID=N,A,B,A1,B1...
ID=
Is the hexadecimal numbered string which is the unique identifier for this Event. For convention, it is wise to stick to this hex numbering system although this is not strictly necessary. NOTE: this ID should match the ID for the corresponding Trigger= and also the corresponding Action=. The associated Tag= (see later) is what strings the whole process together.
N
Is the number of events to be tested. The game will expect this number of Events followed by their parameters in the list.
A,B,A1,B1...
This is a list of each Event - as you can see, several can be strung together to specify Actions which will fire a Trigger when every event in that list is satisfied. The 'A' parameters are the Event numbers which specify which condition has been met. Each of the Events require a 'B' parameter which provides information for the Event - they mean different things for different Events. Here's an example of an Event entry;-
06117B60=2,13,0,5,36,0,3
In the example you can see that we have 2 events (number of events to satisfy is set to '2') and the data for each of those events follows - the first event is 13,0,5 and the second event is 36,0,3. Using the guide below, that line means that when 5 seconds have expired (13,0,5) AND Local Variable number 3 is set (36,0,3) then the associated Trigger= will be fired.
A full list of available events and a more detailed description of each follows. TIP: during the detailed descriptions, you will find many references to RULES file entries and sections. These are mentioned since they can also be included in your map file to provide a further degree of customization to the map and gain more control over the events themselves - refer to the RULES.INI Guide for more details.
0 = No Event - eg 0,0,0
Used to define a trigger which will never be activated by any Event= in the game. This is useful if you want to make some sort of 'once only' special Action= in the game, and you use the 'force trigger' Action= (see later) to activate it. Both parameters should be set to 0. This is a null event. There is no need to ever use this in a real trigger.
1 = Attached Object/CellTag Entered - eg 1,0,0
Used to fire a trigger when the object to which this Event= has a Tag= attached is entered by the House number specified in parameter 2. If you attach the Tag= for this Event= to a structure in the [Structures] section of the map file, the Trigger is fired if the building is entered by any unit which has Infiltrate=yes set. The same applies for the use of a CellTag which should point to this Event=. The second parameter specifies the number of the House= which will trigger this Event=. Triggers when an infantry or vehicle enters the attached object. Typically this trigger is attached to a building or a cell.
2 = Attached Structure Spied - e.g. 2,0,0
If you attach the Tag= for this Event= to a structure in the [Structures] section of the map file, the Trigger= is fired if the building is entered by any [InfantryType] which has Infiltrate=yes and Agent=yes set. Note that for this to have any effect, the structure should also have Spyable=yes set as the Spy functionality is structure specific in Red Alert 2.
3 = Attached Structure Thieved - e.g. 3,0,0
If you attach the Tag= for this Event= to a structure in the [Structures] section of the map file, the Trigger= is fired if the building is entered by any [InfantryType] which has Thief=yes set and belongs to the House number specified by parameter 2. Note that for this to work, the structure should also have a Storage= value and Spyable=yes set as the thief functionality is related to the Spy logic and thus is structure specific in Red Alert 2.
4 = Attached Object Is Discovered By Player - e.g. 4,0,0
Fired when an object to which this is attached is discovered by a human player. Discovered is defined as being revealed from under the shroud when the object falls within the Sight= range of a player owned object. You can only add the Tag= to infantry, units, aircraft or structures in the objects' entry in the relevant section of your map file, and you cannot associate it with a specific side because only human players (houses with PlayerControl=yes set) can activate this Event.
5 = House Discovered By Player - e.g. 5,0,<house number>
Fired when any object owned by the House number specified in parameter 2 is discovered by a human player. Discovered is defined as being revealed from under the shroud when the object falls within the Sight= range of a player owned object. Note that only human players (houses with PlayerControl=yes set) can fire this because the human and AI's Sight= ranges are co-extensive.
6 = Attached Object Is Attacked By Any House - e.g. 6,0,0
Fired when any object to which this Event has a Tag attached and owned by the House number specified in parameter 2 is attacked by any object belonging to another House.
7 = Attached Object Destroyed By Any House - e.g. 7,0,0
Fired when the attached object is destroyed by any House=. You can only add the tag to infantry, units, aircraft or structures in the objects' entry in the relevant section of your map file. If you attach this to a TeamType, then only 1 member of the team has to be destroyed for this event to be true. Note that if the object is destroyed by incidental damage or 'friendly fire' then the associated Trigger= will not be fired.
8 = Any Event - e.g. 8,0,0
Fired when any event at all occurs. This is commonly used to fire a Trigger= right at the start of the game. When used alone it will force the Trigger= to spring immediately.
9 = All Units Destroyed - e.g. 9,0,<house number>
Fired when all units belonging to the House= number defined in parameter 2 are destroyed. Units in this case includes all infantry, vehicles (including ships) and aircraft. Note that reinforcements which are either incoming or on the map waiting to be deployed are not included in this check. Also, any units with Owner=Civilian or Insignificant=yes set are not counted either. This is typically used for end of game conditions.
10 = All Structures Destroyed - e.g. 10,0,<house number>
Fired when all structures belonging to the House= number defined in parameter 2 are destroyed. Any structures belonging to this House= which have Insignificant=yes set are not counted here, for example walls.
11 = House Completely Destroyed - e.g. 11,0,<house number>
Fired when all structures, vehicles (including ships), units and aircraft belonging to the House= number defined in parameter 2 are destroyed. Any structures belonging to this House= which have Insignificant=yes set in their entry in the RULES file are not counted here, for example pavement and walls. This is most commonly used to define the 'game over' condition.
12 = Credits Greater Than - e.g. 12,0,<number of credits>
Fired when the House= associated to this Trigger= has more credits than the number specified in parameter 2.
13 = Time Units Passed - e.g. 13,0,<number of seconds>
Fired when the number of seconds specified in parameter 2 have passed after this condition is tested. This is used when you want something to happen a specific amount of time after an event is tested and found to be true. Note that unlike event #47 this time interval is relevant to the time when the event is checked, so this time interval is not relative from the start of the game, nor is it related to the global timer which is used for time-dependant missions. This is frequently used to put a small delay between some events when there are a lot of actions associated with that event, in order to keep the game synchronized and in flow. The time is initialized when the Trigger= is sprung and is reset if the Trigger= is repeating.
14 = Global Timer Expired - e.g. 14,0,0
Fired when the global timer reaches zero. This is used when you want to specify a time limit either on the mission or to complete objectives, and make something happen when the time has run out.
15 = Number Of Structures Destroyed - e.g. 15,0,<number of structures>
Fired when the number of structures in parameter 2 is destroyed by the house to which the trigger is associated. Note that unlike event #10 all structures are included in this count including any with Owner=Civilian or Insignificant=yes set.
16 = Number Of Units Destroyed - e.g. 16,0,<number of units>
Fired when the number of units in parameter 2 is destroyed by the house to which the trigger is associated. Note that unlike event #9 all units are included in this count including any with Owner=Civilian or Insignificant=yes set. Units in this case includes infantry, vehicles (including ships) and aircraft.
17 = No Factories Left - e.g. 17,0,<house number>
Fired when the house specified in parameter 2 has no factories left. A factory is any structure which is used to produce something else as defined by the presence of the Factory= statement in its entry in the RULES file. By default, this includes Construction Yards, Weapons Factories (and Shipyards), Barracks and Helipads.
18 = Civilians Evacuated - e.g. 18,0,<house number>
Fired when one or more civilian units are evacuated by the house in parameter 2. Evacuated in this case means the civilian unit has left the visible area of the map (as defined in the [Map] section) in a transport belonging to the house in parameter 2. A civilian unit is defined by the presence of the Civilian=yes statement in this units entry in the RULES file. Note that for this to function correctly, you should ensure that CivEvac=yes is set in the map's [Basic] section.
19 = Structure Is Built - e.g. 19,0,<structure number>
Fired when the structure defined in parameter 2 is built. The structure number is from an internal table, not the RULES file list. Built means it has been constructed and actually placed onto the map by a player.
20 = Unit Is Built - e.g. 20,0,<vehicle number>
Fired when the unit defined in parameter 2 is built. The unit number is from an internal table, not the RULES file list. Note that built means it has been built and actually appears on the map from a War Factory or Shipyard.
21 = Infantry Is Trained - e.g. 21,0,<infantry number>
Fired when the infantry unit defined in parameter 2 is trained. The infantry number is from an internal table, not the RULES file list. Note that trained means it has been 'built' and actually appears on the map from a Barracks.
22 = Aircraft Is Built - e.g. 22,0,<aircraft number>
Fired when the aircraft defined in parameter 2 is built. The aircraft number is from an internal table, not the RULES file list. Note that built means it has been built and actually appears on a helipad or flies onto the map.
23 = Team Leaves Map - 23,0,<teamtype>
Fired when the team type specified in parameter 2 (which must also be listed in the [TeamTypes] section of the map) leaves the visible area of the map as defined in the maps [Map] section. If the team is destroyed it won't trigger. If all but one member is destroyed and that last member leaves the map it will spring.
24 = Zone Entered - e.g. 24,0,<celltag>
Fired when the zone of the attached celltag is entered by the house defined in parameter 2. There are 2 types of zone, 'passable' (that is, a ground-based unit can traverse it) and 'impassable' (a ground-based unit cannot traverse it). If the celltag associated with this trigger is on a tile which is classed as passable terrain (i.e. just plain ground) then the zone is any area of the map that a ground-based unit can reach. So if the map was just plain flat terrain then the entire map would be the zone. If the map was divided in half by a river with no way to get from one side to the other, then the zone would be the half of the map that the celltag is in. Bridges are included as passable land, so if the same map divided in half by a river had a bridge crossing it, the 'zone' would be the entire map except for the river itself - only the bits accessible by ground-based units would fire the trigger. If on the other hand the celltag is placed on a tile which is classed as impassable terrain, then the zone will be all of the impassable areas of the map (i.e. all cliffs etc, areas that cannot be traversed by ground-based units). In practice - if the celltag is placed on passable terrain and the action is to 'reveal around waypoint', then all areas of the map which the ground-based unit can access would be revealed - not just the waypoint itself. If the same celltag is placed on impassable terrain, then all areas of the map that cannot be accessed would be revealed (e.g. all cliff faces, all water etc). It only appears to work for ground-based units, not for hover units or aircraft. This trigger must be located in a cell and only a cell.
25 = Horizontal Axis Crossed - e.g. 25,0,<house number>
Fired when any object belonging to the house in parameter 2 crosses the horizontal line as indicated by the location of this trigger. This trigger must be placed in a cell. In other words, it crosses the line either by travelling north to south or vice versa.
26 = Vertical Axis Crossed - e.g. 26,0,<house number>
Fired when any object belonging to the house in parameter 2 crosses the vertical line as indicated by the location of this trigger. This trigger must be placed in a cell. In other words, it crosses the line either by travelling east to west or vice versa.
27 = Global Is Set - e.g. 27,0,<global number>
Satisfied when the specified global variable is set (holds a value of '1').
28 = Global Is Cleared - e.g. 28,0,<global number>
Satisfied when the specified global variable is clear (holds a value of '0').
29 = Attached Object Lost - e.g. 29,0,<house number>
Fired when the object to which this events tag is attached is lost by the house defined in parameter 2. Note that this is a unique event quite apart from numbers 7 and 48, as it will be true when this house loses the structure for any reason, i.e. it could be captured or destroyed by any other house and the event would be true. NOTE: this does not trigger if the attached object infiltrates a building/unit.
30 = Low Power - e.g. 30,0,<house number>
Fired when the house defined in parameter 2 is in a low power situation (falls below 100% power supply) for whatever reason. This is the event used by the game to trigger the 'Low Power' action and disable certain functions and pause super weapon recharging.
31 = Bridge Destroyed - e.g. 31,0,0
You must place a celltag on the relevant bridge for this to work. Fired when the bridge to which the events tag is attached is destroyed by any house. Note that this will not fire if you have BridgeDestruction=no set in your [MultiplayerDialogSettings] section of the RULES file or this is a multiplayer map and the 'Destroyable Bridges' option is not selected. A bridge is considered destroyed when an impassable gap is created in the bridge.
32 = Building Exists - e.g. 32,0,<structure number>
Fired when the structure defined in parameter 2 is present on the map. Specify the country to test for in this events associated trigger. This works for buildings that are pre-existing or constructed by deploying.
33 = Object Selected - e.g. 33,0,<tag on object>
Fired when the attached object is selected by the player. Note that if you attach this to a team type, then the trigger will be fired even if only one member of that team is selected. Specify the house to test for in this events associated trigger. Used in single player only.
34 = Waypoint Approached - e.g. 34,0,<waypoint number>
Fired when the waypoint in parameter 2 is approached by the house defined in the trigger. Approached means that the waypoint has fallen within the sight range of the unit moving towards it as defined in the units Sight= entry in the RULES file.
35 = Object Detected By Searchlight - e.g. 35,0,<house number>
You must attach a tag to the searchlight for this to work. Trigger is fired when the searchlight detects an object from the house defined in parameter 2. It is not known if the spotlight logic can be made to work in Red Alert 2.
36 = Local Is Set - e.g. 36,0,<local number>
Fired when the local number defined in parameter 2 is set (i.e. holds a value of '1'). The global must first have been assigned an initial value in the [VariableNames] section of the map file. Testing for undefined globals may cause Internal Errors.
37 = Local Is Clear - e.g. 37,0,<local number>
Fired when the local number defined in parameter 2 is not set (i.e. holds a value of '0'). The global must first have been assigned an initial value in the [VariableNames] section of the map file. Testing for undefined globals may cause Internal Errors.
38 = Object Is Damaged - e.g. 38,0,0
Fired when the object to which this events associated tag is attached first gets damaged from combat damage only.
39 = Object At Half Health - e.g. 39,0,0
Fired when the object to which this events associated tag is attached gets damaged from combat damage only. Damaged in this case means its health goes from green into yellow. The point at which objects health turns yellow can be controlled by the ConditionYellow= statement in the [AudioVisual] section of the RULES file or your map file, which represents the percentage of the objects original health at which the health bar turns yellow and thus this event is satisfied.
40 = Object At Quarter Health - e.g. 40,0,0
Fired when the object to which this events associated tag is attached gets damaged from combat damage only. Damaged in this case means its health goes from yellow into red. The point at which objects health turns red can be controlled by the ConditionRed= statement in the [AudioVisual] section of the RULES file or your map file, which represents the percentage of the objects original health at which the health bar turns red and thus this event is satisfied.
41 = Object Is Damaged - e.g. 41,0,0
Fired when the object to which this events associated tag is attached first gets damaged by any means.
42 = Object At Half Health - e.g. 42,0,0
Fired when the object to which this events associated tag is attached gets damaged by any means. Damaged in this case means its health goes from green into yellow. The point at which objects health turns yellow can be controlled by the ConditionYellow= statement in the [AudioVisual] section of the RULES file or your map file, which represents the percentage of the objects original health at which the health bar turns yellow and thus this event is satisfied.
43 = Object At Quarter Health - e.g. 43,0,0
Fired when the object to which this events associated tag is attached gets damaged by any means. Damaged in this case means its health goes from yellow into red. The point at which objects health turns red can be controlled by the ConditionRed= statement in the [AudioVisual] section of the RULES file or your map file, which represents the percentage of the objects original health at which the health bar turns red and thus this event is satisfied.
44 = Object Is Attacked - e.g. 44,0,<house number>
Fired when the object to which this events associated tag is attached is attacked by anything belonging to the house defined in parameter 2.
45 = Ambient Light Less Than - e.g. 45,0,<ambient light value>
Fired when the overall ambient lighting value on the map drops below the value defined in parameter 2 (i.e. it gets darker). The initial ambient light value represents the degree of alpha effect which is applied to all other lighting on the map, and is set with the Ambient=N statement in the maps [Lighting] section, where 'N' is set between 0.00 (totally dark) and 1.00 (completely light). Parameter 2 of this event must correspond to this range of numbers and so should only be set to values between 0 and 100 so the scale matches. This is most commonly used on maps which also have time of day transitions - if the lighting is never adjusted on your map then this event will never be true. The rate at which ambient light calculations are made are set in the [AudioVisual] section of the RULES file with the AmbientChangeRate=0.2 statement (which is the number of minutes between ambient light recalculations) and AmbientChangeStep=0.1 (which is the step rate for gradually changing the ambient lighting).
46 = Ambient Light Greater Than - e.g. 46,0,<ambient light value>
Fired when the overall ambient lighting value on the map rises above the value defined in parameter 2 (i.e. it gets lighter). The initial ambient light value represents the degree of alpha effect which is applied to all other lighting on the map, and is set with the Ambient=N statement in the maps [Lighting] section, where 'N' is set between 0.00 (totally dark) and 1.00 (completely light). Parameter 2 of this event must correspond to this range of numbers and so should only be set to values between 0 and 100 so the scale matches. This is most commonly used on maps which also have time of day transitions - if the lighting is never adjusted on your map then this event will never be true. The rate at which ambient light calculations are made are set in the [AudioVisual] section of the RULES file with the AmbientChangeRate=0.2 statement (which is the number of minutes between ambient light recalculations) and AmbientChangeStep=0.1 (which is the step rate for gradually changing the ambient lighting).
47 = Scenario Time Elapsed - e.g. 47,0,