This page is relevant to:
Modellers wishing to import a skeletal model using their own #exec script
If you're reading this file, either you use a 3D package for which I haven't got an exporting tutorial yet (experienced modellers, please tell me (<simon at pseudorandom.co.uk>) if you want to contribute one), or you exported your model with ActorX and want more control over how it's imported into UT. So, I'll assume you have a PSK file with your model in, you either have a PSA file with animations or you used a standard Epic male or female skeleton, and you're now wondering "how do #exec commands work?"
To start with, here's the script to import a skeletal model using the standard Epic male animations supplied with Advanced Model Support. Replace (MyMesh) with the mesh name you want and (Filename) with the name of the model file.
#exec MESH MODELIMPORT MESH=(MyMesh) MODELFILE=models\(Filename).PSK LODSTYLE=12 #exec MESH ORIGIN MESH=(MyMesh) X=0 Y=0 Z=135 YAW=192 #exec MESH WEAPONATTACH MESH=(MyMesh) BONE="Bip01 R Hand" #exec MESH WEAPONPOSITION MESH=(MyMesh) YAW=0 PITCH=0 ROLL=128 X=1.0 Y=0.0 Z=0.0 #exec MESHMAP SCALE MESHMAP=(MyMesh) X=0.3125 Y=0.3125 Z=0.3125 #exec MESH DEFAULTANIM MESH=(MyMesh) ANIM=EpicUTPS2MaleAnimation
Replace EpicUTPS2MaleAnimation with EpicUTPS2FemaleAnimation to use the standard Epic female animation set, also supplied with Advanced Model Support. The skeletons needed for these are built into Milkshape 3D and are also available for 3D Studio Max from EpicKnights.
SoldierAnim is in Bonus Pack 4, so users will need Bonus Pack 4 (specifically SkeletalChars.U) to use your model. EpicUTPS2MaleAnimation is almost exactly the same (I swapped a couple of the death animations over to make them more appropriate) but is in AdvancedModelSupport.U, which your new model will require anyway if you used the AMS scripts. Advanced Model Support has no links to SkeletalChars and does not require it to be installed.
To import your own animations and use them instead, you can use
something like this:
(this script is adapted from Burnt Kona's Riot Girl)
// Import the animation set #exec ANIM IMPORT ANIM=(MyAnim) ANIMFILE=models\(Animation filename).PSA COMPRESS=0 IMPORTSEQS=1 #exec ANIM DIGEST ANIM=(MyAnim) VERBOSE #exec ANIM NOTIFY ANIM=(MyAnim) SEQ=RunLG TIME=0.25 FUNCTION=PlayFootStep #exec ANIM NOTIFY ANIM=(MyAnim) SEQ=RunLG TIME=0.75 FUNCTION=PlayFootStep ... and so on ... // Animations done; now import the mesh #exec MESH MODELIMPORT MESH=(MyMesh) MODELFILE=MODELS\(Mesh filename).PSK LODSTYLE=12 #exec MESH ORIGIN MESH=(MyMesh) X=0 Y=0 Z=5 YAW=192 PITCH=0 ROLL=0 #exec MESH WEAPONATTACH MESH=(MyMesh) BONE="Bip01 R Hand" #exec MESH WEAPONPOSITION MESH=(MyMesh) YAW=0 PITCH=0 ROLL=128 X=0.0 Y=0.0 Z=0.0 #exec MESHMAP SCALE MESHMAP=(MyMesh) X=0.8 Y=0.8 Z=0.7 // Finally, link the two together #exec MESH DEFAULTANIM MESH=(MyMesh) ANIM=(MyAnim)
Here's what I think the parameters do: (correctness not guaranteed)
Default textures are commonly used for non-player characters who don't need skin support. You set a default texture using more #exec commands, which are usually irrelevant for player models because players and bots have configurable skins anyway.
To set a default texture, put it in the Textures subfolder of your working directory (package directory) and use these #exec commands to import and link it:
#exec TEXTURE IMPORT NAME=MyModelDefaultTex FILE=Textures/MyModel.pcx LODSET=1 #exec MESHMAP SETTEXTURE MESHMAP=MyModel NAME=MyModelDefaultTex NUM=0
NUM=0 tells UT that the texture should be mapped onto the first material (usually SKIN00 in 3D Studio Max or Skin00 in Milkshape 3D). If your model uses multiple materials, add more commands, using NUM=1 for Skin01 and so on.
Default textures like this only take effect if the relevant MultiSkins area, and Skin, are set to None in UnrealScript. This is true by default for non-player characters, decorations and pickups, but is not true for players and bots.
It is possible to specify animation sequences on import rather than on export, in much the same way as for vertex models. To do this, change the IMPORTSEQS parameter in ANIM IMPORT to IMPORTSEQS=0, and immediately below ANIM IMPORT, add lines of this format:
#exec ANIM SEQUENCE ANIM=(MyAnim) SEQ=(sequence name) GROUP=(group) STARTFRAME=(nnn) NUMFRAMES=(nnn) RATE=(nn)
GROUP is optional - if not included, the animation has no group. STARTFRAME is zero-based (i.e. the first frame in the PSA is frame 0). NUMFRAMES is the number of frames in the sequence including the start frame (so it must be 1 or more) and RATE is measured in frames per second.
If you can contribute to the AMS SDK, especially this page, please e-mail me at <simon{at}pseudorandom.co.uk> (replace {at} with @).