Friday, September 18, 2009

Custom Character in Unreal: Part 2


You will need to make a special material for the Custom Character called MaterialInstanceConstant. This is required for team faction colours and other multimplayer modes. Just right click on the grey area like in the picture.


Go to the CH_All package and select the IronGuard Base Material.


Apply it to your MIC Material under FontParameterValues->Parent.



Apply the relevant textures to the relevant slots.





Next, all the meshes have to be realigned so that the Z Origin is -51 and the RotationOrigin's Yaw is -90. You need to do that or else the character will not be aligned properly. Why is it misaligned in the first place, ask Epic.


Assign the proper materials to the meshes.


Assign sockets to the arms so Unreal knows where to place the weapons.
b_LeftWeapon -> DualWeaponPoint
b_RightWeapon ->WeaponPoint




When you run Unreal, the UTCustomChar.ini file will have added your custom char data to it. If somehow things screw up, delete the new entries in this file, hack the files in your Published/CookedPC/CustomChars directory and try again.

The next series of pictures show you how to access the custom charater. If everything was done right, you should be getting these results.











The character is intentionally pink/maroon and different so I know it was successfully working and not using the standard Unreal IronGuard


NOTE: If your character does not appear in the game (and the game did not crash), there are two possibilities: Unreal cannot find the package (some issues with your naming and directory structure) OR your character can be found, just that it's wayyyyy off coordinates. Reset the pivot points to (0,0,0) and that should fix it.

Custom Character in Unreal: Part 1

If you want to create your own character and select in in Unreal and play with that character, then this next quick tutorial will show you how. I will just use the IronGuard character with some modified textures so everyone can do this tutorial fairly quick and dirty without begin bogged down with small details like modeling, rigging, UVW Mapping. Once you know how to export and import into Unreal and set it up, you can concentrate on the small details thereafter.


First, notice the IronGuard character is built in parts. This is to facilitate swappable body parts within Unreal. Export the individual parts in PSK files. You should have:

YourCharacter_Head
YourCharacter_FaceMask (Optional)
YourCharacter_Torso
YourCharacter_Thighs
YourCharacter_Boots
YourCharacter_Arms
YourCharacter_Helmet (Optional)
YourCharacter_LShoPad01 (Optional)
YourCharacter_RShoPad01 (Optional)




In your Generic Browser, Import all these PSK Files.


Next, Import all the textures for the character as well as the mugshot (512x512 image).


Remember the name of your package and the group these textures are allocated to. Here, my package is named KevinPackage and the group (subdirectory) where the texture files are located are under "Textures". Depending on the texture, under LODGroup, make sure it is the correct "type" of texture eg:


The mugshot is a UI Texturegroup.


A Normal Map for a Character obviously goes to the TextureGroup_CharacterNormalMap.


You can see that the Textures are located in the Textures Group of the KevinPackage package.


In order for Unreal to run your custom package, it has to be saved in the UTGame/Published/CookedPC/CustomChars directory. Make the directory if it does not exist.


Make a directory within the CustomChars directory, in my case, SmileyBoy, and you should have two files in there: UTCustomChar.ini and YourCharName.int file.



Notice the .ini file has a "+" sign. This will "add" custom code to your main UTCustomChar.ini located in the UTGame/Config directory. Do not hack that file directly. Just in case anything screws up, you can then hack the main UTCustomChar.ini and remove the offending code. Remember to save the file after that.


Just to give you a visual explaination what the lines of code mean. If your character uses another character template, obviously it cannot be "IRNM" (IronGuard Male).

To be continued in Part 2