Exec Commands

From Oldunreal-Wiki
Revision as of 20:39, 24 February 2014 by Skaarj ZR (talk | contribs)
Jump to navigation Jump to search

Before we get started, thanks to c0mp1le, Ob1-Kenobi & Mr.Mitchell for their invaluable advice during the creation of this tutorial.

#exec commands are used to import resources (e.g. models, textures, sounds, etc.) into a .u file, the resource can be in the relevant Unreal format (e.g. utx, uax) or in one of a number of other formats that UCC and UnrealEd support.#exec commands can either be placed in the body of a UnrealScript class or typed directly into the UnrealEd console.

Miscellaneous Resources

#exec OBJ LOAD

This #exec command will import a pre-existing Unreal resource, commonly a .utx file.


Parameter Description Possible values Optional?
FILE specifies the path of the resource to import    
PACKAGE specifies the name of the package to import resource into    

Example:


#exec OBJ LOAD FILE=..\Textures\JWSKy.utx PACKAGE=SE

#exec TEXTURE IMPORT

Imports a texture from a .pcx file.


Parameter Description Possible values Optional?
NAME specifies the name of the texture in Unreal    
FILE specifies the path of the texture to import    
GROUP which group in the current package to place the texture   Yes
MIPS whether or not mip-maps should be generated for this texture, should be OFF for textures that'll be used by UWindows (e.g. new HUD icons) ON/OFF Yes
FLAGS 2 = masked texture   Yes

Example:


#exec TEXTURE IMPORT NAME=Light FILE=Textures\Light.PCX GROUP="Icons" MIPS=OFF FLAGS=2

#exec FONT IMPORT

Import a font texture for use as a font in Unreal.


Parameter Description Possible values Optional?
FILE specifies the path of the font texture to import    
NAME specifies the name of the font in Unreal    

Example:


#exec FONT IMPORT FILE=Textures\MedFont.pcx NAME=MedFont

#exec NEW TRUETYPEFONTFACTORY

Import a true type font for use as a font in Unreal. For a thorough explanation of the nuances of importing true type fonts read this.


Parameter Description Possible values Optional?
PACKAGE specifies the name of the UTX package to import the font into (but only if importing from within UnrealEd)   Yes
NAME specifies the name of the font in Unreal    
FONTNAME specifies the Windows name of the font to be imported, e.g. "Arial"    
HEIGHT height of the font in pixels, which is passed to the Windows' CreateFont() API call    
ANTIALIAS whether or not to anti-alias the font when importing it (1 = anti-aliased) 0/1  
CHARACTERSPERPAGE specifies the number of characters per 256x256 pixel font texture. The default is 64   Yes
XPAD adds horizontal space between characters   Yes
YPAD adds vertical space between characters   Yes

Example:


#exec NEW TRUETYPEFONTFACTORY NAME=Tahoma30 FONTNAME="Tahoma" Height=30 ANTIALIAS=1 CHARACTERSPERPAGE=32

#exec AUDIO IMPORT

Import a sound from a .wav file.


Parameter Description Possible values Optional?
FILE specifies the path of the sound to import    
NAME specifies the name of the sound in Unreal    
GROUP which group in the current package to place the sound   Yes

Example:


#exec AUDIO IMPORT FILE="Sounds\ChainSaw\ChainIdle.WAV" NAME="ChainIdle" GROUP="ChainSaw"

Vertex Animation

Importing models into Unreal requires an understanding of the LOD system, read up on it here.

#exec MESH LODPARAMS

Configure various LOD options for a mesh (vertex or skeletal).


Parameter Description Possible values Optional?
MESH specifies the mesh to configure LODing for    
STRENGTH per-mesh linear LOD scaler, default = 1.0, higher values result in more aggressive LOD-culling    
MINVERTS the minimum number of vertices you want your mesh to always retain at the farthest distances   Yes
MORPH the proportion of vertices that are allowed to contribute to the smooth morphing, 0.0 for no morphing 0 - 1 Yes
ZDISP specifies in UUs the distance at which the LOD culling kicks in   Yes

Example:


#exec MESH LODPARAMS MESH=LodMesh STRENGTH=1.0 MINVERTS=14 MORPH=0.25 ZDISP=90.0

#exec MESH IMPORTImports a vertex mesh (_d.3d).


Parameter Description Possible values Optional?
MESH specifies the name of the mesh in Unreal    
ANIVFILE specifies the path of the animation file    
DATAFILE specifies the path of the vertex mesh    
X, Y, Z set the origin of the mesh   Yes
MLOD whether or not this mesh should be LODed 0/1 Yes
LODSTYLE bit field with switches to change the style of building the pre-collapse sequence 1, 2, 4, 8, 16 Yes
LODFRAME specify which animation frame rather than the default 0th frame to be sampled for generating the collapse sequence   Yes
LODNOTEX causes texture coordinates to be ignored when importing   Yes
LODOLD maintain the original order of animation vertices as they are imported   Yes

Example:


#exec MESH IMPORT MESH=Duke ANIVFILE=MODELS\Duke_a.3d DATAFILE=MODELS\Duke_d.3d X=0 Y=0 Z=0 LODSTYLE=1

#exec MESH ORIGIN

Sets the origin of a mesh.

 


Parameter Description Possible values Optional?
MESH specifies the mesh to set the origin of  
X, Y, Z set the origin of the mesh   Yes
YAW, ROLL, PITCH set the rotation of the mesh   Yes

Example:


#exec MESH ORIGIN MESH=Duke X=0 Y=0 Z=0

#exec MESH SEQUENCE

Define an animation sequence.


Parameter Description Possible values Optional?
MESH specifies the mesh to create an animation sequence for    
SEQ specifies the name of the animation sequence    
STARTFRAME specifies the frame at which the animation sequence starts    
NUMFRAMES specifies the number of frames in the animation    
RATE frames per second (though the duration of the anim is set in PlayAnim() calls)   Yes
GROUP which group to place the anim in   Yes

Example:


#exec MESH SEQUENCE MESH=Duke SEQ=All STARTFRAME=0 NUMFRAMES=265

#exec MESH NOTIFY

Create a notification callback.


Parameter Description Possible values Optional?
MESH the mesh to link the notification to    
SEQ specifies the name of the animation sequence    
TIME call the notify function after this fraction of the animation has played (e.g. 0.1 = 1/10th) 0 - 1  
FUNCTION specifies the name of the function to call    

Example:


#exec MESH NOTIFY MESH=Duke SEQ=All TIME=0.1 FUNCTION=LandThump

#exec MESHMAP NEW

Define a meshmap to apply textures to a mesh.


Parameter Description Possible values Optional?
MESHMAP specifies the name of the meshmap    
MESH specifies the mesh which the meshmap applies to    

Example:


#exec MESHMAP NEW MESHMAP=Duke MESH=Duke

#exce MESHMAP SCALE

Change the scale of a meshmap.


Parameter Description Possible values Optional?
MESHMAP specifies the meshmap to scale    
X, Y, Z how much to scale the meshmap on each axes    

Example:


#exec MESHMAP SCALE MESHMAP=Duke X=0.1 Y=0.1 Z=0.2

#exce MESHMAP SETTEXTURE

Assign a texture to part of a meshmap.


Parameter Description Possible values Optional?
MESHMAP specifies the meshmap to assign textures to    
NUM where to place this texture in the MultiSkins array    
TEXTURE specifies the name of the texture to apply, this texture should already have been imported    

Example:


#exec MESHMAP SETTEXTURE MESHMAP=Duke NUM=0 TEXTURE=Duke0

Skeletal Animation

Essential reading for the skeletal animation system can be found here.

#exec MESH MODELIMPORT

Imports a skeletal mesh (.psk).


Parameter Description Possible values Optional?
MESH specifies the name of the mesh in Unreal    
MODELFILE specifies the path of the model to import    
X, Y, Z set the origin of the mesh   Yes
MLOD whether or not this mesh should be LODed 0/1 Yes
LODSTYLE bit field with switches to change the style of building the pre-collapse sequence 1, 2, 4, 8, 16 Yes
LODFRAME specify which animation frame rather than the default 0th frame to be sampled for generating the collapse sequence   Yes
LODNOTEX causes texture coordinates to be ignored when importing   Yes
LODOLD maintain the original order of animation vertices as they are imported   Yes

Example:


#exec MESH MODELIMPORT MESH=Tosc MODELFILE=MODELS\Tosc.psK LODSTYLE=8 X=0 Y=0 Z=0

#exec ANIM IMPORT

Import an animation file (.psa).


Parameter Description Possible values Optional?
ANIM specifies the name of the UAnimation object  
ANIMFILE specifies the path of the animation file to import    
IMPORTSEQS 1 signifies that the animation sequence info embedded into the binary .PSA file by the Max exporter is to be used    
MAXKEYS sets an adjustable squeeze on the number of keys in the animation as a whole   Yes
COMPRESS does the same as MAXKEYS, does the same but with a simple factor ranging from 0 to 1 0 - 1 Yes

Example:


#exec ANIM IMPORT ANIM=SkAnimTest ANIMFILE=models\10.psa IMPORTSEQS=1 COMPRESS=0.9 MAXKEYS=9999999

#exec ANIM SEQUENCE

Import an animation sequence.

Yes


Parameter Description Possible values Optional?
ANIM specifies the name of the animation    
SEQ specifies the name of the animation sequence    
STARTFRAME specifies the frame at which the animation starts    
NUMFRAMES specifies the number of frames in the animation    
RATE frames per second (though the duration of the anim is set in PlayAnim() calls)    
GROUP which group to place the anim in   Yes

Example:


#exec ANIM SEQUENCE ANIM=TozcAnim1 SEQ=All STARTFRAME=0 NUMFRAMES=25 RATE=0.2 GROUP=Default

#exec ANIM DIGEST

Once you've imported animations, a DIGEST command needs to be issued, at which point all sequences are compressed into the internal key track format.


Parameter Description Possible values Optional?
ANIM specifies the UAnimation object to "digest" the animations into    
VERBOSE specify 'VERBOSE' to see more information in UCC.log after the rebuild   Yes

Example:


#exec ANIM DIGEST ANIM=SkAnimTest VERBOSE

#exec ANIM NOTIFY

Create a notifcation callback, must be placed after the ANIM DIGEST.


Parameter Description Possible values Optional?
ANIM specifies the animation to link the notification to    
SEQ specifies the name of the animation sequence    
TIME call the notify function after this fraction of the animation has played (e.g. 0.1 = 1/10th) 0 - 1  
FUNCTION specifies the name of the function to call    

Example:


#exec ANIM NOTIFY ANIM=TozcAnim1 SEQ=All TIME=0.1 FUNCTION=LandThump

#exec MESH DEFAULTANIM

Link a UAnimation object to a skeletal mesh at compile time.


Parameter Description Possible values Optional?
MESH specifies the skeletal mesh to link the animations to    
ANIM specifies the UAnimation object to link    

Example:


#exec MESH DEFAULTANIM MESH=MeshSk ANIM=SkAnimTest

#exec MESH BOUNDINGBOX

Override the engine's default bounding box with one that better fits the model.


Parameter Description Possible values Optional?
MESH specifies the mesh to define the bounding box for    
XMIN, YMIN, ZMIN define the lower bounds of the box    
XMAX, YMAX, ZMAX define the upper bounds of the box    

Example:


#exec MESH BOUNDINGBOX MESH=MeshSk XMIN=-64.0 YMIN=-64.0 ZMIN=-64.0 XMAX=64.0 YMAX=64.0 ZMAX=64.0

#exec MESH WEAPONATTACH

Define which bone is the weapon carrier.


Parameter Description Possible values Optional?
MESH specifies the mesh we're defining the weapon bone for    
BONE the name of the bone to assign as weapon carrier    

Example:


#exec MESH WEAPONATTACH MESH=MeshSk BONE="Right hand"

#exec MESH WEAPONPOSITION

Define the location of the attachment point, relative to the weapon carrier bone.


Parameter Description Possible values Optional?
MESH specifies the mesh we're dealing with    
YAW, PITCH, ROLL specifies the rotation of the weapon attachment point    
X, Y, Z specifies the location of the weapon attachment point    

Example:


#exec MESH WEAPONPOSITION MESH=MeshSk YAW=50 PITCH=0 ROLL=10 X=0.0 Y=0.0 Z=0.0