1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Solved Creating new Predefined Characters?

Discussion in 'Build Beta and Brainstorming' started by TheGenericSmith, Jul 7, 2017.

  1. TheGenericSmith

    TheGenericSmith Landlubber

    Joined:
    Jul 7, 2017
    Messages:
    11
    Gender:
    Male
    Hello!

    After going through the list of predefined characters for freeplay or anything else, it dawned on me that if I could create some of my own based on pre-existing models, that would be really nice.

    Any advice?
     
  2. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    All you need to do is to add some extra lines in PROGRAM\Models\initModels.c .
    Find the model ID for a character that is in the list to find what is needed to add more.

    Of course by using the configuration options, you can create any character you want because you're not forced to choose one of the pre-defined ones.
     
  3. Jones

    Jones Sailor

    Joined:
    Apr 16, 2017
    Messages:
    137
    Gender:
    Male
    If you want to add them only to a storyline, go to your storyline \ characters \ init \ TempQuest.c
    Copy the text of an existing template and paste it.
    Here you can change.
    I think there is a line:
    Code:
    ch.model = "";
    Entre between "" the name of the model.
    And here:
    Code:
    ch.id        = "";
    the Model ID (can be invented)
     
  4. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,418
    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...
     
  5. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    For the sake of simplicity, I think unless you want to add a custom portrait too, you can just use the existing initModels.c entry without a need to copy anything.
    That's what I did with Josiah Peabody as well.
     
  6. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,418
    That works as long as you only want to use the model for that character. If you want someone else to use the "USA_cpt_18" model, or if anyone else has their own favourite American captain, he's going to need a different ID. Personally, as an absolute minimum I'd make a copy of "USA_cpt_18", give him a new ID, then copy his model, head model and head animation. That way the generic model remains generic and you have the foundation for a more complete character if you want to add more details later.
     
  7. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Perfectly true.
    But until someone actually does, which may never happen, it saves a fair bit of trouble. ;)
    Anyway, I don't mind either way.
     
  8. TheGenericSmith

    TheGenericSmith Landlubber

    Joined:
    Jul 7, 2017
    Messages:
    11
    Gender:
    Male
    Mostly the reason I wanted to do this was to create a character based off of Admiral John Jervis. A lot of this makes sense, but I feel adding in the different commands of a custom naval officer is a bit different?
     
  9. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Adding pre-defined commands for a naval officer is relatively easy too.
    File to edit is PROGRAM\NK.c .
     
  10. TheGenericSmith

    TheGenericSmith Landlubber

    Joined:
    Jul 7, 2017
    Messages:
    11
    Gender:
    Male
    Thanks so much, if I have troubles, I know where to come for some more assistance!
     
  11. TheGenericSmith

    TheGenericSmith Landlubber

    Joined:
    Jul 7, 2017
    Messages:
    11
    Gender:
    Male
    For using a custom interface picture, how would I go about doing that?
     
  12. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    @Grey Roger usually isn't around in the weekend.
    You may have to wait until Monday...
     
  13. TheGenericSmith

    TheGenericSmith Landlubber

    Joined:
    Jul 7, 2017
    Messages:
    11
    Gender:
    Male
    I think I can figure it out from before, could you direct me to the folder where those interface pictures are found? And is there a way to get through naval ranks quickly to make sure I did everything right?
     
  14. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
  15. TheGenericSmith

    TheGenericSmith Landlubber

    Joined:
    Jul 7, 2017
    Messages:
    11
    Gender:
    Male
    F9 isn't that. None of the F keys do that sadly. I'd use cheat engine but that seems to freeze up the game when I do that.
     
  16. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Oops, I meant Numpad 9. :facepalm
     
  17. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,418
    @TheGenericSmith: Interface portrait files are found in "RESOURCE\Textures\INTERFACES\PORTRAITS". In there are three sub-folders: "64", "128" and "256". These contain the pictures at 64x64, 128x128 and 256x256 resolutions respectively. The files are all named "face_xxx.tga.tx", where "xxx" is a three digit number. Almost all the numbers up to 567 are taken, so your new one will need to be at least number 568.

    Edit "RESOURCE\INI\INTERFACES\pictures.ini". Find this block:
    Code:
    [FACE128_567]
    sTextureName   = portraits\128\face_567.tga
    wTextureWidth   = 128
    wTextureHeight   = 128
    picture = face,0,0,128,128
    Copy it, paste it, and change the "567" to "568" (or whichever other number you intend to use).

    Also in each of the three sub-folders of "RESOURCE\Textures\INTERFACES\PORTRAITS", you'll find a file "face_blank.psd". This is a file for use with Photoshop. If you have this, making the portraits is easy - open your chosen picture, clip it to a square, resize it to 256x256, then copy the whole thing into the 256x256 version of "face_blank.psd" and make sure the new layer is below the existing layer which contains the frame. Save the result in TARGA format as "face_568.tga", then use TX Convertor to change it to "face_568.tga.tx". Do the same for the 128x128 and 64x64 versions.

    If you don't have Photoshop, GIMP should work as well, and it's freeware. In any other picture-editing program, if it doesn't recognise Photoshop format files then you'll need to use TX Convertor to convert any existing portrait file to .tga format. Read it into your program, then paste your own picture on top of it. Clip away bits of your picture to expose the frame. Then save the result as TARGA format and use TX Convertor to change it to .tga.tx format.
     

Share This Page