In "PROGRAM\Models\initModels.c", find the model you want to use and copy its block. For example, let's start with "9JdPor":
Code:
model.description = "I remember Jack Sparrow as a polished Officer of the Portuguese Navy.";
model.id = "9JdPor";
model.FaceId = 277;
model.nation = PORTUGAL;
model.price = 5000;
model.assigned = true;
AssignModelTypeNation(isstart, model, "Captains", 1.0, PORTUGAL);
AssignModelType(isstart, model, OFFIC_TYPE_FIRSTMATE, 1.0);
AssignModelType(isstart, model, OFFIC_TYPE_QMASTER, 1.0);
AddCharacterModel(model);
Change the "model.id" - all characters must have their own unique ID. Change the "model.description" line, also add "model.name" and "model.lastname" to make your character distinct. Also, delete the "AssignModelType" lines - those control how a character can appear in random encounters, possibly on the street, possibly as officers for hire in taverns.
Code:
model.description = "A Portuguese naval officer who bears merely a passing resemblance to a famous pirate.";
model.id = "FdeAlmeida";
model.FaceId = 277;
model.nation = PORTUGAL;
model.price = 5000;
model.assigned = true;
model.name = "Francisco";
model.lastname = "de Almeida";
AddCharacterModel(model);
Once you've done all the stuff which I'll get to in a moment to set up the actual character model, this definition will allow you to find the character in the FreePlay character selection menu by setting the fame level to "Named". You can add more lines to customise the character further. If you add "model.storytitle" and "model.storytext" lines, he'll now appear in character selection among the more select group of "Specific" characters. You can give him a ship. You can set the year, and even the day and month, when his game will start. You can define what type of character he will be - a list of them can be found in "PROGRAM\Dialog_Func.c", look for the "#define PLAYER_TYPE" lines. You can choose which flags he'll use.
model.description = "A Portuguese naval officer who bears merely a passing resemblance to a famous pirate.";
model.id = "FdeAlmeida";
model.FaceId = 277;
model.nation = PORTUGAL;
model.price = 5000;
model.assigned = true;
model.name = "Francisco";
model.lastname = "de Almeida";
model.storytitle = "The Portuguese Armada";
model.storytext = "As was customary for men in your social circle, you joined the military at an early age. You have fought in conflicts in different parts of Morocco and Spain on the side of the Castilians. Now in the Caribbean, Spain is again your ally. But you never know what the future might bring!";
model.playertype = PLAYER_TYPE_NAVAL_OFFICER;
model.Flags.Pirate = 23;
model.Flags.Personal = 27;
model.ship = "Polacca_N";
model.shipname = "Lebre";
model.date.year = 1505;
AddCharacterModel(model);[/code]That's the definition for Francisco de Almeida, which you'll find already in "initModels.c".
Now you need to set up the model. As this is simply a renamed version of an existing model, all you need to do is go into "RESOURCE\Models\Characters", make a copy of the original model, and name it to match what you put in "model.id". In this case, you'd copy "9JdPor.gm" and name the copy "FdeAlmeida.gm". Next, go into "RESOURCE\Models\Heads" and do the same - these are the models used by the talking head animation you see when you talk to someone, and occasionally you talk to yourself during some sidequests, in which case you'll see your own talking head. So, copy "h_9JdPor.gm" and name the copy "h_FdeAlmeida.gm". You also need to go into "RESOURCE\animation\heads" and again, find the file for the original model, copy it, and name the copy to match "model.id" - in this case, a copy of "h_9JdPor.ani" becomes "h_FdeAlmeida.ani".
Edit "RESOURCE\INI\TEXTS\ENGLISH\models_description.txt". Add a line to match your "model.description" line, e.g. for this one:
Code:
A Portuguese naval officer who bears merely a passing resemblance to a famous pirate.{A Portuguese naval officer who bears merely a passing resemblance to a famous pirate.}
It's also possible to give the character his own interface picture - "FdeAlmeida" actually uses faceid 96, which is based on a painting of the real person, for example. If you want to do this, you'll need some sort of picture editing software such as Photoshop or GIMP, and in that case I can tell you what you need to do. Or you can customise the character's appearance. Otherwise, this should give you plenty to work with...