The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall
This article lists commands that can be used with the #exec compiler directive. This directive exists in Unreal Engine 1 and 2, but available commands vary between engine generations or even games. Most of these commands will load or import resources during the compile process. All of these commands can be used on the UnrealEd console as well, but some may behave slightly different there.
All commands described here have one or more parameters in the form "paramname=value". Each parameter should only be specified once, but the order in which parameters appear does not matter. Most parameters can be omitted, but some are mandatory. While most optional parameters have a default value, some of them trigger special behavior when omitted, which cannot be specified through a value. Some parameters are boolean, i.e. they are interpreted as on/off switches. These interpret the values "On", "True" (and its localized version) or "1" as enabled and all other values as disabled.
|Please help improve this article or section by expanding it.
Further information might be found on the talk page.
Note: Boolean types can also be assigned with off(false/0) and on(true/1).
- String File
- The WAV file to import.
- Name Package (optional)
- The package to import the sound to. Defaults to the package to compile. You shouldn't use this parameter in #exec directives.
- Name Group (optional)
- If specified, the sound is imported into this group, otherwise it ends up outside any groups.
- Name Name (optional)
- The target name for the imported sound. Defaults to the WAV file name without path and file extension.
Short for Obj Load.
Loads an existing package file, optionally under a different name. If a package is loaded under the name of the package to compile, its content will be saved in the compiled package.
#exec obj load file=..\Sounds\Announcer.uax // ensures the Announcer sounds are loaded #exec obj load file=MySkins.utx package=MyMod.Skins // loads the MySkins.utx package and places its content in the Skins group of the MyMod package
Imports an image file as Texture. Images must have dimensions that are both powers of 2. Supported formats depend on the engine version, but generally Unreal Engine 1 only supports 8 bit (256 colors) formats. 16 bit grayscale formats are used for terrain height maps, so they might not be useful for #exec directives. Most image editing programs don't understand 16 bit grayscale formats correctly and interpret them as 16 bit color formats instead.
Supported formats in Unreal Engine 2:
- BMP; 8 bit palette (256 colors), 24 bit RGB or 16 bit grayscale; RLE and other compression type are not supported
- PCX; 8 bits per plane and either 1 (256 colors) or 3 (RGB) planes; RLE compression is expected
- TGA; 24 bit RGB, 32 bit RGBA or 16 bit grayscale; uncompressed or RLE
- DDS; only DXT 1, 3 or 5
- UPT (UPaint format)
Parameters (all optional except File):
- String File
- The image file to import.
- Name Package
- The package to import the texture to. Defaults to the package to compile. You shouldn't use this parameter in #exec directives.
- Name Group
- If specified, the texture is imported into this group, otherwise it ends up outside any groups.
- Name Name
- The target name for the imported texture. Defaults to the image file name without path and file extension.
- Bool Mips
- Whether to generate mipmaps for the texture. Defaults to On.
- Byte LODSet
- Which LOD set to use for the texture. Defaults to 1, i.e. LODSET_World. Values correspond to the numeric representation of the values of the ELODSet(RTNP, U1, UT, U2, U2XMP, UE2Runtime, UT2003, UT2004) enum.
- Bool Alpha/AlphaTexture
- Whether the texture should use its alpha channel for transparency by default. Defaults to Off.
- Byte NormalLOD
- Bool Masked
- Whether the texture should be masked, i.e. have completely transparent parts, while everything else is completely opaque. UE1 uses palette index 0 as mask, UE2 checks the alpha channel for more than 50% transparency. Defaults to Off.
- Bool Modulated
- Forces mipmap creation using a 50% gray border color. This should be used e.g. for modulated decals. Defaults to Off.
- Bool Additive
- Forces mipmap creation with a black border color. Defaults to Off.
- Name Next
- Specifies the next texture in an animated texture sequence. If the name of imported textures end in "_a??" where ?? stands for a 2-digit number, this property is filled automatically.
- Byte DXT
- If specified as 1, 3 or 5, the texture is compressed using DXT1, DXT3 or DXT5 respectively. Compression will respect the Modulated or Additive parameters to fade out generated mipmaps to gray or black respectively and apply corresponding border colors.
- Bool AlphaTrick
- Only for textures with a palette. Copies the blue value over to the alpha value. Defaults to Off. (Usually you will want to use a DXT5 texture with an alpha channel instead as it has the same size as an 8 bit texture, while providing greater flexibility.)
- Byte UClampMode, VClampMode
- Sets the corresponding clamp mode to "clamp" or "wrap". Wrapped textures repeat when applied to a larger surface, clamped textures just repeat their border pixels. Defaults to "wrap".