Generators cause enemies to appear mid-way through a level. Here is a quite self explaining example:
| | CLASS: SPRITE DATA: 4 X: 396.88 Y: -2.00 Z: 217.48 |
| \ PCH: 0.00 YAW: 0.00 ROL: 0.00 |
| \ DIFF: 1 |
| | SEQ |
| | LOGIC: GENERATOR STORM1 |
| | DELAY: 30 |
| | INTERVAL: 20 |
| | MIN_DIST: 70 |
| | MAX_DIST: 200 |
| | MAX_ALIVE: 3 |
| | NUM_TERMINATE: 8 |
| | WANDER_TIME: 40 |
| | SEQEND |
All generated enemies will use the sprite defined, and will appear "awake" (i.e. walking around, not standing still) from the X, Y and Z coordinates of the generator.
LOGIC: is the logic that the generated sprites will have. Note the GENERATOR keyword. Note also that only the following logics are allowed to be generated (generating others will cause problems and usually crash the game!)
I_OFFICER and key variations
TROOP
STORM1
COMMANDO
BOSSK
G_GUARD
REE_YEES
REE_YEES2
SEWER1
INT_DROID
PROBE_DROID
REMOTE
DELAY: is the time in seconds that needs to pass from the start of a level before the generator starts operating.
INTERVAL: is the time in seconds between each generation.
For an enemy to be generated, the player must be at a distance from the generator that is between MIN_DIST and MAX_DIST.
MAX_ALIVE: is the maximum number of enemies from the generator allowed alive at the same time.
NUM_TERMINATE: is the number of enemies to be generated. When this is reached, the generator deactivates. If set to -1, an infinite amount will be generated, and the generator will never deactivate.
WANDER_TIME: is the time in seconds that a generated sprite walks around before becoming inactive.
Note: in DARK.EXE, there is a keyword "PLUGIN:" among the above generator keywords. Its usage is still unknown.
Sprites aren't generated when the generator is able to see you, however (otherwise it would look like the enemies were walking out of thin air!). The best way to observe a generator working is therefore on the map by using the LACDS cheat.
Also note that you can set MASTER: OFF on a generator (not to be confused with the INF master variable!), and activate it by sending a "master_on" message to the sector that contains it.