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

Need Help Pre-Set French Nobleman Character

Lord Horatio Nelson

1st Duke of Bronté
Storm Modder
Welp, I am at a loss. I am trying to add in my own French nobleman character in NH, and to give him his own personal home on one of the french colonies, and I wont go near the buildingset homes, since they have no collisions normally, and that breaks my game when I enable them, so I need to find a way to add in a pre-set home for the specific character, and to give him the proper nobility title and address form. Can someone tell me how to do this right? So far I got most of it down, but some parts are still new to me. I'll likely make him a Chevalier or Marquis, and I do know (somewhat) how to give him the privateer title of Chevalier or Marquis, but I am not sure how to make others address the nobility title right. EDIT: I just realized there already was a French Chevalier character in NH, my bad. I may change my character to an English Knight or Viscount.
 
Just because there is one Chevalier already does not mean you can't have another.

Is this supposed to be a playable character (similar to Jean de la Croix) or a non-player character whom you can find while playing the game (like Contre-Amirale Beauregard, whom you'll find in Port au Prince town hall and who gives you the "Sinking the Vogelstruijs" sidequest)?

Do you know which colony you want to use for the character's home?
 
Just because there is one Chevalier already does not mean you can't have another.

Is this supposed to be a playable character (similar to Jean de la Croix) or a non-player character whom you can find while playing the game (like Contre-Amirale Beauregard, whom you'll find in Port au Prince town hall and who gives you the "Sinking the Vogelstruijs" sidequest)?

Do you know which colony you want to use for the character's home?
I'd likely make him an English Viscount/Earl, living in either Port Royal or one of the other bigger English Colonies. Luckily, with the newer NH update you posted the game now has proper address forms, such as Barons and up being called Lord and not Sir. I must also make it so he starts out having his own land, and having more start money and wealth than most other characters (Meaning he starts out with more than 500 wealth unlike the other characters) and has his own items. And he would be playable. I would also like to make him have some fame IE: Well-Known kind of fame.
 
Last edited:
You can add some StartStoryline.c code for AddWealthToCharacter .
That immediately translates to some Fame too.
 
If you want to create a new playable character, have a look at this:
Creating a new character model
Your character is a noble, so he's probably player type "Social Climber". What that means is that when you create his entry in "PROGRAM\Models\initModels.c", you'll want to add this line:
Code:
model.playertype   = PLAYER_TYPE_SOCIAL_CLIMBER;

Next, have a look at "PROGRAM\Characters\characters_init.c". You can find how some other playable characters have their own special starting conditions. Look for this part:
Code:
       case PLAYER_TYPE_SOCIAL_CLIMBER:
           ch.shiplog.Entry.log0 = "I mean to go places in life and what better way to get there than as the captain of my own ship. The investment has been considerable but I expect it to pay for itself many times over before I am ready to move on to the next stage. Perhaps a noble title bought with gold and favors, or a fleet of sturdy vessels trading far and wide to fill my coffers with gold. The road will be long and treacherous to be sure but if there is one thing I have learned about myself is that I have what it takes to endure whatever I must to reach my goals.";
           if(ENABLE_WEAPONSMOD)
           {
               GiveItem2Character(ch, "bladeC30+2");
               GiveItem2Character(ch, "pistol2+2");
           }
           else
           {
               GiveItem2Character(ch, "bladeC30");
               GiveItem2Character(ch, "pistol2");
           }
           GiveItem2Character(ch, "jewelry7");
       break;
You can create a special setup for your character:
Code:
       case PLAYER_TYPE_SOCIAL_CLIMBER:
           if (GetMySimpleOldName(ch) == "Insert Name Here" && ch.nation == ENGLAND)
           {
               SetRankTitle(ch, TranslateString("", "Lord"));
               ch.knighted = ENGLAND;
               AddMoneyToCharacter(ch, 500);
               AddLandToCharacter(ch, Redmond, ENGLAND, 1000);
               ch.shiplog.Entry.log0 = "Your character's own starting ship's log";
           }
           else
           {
               ch.shiplog.Entry.log0 = "I mean to go places in life and what better way to get there than as the captain of my own ship. The investment has been considerable but I expect it to pay for itself many times over before I am ready to move on to the next stage. Perhaps a noble title bought with gold and favors, or a fleet of sturdy vessels trading far and wide to fill my coffers with gold. The road will be long and treacherous to be sure but if there is one thing I have learned about myself is that I have what it takes to endure whatever I must to reach my goals.";
           }
           if(ENABLE_WEAPONSMOD)
           {
               GiveItem2Character(ch, "bladeC30+2");
               GiveItem2Character(ch, "pistol2+2");
           }
           else
           {
               GiveItem2Character(ch, "bladeC30");
               GiveItem2Character(ch, "pistol2");
           }
           GiveItem2Character(ch, "jewelry7");
       break;
I'm not quite sure how to add fame. But then, although this fellow has a title, he has not actually done anything yet because you've only just started a new game! He's presumably inherited his title and estate. He's a viscount and not even the governor of an island, so it's up to the player to get him noticed.

There is currently no way to give a player a home on land. Your home is your ship.

The game gives the correct address "Sir", "Dame", "Lord", "Lady" provided you have earned the title through promotions. It might not automatically assign the title if you start the game at high rank. The line 'SetRankTitle(ch, TranslateString("", "Lord"));' should make certain that he's a Lord.

The 'AddLandtoCharacter' line gives him an abstract estate. Incidentally, "Redmond" is the code's name for Jamaica; if you want to base the character somewhere else, replace "Redmond" with "Eleuthera", "Antigua", "Oxbay" or "Quebradas Costillas". "Oxbay" is Barbados, "Quebradas Costillas" is Nevis.
 
How do you add wealth? Presumably that's personal money, not currently used for much, as opposed to "ch.money", which is the character's general money and appears as the ship's account.

There was a new fame attribute added, with your help as I recall, for use in my "Kapitein of Kralendijk" sidequest. The code to make you a bit more famous at the end of the quest is:
Code:
           string fame_name = "extra_fame" + HOLLAND;
           x = stf(GetAttribute(PChar, fame_name));
           if (x < 0) PChar.(fame_name) = 50.0;   // You just became famous because your exploits have been noticed by very important people and made all the news
           else PChar.(fame_name) = x + 50.0;
So to give this character a boost to fame with England, perhaps put this into his part of "characters_init.c":
Code:
ch.extra_fame0 = 50.0;
 
Wow, thanks. This helps a ton. I'll be sure to modify that code so it suits my character, thanks.
EDIT: I did not realize the first message went through, sorry. My wifi is a bit slow.
 
Last edited by a moderator:
If you want to create a new playable character, have a look at this:
Creating a new character model
Your character is a noble, so he's probably player type "Social Climber". What that means is that when you create his entry in "PROGRAM\Models\initModels.c", you'll want to add this line:
Code:
model.playertype   = PLAYER_TYPE_SOCIAL_CLIMBER;

Next, have a look at "PROGRAM\Characters\characters_init.c". You can find how some other playable characters have their own special starting conditions. Look for this part:
Code:
       case PLAYER_TYPE_SOCIAL_CLIMBER:
           ch.shiplog.Entry.log0 = "I mean to go places in life and what better way to get there than as the captain of my own ship. The investment has been considerable but I expect it to pay for itself many times over before I am ready to move on to the next stage. Perhaps a noble title bought with gold and favors, or a fleet of sturdy vessels trading far and wide to fill my coffers with gold. The road will be long and treacherous to be sure but if there is one thing I have learned about myself is that I have what it takes to endure whatever I must to reach my goals.";
           if(ENABLE_WEAPONSMOD)
           {
               GiveItem2Character(ch, "bladeC30+2");
               GiveItem2Character(ch, "pistol2+2");
           }
           else
           {
               GiveItem2Character(ch, "bladeC30");
               GiveItem2Character(ch, "pistol2");
           }
           GiveItem2Character(ch, "jewelry7");
       break;
You can create a special setup for your character:
Code:
       case PLAYER_TYPE_SOCIAL_CLIMBER:
           if (GetMySimpleOldName(ch) == "Insert Name Here" && ch.nation == ENGLAND)
           {
               SetRankTitle(ch, TranslateString("", "Lord"));
               ch.knighted = ENGLAND;
               AddMoneyToCharacter(ch, 500);
               AddLandToCharacter(ch, Redmond, ENGLAND, 1000);
               ch.shiplog.Entry.log0 = "Your character's own starting ship's log";
           }
           else
           {
               ch.shiplog.Entry.log0 = "I mean to go places in life and what better way to get there than as the captain of my own ship. The investment has been considerable but I expect it to pay for itself many times over before I am ready to move on to the next stage. Perhaps a noble title bought with gold and favors, or a fleet of sturdy vessels trading far and wide to fill my coffers with gold. The road will be long and treacherous to be sure but if there is one thing I have learned about myself is that I have what it takes to endure whatever I must to reach my goals.";
           }
           if(ENABLE_WEAPONSMOD)
           {
               GiveItem2Character(ch, "bladeC30+2");
               GiveItem2Character(ch, "pistol2+2");
           }
           else
           {
               GiveItem2Character(ch, "bladeC30");
               GiveItem2Character(ch, "pistol2");
           }
           GiveItem2Character(ch, "jewelry7");
       break;
I'm not quite sure how to add fame. But then, although this fellow has a title, he has not actually done anything yet because you've only just started a new game! He's presumably inherited his title and estate. He's a viscount and not even the governor of an island, so it's up to the player to get him noticed.

There is currently no way to give a player a home on land. Your home is your ship.

The game gives the correct address "Sir", "Dame", "Lord", "Lady" provided you have earned the title through promotions. It might not automatically assign the title if you start the game at high rank. The line 'SetRankTitle(ch, TranslateString("", "Lord"));' should make certain that he's a Lord.

The 'AddLandtoCharacter' line gives him an abstract estate. Incidentally, "Redmond" is the code's name for Jamaica; if you want to base the character somewhere else, replace "Redmond" with "Eleuthera", "Antigua", "Oxbay" or "Quebradas Costillas". "Oxbay" is Barbados, "Quebradas Costillas" is Nevis.
Actually, ch.knighted does not work at all for me.
 
"ch.knighted" is an attribute which marks the character as having been knighted by a particular nation. The code which gives you a title when you are promoted checks this and will not give you a new title if it is already set. If that line is not there, and you rise to rank 7 ("Knight"), you'll be knighted again and become "Sir". For a "Lord", this is not a promotion!

"ch.knighted" is also checked by the code which works out how your character should be addressed. Without that attribute, people might not correctly call you "Lord Whatsyourname, Viscount" on formal occasions.
 
"ch.knighted" is an attribute which marks the character as having been knighted by a particular nation. The code which gives you a title when you are promoted checks this and will not give you a new title if it is already set. If that line is not there, and you rise to rank 7 ("Knight"), you'll be knighted again and become "Sir". For a "Lord", this is not a promotion!

"ch.knighted" is also checked by the code which works out how your character should be addressed. Without that attribute, people might not correctly call you "Lord Whatsyourname, Viscount" on formal occasions.
Actually, I am working on a knighted Privateer character. I just cant get it so that he has trust with england at the start, although ik there is a way to do that, but i need him to actually have been knighted, not just have sir as a part of his name without anything else, otherwise he just gets called captain [name] mostly.
 
One thing you could try is the Numpad 9 cheat, which gives you a promotion every time you press the button.
Then you can "predict" what's going to happen for your character throughout the game.

You could also have a look through "PROGRAM\Storyline\FreePlay\StartStoryline.c" for some general examples of playing around with character settings.
See 'SetRelationsAsNation', 'SetRMRelation', 'GivePromotionReward', 'Promote_Cheat', etc.
 
I've tracked down the function for a character's wealth, as opposed to money.
Try putting this into his section of "characters_init.c":
Code:
SetRank(ch, ENGLAND, 7);
AddWealthToCharacter(ch, 500);
That should set him to rank 7, which is "Knight" if he's not a naval officer. It should also give him 500 in personal money, which should improve his fame a bit.
 
I've tracked down the function for a character's wealth, as opposed to money.
Try putting this into his section of "characters_init.c":
Code:
SetRank(ch, ENGLAND, 7);
AddWealthToCharacter(ch, 500);
That should set him to rank 7, which is "Knight" if he's not a naval officer. It should also give him 500 in personal money, which should improve his fame a bit.
Thanks.
 
I've tracked down the function for a character's wealth, as opposed to money.
Try putting this into his section of "characters_init.c":
Code:
SetRank(ch, ENGLAND, 7);
AddWealthToCharacter(ch, 500);
That should set him to rank 7, which is "Knight" if he's not a naval officer. It should also give him 500 in personal money, which should improve his fame a bit.
Nope. Nothing that sets rank works for me at all, it only seems to work with naval officers entirely.
 
'SetRank' should work for non-naval, and indeed non-privateer characters. In fact, that's the same function which is used to become a privateer when you talk to a governor and buy a Letter of Marque.

What does your "International Relations" screen show? Do you have a rank with Britain or does it just show the same as other friendly nations?

Can you upload your files so I can try them out myself?
 
@Pieter Boelen: is "StartStoryline.c" executed after "Characters_init.c"? If so, this part of "PROGRAM\Storyline\FreePlay\StartStoryline.c" may be the problem:
Code:
       case PLAYER_TYPE_CORSAIR:
           if (iNation != PIRATE)
           {
               if (GetMySimpleOldName(PChar) == "José Joaquím Almeida" && GetCurrentPeriod() >= PERIOD_REVOLUTIONS)
               {
                   iNation = AMERICA;
                   SetServedNation(iNation);
                   SetRMRelation(PChar, iNation, REL_NEUTRAL);                                       // Encourage play for America
               }
               else
               {
                   SetRMRelation(PChar, PIRATE, REL_AFTERATTACK);                                   // But are still neutral to the pirates
               }
               SetRank(PChar, iNation, 0);                                                           // Non-pirate corsairs get a Letter of Marque
           }
       break;
Non-pirate corsairs get a LoM. If "Characters_init.c" already gave them a LoM and rank, that's going to reset it to rank 0. Perhaps change it to:
Code:
if (GetRank(PChar, iNation) <= 0) SetRank(PChar, iNation, 0);
 
@Pieter Boelen: is "StartStoryline.c" executed after "Characters_init.c"? If so, this part of "PROGRAM\Storyline\FreePlay\StartStoryline.c" may be the problem:
Code:
       case PLAYER_TYPE_CORSAIR:
           if (iNation != PIRATE)
           {
               if (GetMySimpleOldName(PChar) == "José Joaquím Almeida" && GetCurrentPeriod() >= PERIOD_REVOLUTIONS)
               {
                   iNation = AMERICA;
                   SetServedNation(iNation);
                   SetRMRelation(PChar, iNation, REL_NEUTRAL);                                       // Encourage play for America
               }
               else
               {
                   SetRMRelation(PChar, PIRATE, REL_AFTERATTACK);                                   // But are still neutral to the pirates
               }
               SetRank(PChar, iNation, 0);                                                           // Non-pirate corsairs get a Letter of Marque
           }
       break;
Non-pirate corsairs get a LoM. If "Characters_init.c" already gave them a LoM and rank, that's going to reset it to rank 0. Perhaps change it to:
Code:
if (GetRank(PChar, iNation) <= 0) SetRank(PChar, iNation, 0);
Good idea, that makes sense. And I cannot believe that reply by you was made 9 minutes ago from the time I am posting this, I never see it that fast lol.
 
Back
Top