This page is relevant to:
Modellers making a plugin player model using Advanced Model Support
By the time you get here, you need to have all this lot:
This used to involve actual coding, but I've made some scripts which do all the work for you. Well, some of the work :-)
The easiest way to make player classes is probably to base them on mine. If you downloaded the Advanced Models SDK, just copy MyModel.uc, MyModelBot.uc and MyModelSkinInfo.uc from the Templates folder. If you're reading it online, here are the templates you'll need:
Wherever you get them from, these templates need to go in the Classes folder.
First, edit MyModel.uc. Rename the file to whatever your class name is, plus ".uc", and open it in Notepad or equivalent.
First, go to the top. There's a big comment at the top (everything on a line starting with //) which you can read, then delete and replace with your own. For example, "// Mutant Freak (c) John Jones, 2001". The compiler ignores comments, but leaves them in the source code, making them good for notes, instructions to yourself or others, copyright statements and so on.
The first line of actual code reads "class MyModel extends GenericMale;". Replace MyModel with whatever your class name is. If your model is female, replace GenericMale with GenericFemale, or if it's a robot like Xan, replace it with GenericRobot.
After a couple more comments which you can read and delete, there is a block of #exec lines. These are commands to the Unreal engine telling it what resources to embed in the .U file, and how to import them. Paste in the #exec commands appropriate to your model here to replace the ones in the file (see the tutorial for Milkshape 3D, 3DS Max with ActorX, or writing your own #exec commands for details).
Finally, at the bottom of the file is the defaultproperties section. This is where you do most of the work.
First, set the mesh. Skeletal animation users should set Mesh=SkeletalMesh'(Package name).(Mesh name)' while vertex animators should set Mesh=LodMesh'(Package name).(Mesh name)'.
Next is the Selection Mesh (which appears in the menus). For now, set SelectionMesh="(Package name).(Mesh name)" (note the double quotes and lack of Mesh'' here). You can change this to a separate mesh later if you want, but keep it the same for now.
I don't think MenuName is actually used, but set it anyway. It needs to be set to the human-readable name of your model, in double quotes.
If your model uses Epic skeletal animations or another animation set where the model's head stays attached after a headshot (this is the Dead4 sequence), set DetachableHead=None (this is the default anyway) to prevent UT from spawning another one.
If your model uses a custom animation set where the head is hidden in Dead4, set the class UT should spawn to replace it (the amazing flying heads snipers and Ripper fans know and love). DetachableHead=Class'Botpack.UT_HeadMale' and DetachableHead=Class'Botpack.UT_HeadFemale' are suitable values.
Finally, set SkinInfo like this: SkinInfo=Class'(Package name).(class name)SkinInfo'. This points UT to the default skin settings, which we'll write on the next page.
class AMS_CubicMan extends GenericMale; #exec MESH MODELIMPORT MESH=AMS_CubicMan MODELFILE=models\CubicMan.PSK LODSTYLE=12 #exec MESH ORIGIN MESH=AMS_CubicMan X=0 Y=0 Z=135 YAW=192 #exec MESH WEAPONATTACH MESH=AMS_CubicMan BONE="Bip01 R Hand" #exec MESH WEAPONPOSITION MESH=AMS_CubicMan YAW=0 PITCH=0 ROLL=128 X=1.0 Y=0.0 Z=0.0 #exec MESHMAP SCALE MESHMAP=AMS_CubicMan X=0.3125 Y=0.3125 Z=0.3125 #exec MESH DEFAULTANIM MESH=AMS_CubicMan ANIM=EpicUTPS2MaleAnimation defaultproperties { SelectionMesh="AMS_DemoModels.AMS_CubicMan" MenuName="Cubic Man" Mesh=SkeletalMesh'AMS_DemoModels.AMS_CubicMan' SkinInfo=Class'AMS_DemoModels.AMS_CubicManSkinInfo' DetachableHead=None }
Rename MyModelBot.uc to (your class name)Bot.uc, and open that in Notepad. This one is simpler to set up as you've already imported the mesh.
The first line of code reads "class MyModelBot extends SkeletalMaleBot;". Replace MyModelBot with whatever your class name is, plus "Bot". If your model is female, replace SkeletalMaleBot with SkeletalFemaleBot, or if it's a robot like Xan, replace it with SkeletalRobotBot.
Now go down to the defaultproperties section and set Mesh, SelectionMesh, MenuName and DetachableHead the same as the player class. You can just cut and paste them.
Finally, set MatchingPlayerClass=Class'(Package name).(Player class name)'. The bot doesn't use SkinInfo directly.
Again, here's Cubic Man:
class AMS_CubicManBot extends GenericMaleBot; defaultproperties { MatchingPlayerClass=Class'AMS_DemoModels.AMS_CubicMan' SelectionMesh="AMS_DemoModels.AMS_CubicMan" MenuName="Cubic Man" Mesh=SkeletalMesh'AMS_DemoModels.AMS_CubicMan' DetachableHead=None }
Choose one of:
Coding and compiling AMS models, part 2: Skins