Note: We'd like to thank Quasar for allowing us to modify the docs of the Eternity Engine to reflect Legacy FraggleScript implementation.
Optional parameter items appear in the descriptions inside square brackets, such as "[ int optional_z_position ]". These square brackets only appear in the descriptions to denote that those parameters are optional, not to be confused with array brackets which are part of an array reference. Do not include the optional parameter denoting square brackets in any actual script. When there are two optional parameters, then to use the second requires that the first also be present (they are positional).
Example: void opendoor(int tagnum, [int waittime], [int speed])
Valid usages for this description (using named consts) would be:
In some cases the first parameter is optional, which is allowed only because it has a unique type that can be tested, such as an mobj, and/or because the function can test the actual number of parameters.
Example: void teleport([mobj mo], int sectortag)
Valid usages (using named consts) would be:
Example of include:
Brings in variables and statements from the lump named lumpname as if they were defined in the current module. Note that included lumps cannot contain scripts or block statements involving braces. The include is performed just before run-time.
Include example:Blue card | 1 |
Yellow card | 2 |
Red card | 4 |
Blue skull | 8 |
Yellow skull | 16 |
Red skull | 32 |
0: | Clip | Wand |
1: | Shell | Crossbow |
2: | Cell | Blaster |
3: | Missile | Skullrod |
4: | - | Phoenixrod |
5: | - | Mace |
0: | Fist | Staff |
1: | Pistol | Wand |
2: | Shotgun | Crossbow |
3: | Chaingun | Blaster |
4: | Launcher | Skullrod |
5: | Plasma | Phoenixrod |
6: | BFG | Mace |
7: | Chainsaw | Gauntlets |
8: | Supershotgun | Beak |
PROP_SPEED: | Extra speed |
PROP_JUMPHEIGHT: | Jump gravity |
PROP_LOCKED: | Controls blocked |
Causes one object to fire a projectile at another object. Type constants are provided in THINGS.H as with spawn(). The source and target parameters may be either integer mapthing numbers or mobj references, and can be set to -1 to cause these parameters to default with the following effects:
source set, target = -1: specified object fires at its current target
source = -1, target set: trigger object fires at specified object
source set, target set: specified object 1 fires at specified object 2
source = -1, target = -1: trigger object fires at its current target
The face parameter, if non-zero, will cause the source object to face the target object before firing, possibly incurring inaccuracy if the target object is partially or totally invisible. If face is zero, the projectile will be fired toward the target from whatever side of the source that currently faces it, which may be appropriate for certain effects.
This function is primarily designed for use with the StartScript code pointer via DeHackEd.
DO *NOT* attempt to spawn objects which do not have the MISSILE and NOBLOCKMAP flags with this function. This can cause run-time memory errors. Flag information for objects is available in the DeHackEd documentation.
1: | FLICKERING LIGHTS |
2: | STROBE FAST |
3: | STROBE SLOW |
8: | GLOWING LIGHT |
10: | DOOR CLOSE IN 30 SECONDS |
12: | SYNC STROBE SLOW |
13: | SYNC STROBE FAST |
14: | DOOR RAISE IN 5 MINUTES |
17: | LIGHT FLICKERS RANDOMLY |
Creates a new heads-up pic using the lump (lumpname), in the first available handle, and returns that handle number. It is initialized with draw disabled. Draw must be enabled by setpicvisible. It is always drawn as a patch with tranparent areas, in handle order, later handle on top. Sequential createpic calls will draw in that same order, later on top. Deletepic will delete a handle that will be before some earlier createpic, and the next createpic will reuse that handle. Fragglescript pics are drawn last over everything else, except the console.
The lump must be a standard DOOM-format screen graphic, at unscaled screen coordinates (x, y), which may range from 0 to 319 and from 0 to 199 respectively.
Heads-up pics are valid for the duration of the level in which they were created, and will be saved in savegames. This function returns an integer handle that is needed to display, modify, or delete the pic later.
0: | CORONA_TYPE | See corona type table. | int |
1: | CORONA_OFFX | x offset | fixed |
2: | CORONA_OFFY | y offset | fixed |
3: | CORONA_COLOR | Hex RGB | string, int |
4: | CORONA_SIZE | radius | fixed |
5: | LIGHT_COLOR | Hex RGB | string, int |
6: | LIGHT_SIZE | radius | fixed |
The corona type now has a new format with bit enables and the type of corona. The older predefined names and their values are still recognized. Doom Legacy will convert them to an appropriate new field setting (heuristic guessing).
0: | UNDEFINED_SPR | off |
1: | CORONA_SPR | corona only |
2: | DYNLIGHT_SPR | dynamic light only |
3: | LIGHT_SPR | corona+light |
19: | ROCKET_SPR | rocket+corona+light+randomradius |
0x01 | CORONA_SPR | enable corona draw |
0x02 | DYNLIGHT_SPR | enable dynamic light |
0x00 | SPLT_unk | plain corona, near and far fadeout |
0x10 | SPLT_rocket | rocket corona with random flicker, near and far fadeout |
0x20 | SPLT_lamp | lamp and corona, brighter than plain corona, different size, near and far fadeout |
0x30 | SPLT_fire | fire and torches, slow flicker, near and far fadeout, 64 generators |
0xC0 | SPLT_light | a light source without an object, far fadeout |
0xD0 | SPLT_firefly | blinking firefly, far fadeout, 64 generator phases |
0xE0 | SPLT_random | random LED, no fadeout, 32 generators |
0xF0 | SPLT_pulse | slow pulsation, no fadeout, 256 generator phases |
The generator phases are selected automatically (by some attribute of the mobj), to avoid lights all blinking in synch.
These effects will be improved in future versions of Doom Legacy, so do not rely upon them remaining exactly as they are. Please use them according to their descriptions and intended usage.