• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Creating a new character model

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
First, unless you plan to create a completely new model, which is beyond the scope of this tutorial, you will need to copy an existing one.

Use Animation View to look through "RESOURCE\MODELS\Characters" and find an existing model which looks something like the character you wish to create. Copy and rename the model. You can call it anything you like.
Example: you could make a copy of "Blaze5.gm" and call it "BlackJake.gm".

In "RESOURCE\MODELS\Heads", find the corresponding head model. Copy it and rename the copy to match your new model.

Find "h_Blaze5.gm", copy it, and rename the copy "H_BlackJake.gm".
In "RESOURCE\animation\Heads", find the corresponding .ani file. Copy it and rename the copy to match your new model.
Find "h_Blaze5.ani", copy it, and rename the copy "H_BlackJake.ani".
These two files are needed for the "talking head" animation which appears if you talk to the character. Even if this will only be a player character, you'll still want the "talking head" because some quests and storylines use self-dialogs in which your character talks to you. Some character models have no "H_" files and therefore no talking heads; these models were imported from "Age of Pirates: Caribbean Tales" and that game does not use "talking heads", so they don't exist for these models.

In "PROGRAM\Models\initModels.c", find the block which defines the model that you are copying. Copy and paste that block to create a new definition. Change the "model.id" line to the name of your new model.
The definition for "Blaze5" is this:
Code:
    model.description =  "I have a somewhat black mood today, have you something that compliment that?";
   model.id      =  "Blaze5";
   model.FaceId   = 16;
   model.nation     =  PERSONAL_NATION;
   model.price      =  300;
   model.assigned   =  true;
   model.name = "Nathaniel";
   model.lastname = "Hawk";
   AddCharacterModel(model);
The copy should look like this:
Code:
   model.description =  "I have a somewhat black mood today, have you something that compliment that?";
   model.id      =  "BlackJake";
   model.FaceId   = 16;
   model.nation     =  PERSONAL_NATION;
   model.price      =  300;
   model.assigned   =  true;
   model.name = "Nathaniel";
   model.lastname = "Hawk";
   AddCharacterModel(model);

And now you have a model which is a clone of Nathaniel Hawk in a black and red jacket. Next: customising your character...


 
There are several ways to make your character more distinctive. For a start, change the "model.description" line. This is what will appear if you see the model as an outfit for sale in a tailor's shop, also when you view the outfit in the "F2 -> "Select outfit" screen. You can write anything you like. Then edit "RESOURCE\INI\TEXTS\ENGLISH\models_description.txt" and add a line which is a copy of your description, followed by another copy of the description in braces.
In "initModels.c":
Code:
model.description = "An evil pirate with a black and red jacket."
In "models_description.txt":
Code:
An evil pirate with a black and red jacket.{An evil pirate with a black and red jacket.}

The "model.nation" line determines the nation whose tailors will sell this model as an outfit. Also, when you are in the character selection menu while starting a FreePlay game, you can narrow down the search through the huge collection of models by specifying the nation. So if you've set "model.nation" to "PIRATE" then you can find your model more quickly by only looking for Pirate models; and if you talk to the tailor by the gate of Pirate Settlement on Nevis, he may sell you this outfit.

The "model.name" and "model.lastname" lines give the character a name. If these lines are present then you can find the character more easily in the character selection menu; he will show up among the shorter list of characters if you set the fame level to "Named". (You can also have a "model.middlename" if you like.)

Some model definitions contain "AssignModelType" lines. If there are any of these in your copy, you probably want to delete them. They control where the model can appear randomly in towns or taverns. If you're creating a special character based on someone interesting then you don't want to meet his clones wandering around town!

You can also add "model.storytitle" and "model.storytext" lines. If you do, your story will appear in the character selection menu in place of the model description. Be creative here - this is where you can tell the world about your character! It also means that your character will now show up in the character selection if you set the fame level to "Specific".

A "model.playertype" line will specify what sort of character this will be. Valid player types are listed near the beginning of "PROGRAM\Dialog_func.c".

You can choose which Personal and Pirate flags the character will use. You can see all the flags available in the game by clicking the flag icons in either the character selection menu or the "Relations" screen of a game in progress. The top left flag is 0. Count left to right before you count to the next row down. Work out which numbers your flags are, then assign them with "model.Flags.Pirate" and "model.Flags.Personal" lines.

Does your character have his own ship? Pick a ship type from "PROGRAM\Ships\Ships_init.c" and assign it with a "model.ship" line. Give the ship its name with a "model.shipname" line.

You can decide what year, what month, even what day the game will start. The year is particularly important because that determines the period in which the game will be set. Periods are defined in "PROGRAM\Periods.c". Add "model.date.day", "model.date.month" and "model.date.year" lines to set your date.
 
Another way to customise your character is by changing the interface picture. These are stored in "RESOURCE\Textures\INTERFACES\PORTRAITS". There are three sub-folders - "256", "128" and "64", containing the 256x256, 128x128 and 64x64 size versions respectively. The 256x256 one is the picture which appears on the F2 "Character" screen. The 128x128 version is used for character selection, outfit selection and passenger menus. The 64x64 version appears on the main game screen to show the character's health and ammo status.

Interface picture files all have names like "face_538.tga.tx". Almost all numbers up to 589 are already used or likely to be used soon. Some higher numbers may also have been used by now. Look for the highest numbered file, and check all three folders because some special character models don't need all three versions and might not appear in one of the folders. You'll be using a higher number than that. So, if "face_589.tga.tx" is the highest number used, then you can use "face_590.tga.tx".

You will need to edit "RESOURCE\INI\INTERFACES\pictures.ini". Look for a section headed "[FACE128_589]". Go down to the highest number currently in use, copy a block, paste it, and change the number to match the one you're using. This is needed for the 128x128 picture to appear in any interface.
Example: if you've found that 589 is used but 590 is free, you'll need to add this to "pictures.ini":
Code:
[FACE128_590]
sTextureName   = portraits\128\face_590.tga
wTextureWidth   = 128
wTextureHeight   = 128
picture = face,0,0,128,128

You will need TX Convertor for this. The game uses .tga.tx format files. Picture editing programs such as Photoshop can't handle that, but they can work with .tga files. TX Convertor converts between .tga.tx and .tga so you can use your choice of picture editor, save the result as .tga, then convert it to .tga.tx for use in the game.

Also in each folder is "face_blank.psd". If you have Photoshop, GIMP or anything else capable of reading a Photoshop file then creating interface pictures is easy. Start with any picture you like. If your character is supposed to be based on a famous historical or fictional person then you can start with a picture of the real person. Or you can get a screenshot of the game character before you have created a new set of interface pictures - edit "PROGRAM\InternalSettings.h", go to the bottom and set "FREE_CAMERA" to 1, then you can use the arrow keys to move the viewpoint around to get a picture of the character from the front. Press F8 to take a screenshot, which will be saved in the root game installation folder as a .tga file. However you got your picture, cut out a square, resize it to 254x254, and paste it into the 256x256 version of "face_blank.psd". The file has a layer which contains the frame - move that to the top, so that the end result is your picture with a frame round it. (If you don't have a program capable of reading "face_blank.psd" then you can use TX Convertor to convert any existing 256x256 picture to .tga format, then copy its frame onto your picture.) Save your file as "face_570.tga", then use TX Convertor to convert it to "face_570.tga.tx". (Or whatever number you used.)

Repeat this for 128x128 and 64x64 versions.

Then edit "PROGRAM\Models\initModels.c", find the section which defines your character, and change the "model.FaceId" line to match the number of the pictures you created.

You can also create a new texture for your character model. This is detailed in the tutorial Retexture a Gm-model. To find which texture file the model uses already, use GM Viewer to look at the model. GM Viewer can't view character models but it can tell you which texture files they use.
 
Last edited:
I've changed it back because characters created this way might not necessarily be used for storylines, or even for FreePlay. Just trying to avoid confusion. ;)
As you wish.

When I read your title, I thought you meant "adding an NPC using the character init files".
 
One day when I find time I'll try to make additional tutorials for head switching and add other stuff to a character model.
You can really change a model by using all 3 methods.
 
Back
Top