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

Fixed Character Firstname/Lastname Errors

Pieter Boelen

Navigation Officer
Administrator
Storm Modder
Hearts of Oak Donator
Originally mentioned here by @Hylie Pistof:
http://www.piratesahoy.net/threads/miscellaneous-errors.25401

I know exactly why this is. PROGRAM\dialog.c:
Code:
  CharacterRef.name = GetMyFullName(CharacterRef);
   CharacterRef.lastname = "";
This is something I recently put in to have characters' full name (with title) shown in the dialog interface.
Unfortunately it turns out that is being applied on the original character, not on a copy as I had hoped.
So after the first time you talk to any character, that character technically no longer has a last name. :modding

There was originally much more complex code in place there for the same purpose, but that never worked.
@Levis, do you have any clever ideas on this one?
The only solution I can think of is to store all character name attributes prior to the dialog, then restore it afterwards.
But even then it will be wrong during the dialog, so that wouldn't work either.

@Grey Roger: Do you think it is much of a concern to just never show any ranks and titles in the header of the dialog interface?
That would certainly be the simplest solution.
 
This appears to work:
Code:
  // PB: Overwrite Name -->
   string name = CharacterRef.name;
   string lastname = CharacterRef.lastname;
   CharacterRef.name = GetMyFullName(CharacterRef);
   CharacterRef.lastname = "";
   // PB: Overwrite Name <--

   object persRef = GetCharacterModel(Characters[GetMainCharacterIndex()]);
   SendMessage(&Dialog, "lii", 0, &Characters[GetMainCharacterIndex()], &persRef);

   object charRef = GetCharacterModel(Characters[makeint(CharacterRef.index)]);
   SendMessage(&Dialog, "lii", 1, &Characters[makeint(CharacterRef.index)], &charRef);

   // PB: Restore Name -->
   CharacterRef.name = name;
   CharacterRef.lastname = lastname;
   // PB: Restore Name <--
First merge the names, then reset them again.

On the below screenshots, you can see the effect:
upload_2015-7-5_20-36-14.png

She does have a title at the top of the dialog, but also has her correct lastname in the dialog.
 
While I was at it, I have reworded all references to Silehard so this sidequest should now patch properly with whatever governor is in charge of Jamaica in each period.
 
One last request about this. The miss does not disappear after talking to her and is there every time I go by afterwards.
 
One last request about this. The miss does not disappear after talking to her and is there every time I go by afterwards.
Execute this through console:
Code:
      ChangeCharacterAddressGroup(CharacterFromID("Arabella Silehard"), "None", "", "");
       ChangeCharacterAddressGroup(CharacterFromID("Arabella's guard 1"), "None", "", "");
       ChangeCharacterAddressGroup(CharacterFromID("Arabella's guard 2"), "None", "", "");
Will be done automatically as per the next update. :doff
 
There are a few problems with the English emissary at La Tortue:
newrank.jpg

Every time I talk to him, he gains a new knighthood. This gets silly when, having caused lots of trouble to Spain and Portugal, I return to La Tortue to claim several promotions. He got another "Sir" when I asked about English relations to other nations.

When you get a promotion, he doesn't know what your new rank is. I think I may have fixed this one. The problem is this line in "governor.c":
Code:
dialog.text = DLG_TEXT[57] + XI_ConvertString(GetRankName(PChar, iNation)) + DLG_TEXT[58] + (GetCharacterLand(PChar) - sti(NPChar.templand)) + DLG_TEXT[59] + GetNationRoyalByType(iNation) + ".";
I tried adding a "logit" command just before that to find out what 'GetRankName(PChar, iNation)' produces, expecting a code phrase or number, and when it in fact returned the actual rank, I tried editing that line. I'm not sure what 'XI_ConvertString' is supposed to do, but here it doesn't do anything useful, so I removed it. So with this instead:
Code:
dialog.text = DLG_TEXT[57] + GetRankName(PChar, iNation) + DLG_TEXT[58] + (GetCharacterLand(PChar) - sti(NPChar.templand)) + DLG_TEXT[59] + GetNationRoyalByType(iNation) + ".";
the emissary correctly announces your new rank.

Attached is a savegame in which I'm about to claim the promotions, so you can try it out and also fix the "Sir Sir Sir" problem.

Winston Churchill did not exist in any time period of the game. xD Possible substitutes include:
Francis Walsingham, one time ambassador to France, later Secretary of State and head of what was effectively the secret service of the day;
John Norreys, alias John Norris, whose career included a less than successful expedition with Drake;
Charled Howard, 1st Earl of Nottingham, alias Howard of Effingham, whose career included commanding the English fleet against the Spanish Armada.
 

Attachments

  • -=Player=- Hispaniola.zip
    779.4 KB · Views: 119
There are a few problems with the English emissary at La Tortue:

Every time I talk to him, he gains a new knighthood. This gets silly when, having caused lots of trouble to Spain and Portugal, I return to La Tortue to claim several promotions. He got another "Sir" when I asked about English relations to other nations.
That one should be fixed as per yesterday with this one:
http://www.piratesahoy.net/threads/character-firstname-lastname-errors.25402/

When you get a promotion, he doesn't know what your new rank is. I think I may have fixed this one. The problem is this line in "governor.c":
Code:
dialog.text = DLG_TEXT[57] + XI_ConvertString(GetRankName(PChar, iNation)) + DLG_TEXT[58] + (GetCharacterLand(PChar) - sti(NPChar.templand)) + DLG_TEXT[59] + GetNationRoyalByType(iNation) + ".";
I tried adding a "logit" command just before that to find out what 'GetRankName(PChar, iNation)' produces, expecting a code phrase or number, and when it in fact returned the actual rank, I tried editing that line. I'm not sure what 'XI_ConvertString' is supposed to do, but here it doesn't do anything useful, so I removed it. So with this instead:
Code:
dialog.text = DLG_TEXT[57] + GetRankName(PChar, iNation) + DLG_TEXT[58] + (GetCharacterLand(PChar) - sti(NPChar.templand)) + DLG_TEXT[59] + GetNationRoyalByType(iNation) + ".";
the emissary correctly announces your new rank.
That one was caught and fixed a few days ago too: http://www.piratesahoy.net/threads/no-rank-titles-in-governor-dialog.25404/

Winston Churchill did not exist in any time period of the game. xD
I know! That was just me putting a little joke in there. "Michiel de Reyder" is a play on "de Ruyter" too. ;)

I'm not sure what 'XI_ConvertString' is supposed to do, but here it doesn't do anything useful, so I removed it.
It is for translation purposes and uses RESOURCE\INI\TEXTS\English\common.ini .
I recently removed the rank names from there as they were driving me nuts, but that resulted in this problem.
 
Back
Top