• 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!

Included in Build New PotC Film Navy Characters

Still have an unfinished 'Ammand' folder on my desktop...
OOOooohhhh..... :rolleyes:

As far as I'm concerned, anything you're willing to do would be very welcome, that's for sure. I'm sure we can keep you busy for the next two years or so.
Just make sure you don't let us drive you nuts with all sorts of additional ideas. ;)
 
Well anything I would also appreciate as to the request I have made but I completely understand from a modders point of view totally :p We all have our thresholds and commitments.

Now since I am literally in the door from work. I shall maybe get it finished by tonight and sent for tomorrow or wednesday night latest. It is crap i know :/

I only have to set up the rest of the portraits and copy the standard models which fit the characters best currently. Then at least they are in the game and functioning, any future better models can always replace the existing ones in future.

Cheers.

P.S If I missed the deadline for the newer updates. Then that is unfortunate but you should be able to find my new added code. Only files I really edited is NK.C and storyline freeplay startstoryline.c file.

Models.c for the new models, the images.ini file for portraits new added and the corresponding new files added for the characters in question.

Should be anyway........but you can see when I upload the files I have changed at some point! :D
 
No worries; there will certainly be another update soon. Once there is something to include, that is. ;)

Okay so I kind of broke the .NK file now haha. Everytime I start the game now it is syntax error for a line.

I am trying to add checks in which I think has just broke it due to my poor basic coding skills :p

Now as you can see below, you can see what I am trying to do in terms of assigning the character models to promotions. Surely there is an easier way to do than all the If x = y. I know there is but coding isn't my forte as such. I just like causing havoc haha :/

NOTE: The error says it is a syntax error basically near the very end of the code. Near the breaks etc. But I suspect it is due to the added code of all the Of model is this etc etc

Code:
string OfficerUniform4Player(int PlayerRank, int iNation)
{
    ref pchar = GetMainCharacter();
    if (!CheckAttribute(pchar, "model"))                        return "";
    if (ProfessionalNavyNation() == UNKNOWN_NATION)                return "";
    if (pchar.sex == "woman")                                    return "";
    if (GetAttribute(PChar, "location") == "Tutorial_Deck")        return ""; // PB: Skip this on Start New Game

    string PlayerModel = "";
    switch(iNation)
    {
        case ENGLAND:
            switch(PlayerRank)
            {
                case 1: // Midshipman
                    switch(GetMySimpleName(PChar))
                    {
                        case "James Norrinton":
                            PlayerModel = "Mdnorrington";
                        break;
                        // default
                        if (HasSubStr(pchar.model, "blaze"))
                        {
                            PlayerModel = "47_Blaze_brtmds";
                        }
                        else
                        {
                            switch(rand(3))
                            {
                                case 0: PlayerModel = "brtmds1_18"; break;
                                case 1: PlayerModel = "brtmds2_18"; break;
                                case 2: PlayerModel = "brtmds3_18"; break;
                                case 3: PlayerModel = "brtmds4_18"; break;
                            }
                        }
                    }
                break;
                case 2: // Junior Lieutenant
                    switch(GetMySimpleName(PChar))
                    {
                        case "Jack Sparrow":
                            PlayerModel = "47_Ltsparrow";
                        break;
                        case "James Norrington":
                            PlayerModel = "Ltnorrington";
                        break;
                        case "Andrew Gillette":
                            PlayerModel = "Gillette";
                        break;
                        case "Horatio Hornblower":
                            PlayerModel = "brtH3rdLt_18";
                        break;
                        // default
                        if (HasSubStr(pchar.model, "blaze"))
                        {
                            PlayerModel = "47_Blaze_brtlt";
                        }
                        else
                        {
                            if (HasSubStr(pchar.model, "JRMM"))
                            {
                                PlayerModel = "47_JRMMLt1";
                            }
                            else
                            {
                                switch(rand(2))
                                {
                                    case 0: PlayerModel = "brtlut1_18"; break;
                                    case 1: PlayerModel = "brtlut2_18"; break;
                                    case 2: PlayerModel = "brtlut3_18"; break;
                                }
                            }
                        }
                    }
                break;
                case 3: // Lieutenant
                break;
                case 4: // Senior Lieutenant
                case 5: // Commander
                    switch(GetMySimpleName(PChar))
                    {
                        case "Horatio Nelson":
                            PlayerModel = "Cpnnelson";
                        break;
                        case "Jack Aubrey":
                            PlayerModel = "Aubrey";
                        break;
                    }
                break;
                case 6: // Post Captain
                    switch(GetMySimpleName(PChar))
                    {
                        case "Jack Sparrow":
                            PlayerModel = "47_Cptsparrow";
                        break;
                        case "James Norrington":
                            PlayerModel = "Cpnorrington";
                        break;
                        case "Horatio Hornblower":
                            PlayerModel = "brtHComdr_18";
                        break;
                        case "Jack Aubrey":
                            // Intentionally nothing (skip generic model)
                        break;
                        // default
                        if (HasSubStr(pchar.model, "blaze"))
                        {
                            PlayerModel = "47_Blaze_brtcpt";
                        }
                        else
                        {
                            if (HasSubStr(pchar.model, "JRMM"))
                            {
                                PlayerModel = "47_JRMMCpt";
                            }
                            else
                            {
                                switch(rand(1))
                                {
                                    case 0: PlayerModel = "brtcpt1_18"; break;
                                    case 1: PlayerModel = "brtcpt2_18"; break;
                                }
                            }
                        }
                    }
                    if (pchar.model == "Groves")
                               {
                                 PlayerModel = "GrovesCpt";
                               }
                    if (pchar.model == "Gillette")
                               {
                                 PlayerModel = "GilletteCpt";
                               }
                    if (pchar.model == "Groves_EITC")
                               {
                                 PlayerModel = "GrovesCpt_EITC";
                               }
                break;
                case 7: // Commodore
                    switch(GetMySimpleName(PChar))
                    {
                        case "Jack Sparrow":
                            PlayerModel = "47_Cosparrow";
                        break;
                        case "James Norrington":
                            PlayerModel = "Conorrington";
                        break;
                        case "Horatio Hornblower":
                            PlayerModel = "brtHComdr_18";
                        break;
                        case "Jack Aubrey":
                            // Intentionally nothing (skip generic model)
                        break;
                        // default
                        if (HasSubStr(pchar.model, "blaze"))
                        {
                            PlayerModel = "47_Blaze_brtco";
                        }
                        else
                        {
                            PlayerModel = "brtbath_18";
                        }
                    }
                    if (pchar.model == "GrovesCpt")
                               {
                                 PlayerModel = "GrovesC";
                               }
                    if (pchar.model == "GilletteCpt")
                               {
                                 PlayerModel = "GilletteC";
                               }
                break;
                case 8: // Rear Admiral
                break;
                case 9: // Vice Admiral
                break;
                case 10: // Admiral
                    switch(GetMySimpleName(PChar))
                    {
                        case "Jack Sparrow":
                            PlayerModel = "47_Admsparrow";
                        break;
                        // default
                        if (HasSubStr(pchar.model, "blaze"))
                        {
                            PlayerModel = "47_Blaze_brtadm";
                        }
                        else
                        {
                            switch(rand(1))
                            {
                                case 0: PlayerModel = "brtadm1_18"; break;
                                case 1: PlayerModel = "brtadm2_18"; break;
                            }
                        }
                    }

                    if (pchar.model == "GrovesC")
                               {
                                 PlayerModel = "GrovesA";
                               }
                    if (pchar.model == "GilletteC")
                               {
                                 PlayerModel = "GilletteA";
                               }
                    if (pchar.model == "Conorrington")
                               {
                                 PlayerModel = "ANorrington";
                               }
                break;
            }
        break;
 
if you upload your file I might be able to look at it tomorrow. But I think you will figure it out :). Or else post the error it gives and note which line is pointed at.
 
if you upload your file I might be able to look at it tomorrow. But I think you will figure it out :). Or else post the error it gives and note which line is pointed at.

Well I am tempted to upload everything because I have completed all my work now bar the character animation heads thing for each new character.

Everything was ready but then I broke that damned file. It is pointing to the line before the last break with the "}". If that makes any sense. Perhaps I shall figure it out. i shall stay up relatively late if I have to to sort it out. I am determined you know. If I don't manage to fix it.

I will upload all the files I have changed from this little project of mine, and you guys can take over simplifying any code you think can be and if they exist, fix any errors encountered which should be absolutely zero once this one has been resolved :p

EDIT: 5 Minutes later - Got the B******! :D Was a stupid case of earlier on i forgot to close off a case with a break.....OH MY GOD! :p

Okay now last test and then I shall upload my changes. What does need proper testing is the promotion ranks to make sure it is picking up the appropriate model changes and ships given companions etc :)
 
Last edited:
altough the potc code isn't that case sensative, please try to mind the cases in your code. I see pchar and PChar being used. this could confuse the game.
chances are with errors like this the error actually lies in an function above. Something isn't closed right.

If you can't find what the problem is try using a tool like auto indent (for notepad++) (see here: http://stackoverflow.com/questions/412427/auto-indent-in-notepad use the TextFX way) to see if something is wrong somewhere.
 
Well upon testing the game, it would seem all my changes work quite well now. Everyone is exactly how I want them to function. (Minus the animated heads when talking and prefered newish models as earlier in thread. The heads I have no idea how to do, the new models I would welcome in future but for now I think everyone will like it so far).

So I shall start compiling all the necessary files together and you can see what you all think. (bear in mind the latest changes from the newest patch are not included in the files I will be uploading, if they were changed, therefore I shall have to amend them to match or you guys can do so. Whatever suits)
 
You can use Winmerge to easily merge them together.
But maybe it easier if you just upload them. Then we can do the winmerge and while doing that directly check if something is weird ;) .
 
You can use Winmerge to easily merge them together.
But maybe it easier if you just upload them. Then we can do the winmerge and while doing that directly check if something is weird ;) .

Yeah that is what I usually use to detect changes. To be honest it should be straight forward either way. I have finished packing so I will upload them and send you both links :D

EDIT:

infact, one last thing that is not really working as intended.

Check this piece of code:

Code:
                case "James Norrington":
                    ch = CreateOfficer_Cheat(OFFIC_TYPE_FIRSTMATE, "Groves", 3, iNation, false);
                    ch.name = TranslateString("","Theodore");
                    ch.lastname = TranslateString("","Groves");
                    GiveItem2Character(ch, "blade24+3");
                    GiveItem2Character(ch, "PiratesPistol+2");
                    ch.equip.blade = "blade24+3";
                    ch.equip.gun = "PiratesPistol+2";
                    ch.HPBonus = 100;
                    ch.professionalnavy = ch.nation;
                    SetRank(ch, iNation, 4);
                    SetRankTitle(ch, ENGLAND, TranslateString("", "Lieutenant Commander"));
                break;

So what I want to do, is make Theodore Groves's rank to match that of 4 (Senior Lieutenant) however have the rank title actually from that to "Lieutenant Commander".

The problem is with that one line of "SetRankTitle" it seems to be causing the following when you are looking at the character and it shows the string under there portrait.

It is showing it as reading "Senior Lieutenant Lieutenant Commander Theodore Groves"......
I just want it to read "Lieutenant Commander Theodore Groves"

I know earlier that @Pieter Boelen said that it would change but in this instance it isn't working as intended :/

Thanks guys. And will definitely have it uploaded tomorrow once this minor circumstance has been addressed.
 
Last edited:
@Andouce: Why do you want to use SetRank in combination with SetRankTitle? You should be able to use just the latter of those two, right?

It is intentional that characters get BOTH of them prefixed to the name.
Normally this would be for something like Commodore Sir Something Something.
That would be a character with a regular navy rank AND a title.

Other option would be too give him the title of Commander.
Then he should become Senior Lieutenant Commander.
 
Now as you can see below, you can see what I am trying to do in terms of assigning the character models to promotions. Surely there is an easier way to do than all the If x = y. I know there is but coding isn't my forte as such.
There is. At each rank, you'll see a block starting with 'switch(GetMySimpleName(PChar))'. A 'switch' statement looks at what's in the brackets - here it's the player character's basic name, e.g. "James Norrington" without any rank or title - and then jumps to whichever of the 'case' statements matches it. (The entry at Midshipman rank isn't going to work because someone has written "Norrinton" instead of "Norrington". But that's not the cause of your syntax error because, looking back at an older version of "Nk.c", the error is in there as well.) So you could possibly do something similar for the uniforms, e.g.:
Code:
switch(pchar.model)
{
  case "Groves": PlayerModel = "GrovesA";
  case "GilletteC": PlayerModel = "GilletteA";
  case "Conorrington": PlayerModel = "ANorrington";
}

Or, if what follows the 'if' is only a single command then you don't need the brackets, you can put the 'if' and the command onto one line, e.g.:
Code:
if (pchar.model == "Groves") PlayerModel = "GrovesCpt";

EDIT: 5 Minutes later - Got the B******! :D Was a stupid case of earlier on i forgot to close off a case with a break.....OH MY GOD! :p
I've done that quite a few times as well. xD
 
Thank you all for the comments that have been made. I think now I understand certain concepts and also hopefully will be able to put this to rest now lol.

EDIT: I shall just sort out the models now and good to go. Won't get finished though because I am working and tomorrow I have a very important event happening, and then after that I can get my head stuck into this permanently and continue to actually play the build mod with the fixed changes made recently and this ! :D
 
Last edited:
Question:

Is there anyway what so ever to have a check, if a character model or even simply name matches that of what is given, then change the full rank name to be something else at that level?

So you know what is coming next. (Just want to make it work nice because it is doing my head in :( )

Mr Groves. If the name = Theodore Groves then Britain's rank 4 (Senior Lieutenant) would change to be (Lieutenant Commander).

Or if model = Groves then Britain's rank 4 (Senior Lieutenant) would change to be (Lieutenant Commander).

The issue for me is, if I set the rank title to even Commander at rank 3, that is fine. It reads Lieutenant Commander, however when the person is promoted to rank 4. Surely that would then read Senior Lieutenant Commander Groves. Which is not what I would prefer. I would simply prefer it to read Lieutenant Commander Groves just like it would if you completely replaced the rank from Senior Lieutenant to Lieutenant Commander.

This is the last thing that is currently bugging me because I am one for precision lol :/

Many thanks. (I also have those animated heads to do right now :) )
 
Is there anyway what so ever to have a check, if a character model or even simply name matches that of what is given, then change the full rank name to be something else at that level?
You mean in case you are playing as Mr. Groves? Because of course there are no promotions for companion officers at the moment.

I would suggest not making one specific character-based exception for that custom rank and perhaps automatically marking Lieutenants in command of a ship as "Commander".
But I'm not sure where in the interface that should/shouldn't be shown. Sometimes the player does refer to himself as "Captain" regardless of his actual rank.
Perhaps that is the one that should be changed to "Commander" if you are in the navy, but haven't reached the rank of "Post Captain", yet?

Marking a player as "Third Lieutenant Commander" does seem a bit excessive though. Would it suffice to have it as "Third Lieutenant" in the interfaces, but as "Commander" in certain dialogs that would otherwise say "Captain?

As a simple solution, you could add a SetRankTitle(PChar, ENGLAND, "Commander") at the level where you become Lietenant and then use a DeleteAttribute(PChar, "title"); to remove it again once you hit "Post Captain".
 
I would suggest not making one specific character-based exception for that custom rank and perhaps automatically marking Lieutenants in command of a ship as "Commander".
But I'm not sure where in the interface that should/shouldn't be shown. Sometimes the player does refer to himself as "Captain" regardless of his actual rank.
Perhaps that is the one that should be changed to "Commander" if you are in the navy, but haven't reached the rank of "Post Captain", yet?
Hmm, I can't find now where that is controlled. Maybe those instances are hard-coded in the dialog.h files, which makes it impractical to change.
The only thing I DID find is this from PROGRAM\Dialog_func.c:
Code:
//get chr's formal name: Nathaniel Hawk or Christofor Manuel De Alencar
//normally same as "GetMySimpleName", but fills in blank firstnames with Captain/Mister
string GetMyFormalName(ref chr)
{
   string name = "";
   if(!CheckAttribute(chr,"name")) chr.name = name;//MAXIMUS -->
   if(!CheckAttribute(chr,"lastname")) chr.lastname = name;
   if (CheckAttribute(chr,"title")) {
     if (XI_ConvertString(chr.title) != "") chr.title = XI_ConvertString(chr.title);
     name = chr.title + " ";
   }
   else
   {
     // PB: Use appropriate title if no first name available -->
     if (chr.name == "")
     {
       if(CheckAttribute(chr,"Ship.type") && chr.Ship.type!="" && chr.Ship.type!=SHIP_NOTUSED_TYPE_NAME)
       {
         name = XI_ConvertString("captain") + " "; // Use "Captain" if in command of a ship, but without rank
       }
       else
       {
         name = GetCharacterAddressForm(chr, ADDR_CIVIL, false, false) + " "; // Otherwise return a civil address form without name
       }
     }
     // PB: Use appropriate title if no first name available <--
   }

   name += GetMySimpleName(chr); // KK
   return name;
}
But that only affects characters without a first name.
Probably the option suggested in my previous post with using SetRankTitle and DeleteAttribute will be the simplest way to get close to what you want.

As additional note, I have just changed the syntax to:
Code:
SetRankTitle(ref char, string newtitle)
There is no need for nation to factor in there and, in fact, it didn't anyway; it just pretended to. :razz
 
Hmm, I can't find now where that is controlled. Maybe those instances are hard-coded in the dialog.h files, which makes it impractical to change.
The only thing I DID find is this from PROGRAM\Dialog_func.c:
Code:
//get chr's formal name: Nathaniel Hawk or Christofor Manuel De Alencar
//normally same as "GetMySimpleName", but fills in blank firstnames with Captain/Mister
string GetMyFormalName(ref chr)
{
   string name = "";
   if(!CheckAttribute(chr,"name")) chr.name = name;//MAXIMUS -->
   if(!CheckAttribute(chr,"lastname")) chr.lastname = name;
   if (CheckAttribute(chr,"title")) {
     if (XI_ConvertString(chr.title) != "") chr.title = XI_ConvertString(chr.title);
     name = chr.title + " ";
   }
   else
   {
     // PB: Use appropriate title if no first name available -->
     if (chr.name == "")
     {
       if(CheckAttribute(chr,"Ship.type") && chr.Ship.type!="" && chr.Ship.type!=SHIP_NOTUSED_TYPE_NAME)
       {
         name = XI_ConvertString("captain") + " "; // Use "Captain" if in command of a ship, but without rank
       }
       else
       {
         name = GetCharacterAddressForm(chr, ADDR_CIVIL, false, false) + " "; // Otherwise return a civil address form without name
       }
     }
     // PB: Use appropriate title if no first name available <--
   }

   name += GetMySimpleName(chr); // KK
   return name;
}
But that only affects characters without a first name.
Probably the option suggested in my previous post with using SetRankTitle and DeleteAttribute will be the simplest way to get close to what you want.

As additional note, I have just changed the syntax to:
Code:
SetRankTitle(ref char, string newtitle)
There is no need for nation to factor in there and, in fact, it didn't anyway; it just pretended to. :razz

Cheers for that. Yes I think that would be best way forward. However what was the "DELETEATTRIBUTE" part about? Cannot recall that
 
However what was the "DELETEATTRIBUTE" part about? Cannot recall that
You add SetRankTitle(ch, TranslateString("", "Commander")); at the promotion to Junior Lieutenant.
Then at the promotion to Commander, you execute DeleteAttribute(ch, "title"); which resets that again.
So Gilette would then become:
Midshipman
Junior Lieutenant Commander
Lieutenant Commander
Senior Lieutenant Commander
Commander
Post Captain

That is pretty much what you had in mind, right?
 
Back
Top