Advanced Models SDK

Separate selection mesh

Relevance

This page is relevant to:
Authors of custom player models using Advanced Model Support, or of other TournamentPlayer subclasses not using AMS

You will need

An Unreal Tournament model set up using Advanced Model Support as described in a previous page, or another TournamentPlayer subclass.

Separate selection mesh

Previous pages of this tutorial assumed you wanted the model to appear unchanged in Player Setup. The Epic animations included in Advanced Model Support have been altered to include a suitable pose for the Player Setup screen.

However, if you want a particular animation in Player Setup, there's nothing to stop you making another skeletal- or vertex-animated mesh (it can be a different mesh, for example holding a gun, or just a copy of the main mesh with different animations) and using that instead. My advice is to create an animation loop in your chosen 3D package, starting and ending in the same position - it can be anything you like, but a simple breathing animation, looking around, or walking will probably be most successful. Export the model and animation as _D.3D and _A.3D, or .PSK and .PSA, files into the Models folder. There must be animation sequences called All and Breath3 - I recommend making both use exactly the same frames.

There are a few nasty bugs in skeletal animation for the Player Setup screen, caused by the fact that UT wasn't designed for it. I did my best to fix them for AMS models, but non-AMS ones will still suffer from them, so I recommend using a vertex model as the separate selection mesh, especially if for some reason you're not using AMS.

After the existing #exec lines, import your animations and model. For 3DS Max and Maya users who can define their own skeletons and animations, the process is the same as for the in-game model, but you only need the Breath3 and All animation sequences.

If you're using Milkshape 3D, you've already exported a simple stand-still animation. Here's the script to import it (replace MyMesh with your mesh name):

#exec ANIM IMPORT ANIM=MyMeshSelectAnim ANIMFILE=models\MyMeshSelect.PSA COMPRESS=0.5 IMPORTSEQS=0
#exec ANIM SEQUENCE ANIM=MyMeshSelectAnim SEQ=All STARTFRAME=0 NUMFRAMES=48 RATE=15
#exec ANIM SEQUENCE ANIM=MyMeshSelectAnim SEQ=Breath3 STARTFRAME=0 NUMFRAMES=26 RATE=15

#exec ANIM DIGEST ANIM=MyMeshSelectAnim VERBOSE

#exec MESH MODELIMPORT MESH=SelectMyMesh MODELFILE=models\MyMesh.PSK LODSTYLE=12
#exec MESH ORIGIN MESH=SelectMyMesh X=0 Y=0 Z=135 YAW=192
#exec MESHMAP SCALE MESHMAP=SelectMyMesh X=0.3125 Y=0.3125 Z=0.3125
#exec MESH DEFAULTANIM MESH=SelectMyMesh ANIM=MyMeshSelectAnim

After you've done this, you can set SelectionMesh in the defaultproperties of both player and bot, like this:

SelectionMesh="(package name).Select(mesh name)"

Important: If using a skeletal mesh (.PSA/.PSK files) for this, you'll need to avoid a known UT bug here. In both the player and the bot class, go into the defaultproperties again and add this line:

DummySelectionMeshReference=SkeletalMesh'(package name).Select(mesh name)'

If you're using the model's main mesh, there's no need to do this because the Mesh property already refers to it, but if you're using a separate mesh, UT has problems dynamically loading it unless there's a reference to it somewhere. Don't ask me why.

If you're not using an Advanced Model Support base class, to use this workaround, you will have to add "var SkeletalMesh DummySelectionMeshReference;" to the top of your script, just under the class ... expands ... line.

Unfortunately, animated skeletal meshes do not always work in the selection screen. Because all the different meshes and animations are loaded onto the same object and Epic didn't intend to use skeletal animations, weird things can happen to non-AMS skeletal models sometimes - this includes the two Bonus Pack 4 models, and early versions of Space Warrior and Wraithguard (later versions of Space Warrior may be unaffected; Wraithguard II is unaffected). Advanced Model Support-based models do not experience this bug but can cause it in the older models listed, and possibly others. If you're not using AMS and your mod uses the standard UT Player Setup, please use a vertex selection mesh, or reset the animations as described in the file Notes for Mod Authors. If you are replacing Player Setup already, you can fix this bug as described in the same file.

It's got a gun!

(this section is AMS-specific)

While your selection model should use the same basic skins as the in-game model, if you add extra bits, like a gun in your model's hand, you can give this a constant texture which doesn't change when you change the skin. This saves skin makers having to always include a copy of the gun texture.

To do this, you need its material number (for vertex models, you can get this with the utility UnrealFX if you're not sure). In the defaultproperties for the SkinInfo class, add this line, replacing # with the material ID:

ForcedSelectionSkins(#)="TexturePackage.TextureName"

For example, one of my first test models had a selection mesh holding a sniper rifle (set to material 1). To make this work, I used this line to load the UT sniper rifle texture: ForcedSelectionSkins(1)="Botpack.JRifle2".

I decided to make Cubic Man stand on a little platform in the Player Select screen. To do this, I opened my MS3D file, added a box under his feet, linked it to the Bip01 "root bone" so it would stay static, set the material as Skin03 (remember I'd only used Skin00 to Skin02 up to now), and exported to SelectCubicMan.psk.

As before, when exporting I filled in a dummy class name (DummyCubic) so MS3D wouldn't helpfully overwrite my scripts. (Tip: back up your project before you get to this point!)

I then filled in the extra #exec script above, but changing the filename to SelectCubicMan.psk instead of CubicMan.psk. I also changed the scale to 0.2 so the platform would fit.

Finally, I changed the defaultproperties for both player and bot to use my new mesh, and set a forced selection skin so the platform would be skinned. I decided to use UTcrypt.Floor.rClfFlr0, for no particular reason.

I then deleted the U file and recompiled to see my changes appear in UT.

Previous page

Custom sounds and "status doll"

Back to index


AMSDK compiled by Simon `Psychic_313' McVittie, http://www.pseudorandom.co.uk
This page by Simon McVittie