GeneratorFiles

From Amulets & Armor Wiki
Revision as of 20:46, 25 February 2017 by PeeWeeRotA (Talk | contribs) (Trouble Shooting)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Every map must have a .GEN file, but most maps are empty. GEN files are only created when monsters need to be spawned in through scripting. Generators are almost always used for multiple monster spawners, but are occasionally used to spawn single items. One example is Quest 2 Map 1 in "Knights of Andrew". The Key is generated.

Generator files contain indexed rows of Generator entries. They are referred to in script by their index.

All generator lines must end with a New Line. Make sure you press enter after adding a line, even for the last line. (This is windows new line which requires both Carriage Return and Newline)

Format

[G] [ObjType] [X] [Y] [Angle] [EverySeconds] [PlusRandomSeconds] [MaxObjects] [MaxLikeObjects] [Active] [MaxGenerate]

Arguments

G - G is an identifier that this line is a Generator. Only lines starting with "G" are considered valid generator lines

ObjType - Object Type to spawn. Use list of Thing Numbers as a reference.

X - X position on level

Y - Y position on level

Angle - Angle of object. This is an in game angle system, angles seem to be fractions of 60000. Needs verified

EverySeconds - Time between spawns in Seconds

PlusRandomSeconds - Additional time between spawn

MaxObjects - Maximum number of objects of this type allowed in level. If more exist, generate attempt fails.

MaxLikeObjects - Maximum number of objects with the same Base type in level. If more exist, generate attempt fails.

Active - 0 to start off. 1 to start on

MaxGenerate - Total number of times the generator can successfully generate an object before permanently shutting off. Does not reset when deactivated and reactivated.

Example

; G=Generator ObjType X Y Angle EverySeconds PlusRandomSeconds
; MaxObjects MaxLikeObjects Active MaxGenerate
G 1002 114 255 40000 3 0 50 50 0 2
G 1002 106 6 24000 3 0 50 50 0 2
G 1002 -336 6 8000 3 0 50 50 0 2
G 1002 -326 265 56000 3 0 50 50 0 2
G 4080 1508 2586 40000 5 0 50 50 0 14

Troubleshooting

Crash on Activate - Wrong Generator Number

Generators are listed one line at a time and are zero indexed. Typically there are two lines of comments before the first generator line. Reference generators by their position starting at 0. Off by one errors are the most common cause of crashes with .GEN files.

Crash on Activate - Missing blank line

Generator files must end with a blank line. The game uses the last blank line to determine the end of the generator list. Verify that the last line is simply a new line with no other text in it.


Back to Scripting Main Page