• 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 Incorrect Address Forms in Dialogs: Gender or Nationality

Talisman

Smuggler
Storm Modder
Some of the female NPC's address me as a female (e.g. storekeepers - Hopital & Tortuga and some female town walkers when I first talk to them to ask directions).

While all the men address me as male ( correctly ) - they are not stupid enough to insult Elting by calling him a girl:razz

No error log generated.

:duel:
 

Attachments

  • B14_Lady1.JPG
    B14_Lady1.JPG
    240.8 KB · Views: 111
  • B14_Lady2.JPG
    B14_Lady2.JPG
    146.2 KB · Views: 110
  • B14_Lady3.JPG
    B14_Lady3.JPG
    180 KB · Views: 118
  • B14_Lady4.JPG
    B14_Lady4.JPG
    167.3 KB · Views: 132
  • system.log
    215.9 KB · Views: 114
  • compile.log
    39 KB · Views: 115
I found a bug related to GetMyAdressForm a while back which swapped the genders of the NPC and the PChar in dialog sometimes, which I fixed.
But I also remember swapping some stuff in the past to get this to make sense.
Perhaps my recent fix has caused the old swapping to cause problems now, as that was never a true fix in the first place.

Have a look in the relevant dialog.c files as probably the NPChar and PChar variables need to be swapped back in some places.
 
I have looked at the 2 storkeepers dialog.c files ( they have not changes between Beta 3 and Beta 3-5)

this is the Jasmine cotton one:-

Code:
case "First time":
       Dialog.defAni = "dialog_stay1";
       Dialog.defCam = "1";
       Dialog.defSnd = "dialogs\0\017";
       Dialog.defLinkAni = "dialog_1";
       Dialog.defLinkCam = "1";
       Dialog.defLinkSnd = "dialogs\woman\024";
       Dialog.ani = "dialog_stay2";
       Dialog.cam = "1";
       if(TradeCheck(PChar, NPChar, true)) { // NK

       if (npchar.quest.meeting == "0")
       {
         dialog.snd = "Voice\EMRI\EMRI001";
         Dialog.Text = DLG_TEXT[0] + GetMyAddressForm(NPChar, PChar, ADDR_CIVIL, false, false) + DLG_TEXT[1] + GetMyFullName(NPChar) + DLG_TEXT[2];
         Link.l1 = pcharrepphrase(DLG_TEXT[3] + GetMyFullName(PChar) + DLG_TEXT[4], DLG_TEXT[5] + GetMyFullName(PChar) + DLG_TEXT[6]);
         link.l1.go = "node_3";
       }
       else
       {
         dialog.snd = "Voice\EMRI\EMRI002";
         dialog.text = DLG_TEXT[7] + GetMyAddressForm(NPChar, PChar, ADDR_CIVIL, false, false) + DLG_TEXT[8];
         Link.l1 = pcharrepphrase(DLG_TEXT[9], DLG_TEXT[10]);
         link.l1.go = "node_3";
       }
       // NK -->
       }
       else
       {
         dialog.text = DLG_TEXT[47] + GetMyAddressForm(NPChar, PChar, ADDR_CIVIL, false, false) + DLG_TEXT[48];
         Link.l1 = DLG_TEXT[49];
         Link.l1.go = "exit";
         if(sti(PChar.Skill.Commerce)>=5)
         {
           Link.l2 = TranslateString("","low_trade_1");
           Link.l2.go = "low_price";
         }
       }
       // NK <--
       NextDiag.TempNode = "First time";
     break;

:shrug
 
Looks like my recent "fix" GetMyAddressForm messed things up instead.
I think I'm finally beginning to understand what is going on here.

There are two functions;
Code:
string GetMyAddressForm(ref chr, ref pchr, int addrtype, bool fname, bool lname)
Which is supposed to ONLY get the address from from an NPC to the player.
We always thought that by swapping the PChar and NPChar in those calls, you would get the address form from the player to the NPC instead.
That apparently is WRONG!!!

That is what this function is for instead:
Code:
string GetCharacterAddressForm(ref chr, int addrtype, bool fname, bool lname)
I have just completed a whole bunch of swip-swapping of those lines to hopefully make things behave more sensibly across the board.
I'd recommend players keep a good eye on this for the foreseeable future as I can make no guarantees that it is all correct for the next update. :facepalm
 
Important Announcement!

This particular issue has been a long-standing one. We've been playing "digital ping-pong" with the solution.
In other words: We've been going back and forth, never managing to fix it properly. :facepalm

So a few days ago I made some relatively large changes to quite a few files to hopefully get this to behave correctly this time around.
But we won't ever find out if it works, unless everyone starts paying very close attention to this!


Here is what to watch our for:

- The nation used for the "address form" should ALWAYS be that of the character you're talking to.
After all, the locals will use their nation and the player should be clever enough to know what nation's citizen he's addressing.

- The gender of the character you're talking to should also make sense.
Male player to male NPC is generally OK. But male to female has always been a tricky one.

This also means some players must play as a female character and characters of different nations to see if things indeed do make sense.


Please indicate that you have seen this request by "Liking" this post.
If not enough members do that, I'm going to start tagging some people because I really do want this over and done with at long last.
If nothing weird is found in, shall we say two weeks, I'll consider this "Fixed" until I hear otherwise.
 
Playing as Francis Drake, I went into the store at La Tortue, where the female storekeeper correctly greeted me as "Monsieur". I'll report back if anyone calls Drake "Miss" or equivalent.

About the only time I can recall being addressed as a female was by the bandits who had been upsetting Zaid Murro, but that's probably an intentional insult on their part and they did not live to regret it. :D
 
Playing as Francis Drake, I went into the store at La Tortue, where the female storekeeper correctly greeted me as "Monsieur". I'll report back if anyone calls Drake "Miss" or equivalent.
Just to be absolutely sure, is that with yesterday's ZIP file?
Thanks for keep an eye in any case! :cheers
 
It wasn't very obvious before until I made a fix quite recently that wasn't a fix.
It is most notable when you talk to Ferndale characters or you pay as female.
And characters' nations weren't always used correctly either.
Hopefully that is now finally a thing of the past.
 
While testing my modifications to the "Angelique Moulin" side quest, I tried a new free-play game in a later period. Using a female character allowed me to check this as well. The stores in Tortuga and Port au Prince correctly addressed me as female, and so did the male shopkeeper in San Juan. Some quest characters, however, did not. A lot of quest character dialogs are probably going to need to be rewritten to switch title as appropriate for their nation and your gender... (Antoine Chamfort, for example, greeted me as "Monsieur".)
 
While testing my modifications to the "Angelique Moulin" side quest, I tried a new free-play game in a later period. Using a female character allowed me to check this as well. The stores in Tortuga and Port au Prince correctly addressed me as female, and so did the male shopkeeper in San Juan. Some quest characters, however, did not. A lot of quest character dialogs are probably going to need to be rewritten to switch title as appropriate for their nation and your gender... (Antoine Chamfort, for example, greeted me as "Monsieur".)
I strongly suspect that a lot of that is hardcoded in the dialog.h files, which means that character gender and nationalities aren't taken into account at all.
Is that the case here by any chance?

The original game didn't have the preprocessor functionality, so used all sorts of convoluted methods.
For example, any dialog lines containing an address form are split so that the addresss form could be added as a function.
Same with character names, where often in stock game code you will see "dialog lines" with a character ID so that the character's name can be inserted based on that ID.

However, pretty much none of that was done for mod-added content and character names, genders, nationalities, etc. are just written straight in the dialog file and therefore aren't dynamic.
Fixing this using the "stock game method" would require substantial rewrites of the files and renumbering of lines in the dialog.h files, which is just too much to do.

So as alternate solution, we can set up some default preprocessors for PChar address form, NPChar address form and other "variables".
Then we can use those accordingly in the dialog files and hopefully get this right. Would be a large project though, as I have no idea how many occurances of this there are (probably a lot).
 
I strongly suspect that a lot of that is hardcoded in the dialog.h files, which means that character gender and nationalities aren't taken into account at all.
Is that the case here by any chance?
Yes. The first thing he says when you talk to him, hard-coded, is "Yes Monsieur?"

So as alternate solution, we can set up some default preprocessors for PChar address form, NPChar address form and other "variables".
Then we can use those accordingly in the dialog files and hopefully get this right. Would be a large project though, as I have no idea how many occurances of this there are (probably a lot).
We can reasonably ignore anything related to specific storylines. They can assume that you're playing the default character - a lot of dialog is probably going to look silly if you don't. The expansion of free-play to allow all side-quests makes it unnecessary to alter your character during a storyline, so if you do, you can live with the consequences. xD So that means only side quest characters would need to be fixed. Which is still probably quite a lot, but not as much as if it was going to be done for all characters.

Something evidently exists so that storekeepers address you correctly. If I find out how that works, I can do it to Chamfort for a start. Thereafter it's just a matter of playing through the side-quests and sorting out anyone who calls you by the wrong title...
 
We can reasonably ignore anything related to specific storylines. They can assume that you're playing the default character - a lot of dialog is probably going to look silly if you don't. The expansion of free-play to allow all side-quests makes it unnecessary to alter your character during a storyline, so if you do, you can live with the consequences. xD So that means only side quest characters would need to be fixed. Which is still probably quite a lot, but not as much as if it was going to be done for all characters.
Agreed; the storylines should be fine. So that narrows it down to probably only the mod-added sidequests and any quest where the nationality/names of characters are being changed from the default.
Indeed your Moulin one should be a good testing ground. :onya

Something evidently exists so that storekeepers address you correctly. If I find out how that works, I can do it to Chamfort for a start. Thereafter it's just a matter of playing through the side-quests and sorting out anyone who calls you by the wrong title...
The storekeepers use the stock game method I described, but that is probably quite impractical here.
Try the preprocessor method again. Something like:
Code:
Preprocessor_Add("address", GetMyAddressForm(NPChar, PChar, ADDR_CIVIL, false, false);
Note that I wrote that completely from memory, so try to find a similar function call to check my syntax there.

I think you might be able to find a good example in the "Reynard Grueneveldt_dialog.c" file that uses a preprocessor for the address form of the NPC.
If not that file, then the "governor_dialog.c" one instead. I know that is where @konradk was experimenting with these systems when he still did PotC coding.
 
Looking at "Reynard Grueneveldt_dialog.c" and "Reynard Grueneveldt_dialog.h", that seems to define what you call him. For example:
Code:
    case "second time":
       Dialog.snd = "voice\REGR\REGR005";
       Preprocessor_Add("addr", GetMyAddressForm(NPChar, PChar, ADDR_TITLE, false, false)); // KK
       dialog.text = DLG_TEXT[11];
       link.l1 = DLG_TEXT[12];
       link.l1.go = "quests";
       link.l5 = DLG_TEXT[13];
       link.l5.go = "exit";
Line 11, which is what he says, is "I am all ears. What made you come to me?" Your answer on line 12 is "Business #saddr#." (Line 13 is just "I'm leaving.")

So I imagine that for what someone else is calling me, perhaps it should be:
Code:
Preprocessor_Add("address", GetMyAddressForm(PChar, NPChar, ADDR_CIVIL, false, false);

"governor_dialog.c" is interesting. The 'Preprocessor' line for addressing is near the end:
Code:
      Preprocessor_Add("addr", GetMyAddressForm(NPChar, PChar, ADDR_CIVIL, false, false));
       dialog.text = DLG_TEXT[70];
       link.a1 = DLG_TEXT[71];
       link.a1.go = "Colony_management";
       link.l2 = DLG_TEXT[72];
       link.l2.go = "quests";
       link.l3 = DLG_TEXT[73];
       link.l3.go = "exit";
Line 70 is "What are your orders, #saddr#?" This seems to be for a colony which you've taken for yourself so you're commanding the governor. Line 72 is "Do you know about some hostilities on near waters, #saddr#?" So "#saddr#" is used for both him talking to you and you talking to him. Assuming this code is actually invoked after you've captured a colony for yourself, I'm going to have to see what happens if you're male and the governor is female, or vice versa. Because I suspect the results will be amusing, not to mention very relevant to this thread...
 
Looking at "Reynard Grueneveldt_dialog.c" and "Reynard Grueneveldt_dialog.h", that seems to define what you call him. For example:
Code:
    case "second time":
       Dialog.snd = "voice\REGR\REGR005";
       Preprocessor_Add("addr", GetMyAddressForm(NPChar, PChar, ADDR_TITLE, false, false)); // KK
       dialog.text = DLG_TEXT[11];
       link.l1 = DLG_TEXT[12];
       link.l1.go = "quests";
       link.l5 = DLG_TEXT[13];
       link.l5.go = "exit";
Line 11, which is what he says, is "I am all ears. What made you come to me?" Your answer on line 12 is "Business #saddr#." (Line 13 is just "I'm leaving.")

So I imagine that for what someone else is calling me, perhaps it should be:
Code:
Preprocessor_Add("address", GetMyAddressForm(PChar, NPChar, ADDR_CIVIL, false, false);
That's what I originally assumed as well, but that was unfortutely wrong.
The correct way is described a few posts up: http://www.piratesahoy.net/threads/gender-problems-some-women-think-im-female.25430/#post-511592

"governor_dialog.c" is interesting. The 'Preprocessor' line for addressing is near the end:
Code:
      Preprocessor_Add("addr", GetMyAddressForm(NPChar, PChar, ADDR_CIVIL, false, false));
       dialog.text = DLG_TEXT[70];
       link.a1 = DLG_TEXT[71];
       link.a1.go = "Colony_management";
       link.l2 = DLG_TEXT[72];
       link.l2.go = "quests";
       link.l3 = DLG_TEXT[73];
       link.l3.go = "exit";
Line 70 is "What are your orders, #saddr#?" This seems to be for a colony which you've taken for yourself so you're commanding the governor. Line 72 is "Do you know about some hostilities on near waters, #saddr#?" So "#saddr#" is used for both him talking to you and you talking to him. Assuming this code is actually invoked after you've captured a colony for yourself, I'm going to have to see what happens if you're male and the governor is female, or vice versa. Because I suspect the results will be amusing, not to mention very relevant to this thread...
That indeed looks pretty bad! We now know that there should be a different variable name for you talking to him.
Perhaps this would be cleaner:
Code:
Preprocessor_Add("npc", GetCharacterAddressForm(NPChar, ADDR_CIVIL, false, false));
Preprocessor_Add("player", GetMyAddressForm(NPChar, PChar, ADDR_TITLE, false, false));
Then use the appropriate one, depending on which character is saying it.
I'm also not sure which of the two should use ADDR_CIVIL and which one should use ADDR_TITLE but that can be established per line putting a different one in place as appropriate.
 
Last edited:
Perhaps this would be cleaner:
Code:
Preprocessor_Add("npc", GetCharacterAddressForm(NPChar, ADDR_CIVIL, false, false));
Preprocessor_Add("player", Preprocessor_Add("addr", GetMyAddressForm(NPChar, PChar, ADDR_TITLE, false, false));
Then use the appropriate one, depending on which character is saying it.
I'm not sure what will be the effect of a Preprocessor within a Preprocessor, but I do know what will be the effect of having three '(' and two ')' because I've been caught out that way myself. :facepalm

I'm also not sure which of the two should use ADDR_CIVIL and which one should use ADDR_TITLE but that can be established per line putting a different one in place as appropriate.
What do they do? If "ADDR_TITLE" gives the character's title as set by 'SetRankTitle' then, if I understand the parameters correctly, it should be 'Preprocessor_Add("addr", GetMyAddressForm(NPChar, PChar, ADDR_TITLE, true, false));'. For example, Francis Drake after his knighthood would then be addressed as "Sir Francis".
 
I'm not sure what will be the effect of a Preprocessor within a Preprocessor, but I do know what will be the effect of having three '(' and two ')' because I've been caught out that way myself. :facepalm
Oops, typo again. Corrected now in my above post.

What do they do? If "ADDR_TITLE" gives the character's title as set by 'SetRankTitle' then, if I understand the parameters correctly, it should be 'Preprocessor_Add("addr", GetMyAddressForm(NPChar, PChar, ADDR_TITLE, true, false));'. For example, Francis Drake after his knighthood would then be addressed as "Sir Francis".
You can find the actual functions in PROGRAM\Dialog_func.c so that you can see what they both do.
Indeed I do believe you're right there. :yes
 
A small thing: I noticed that addressing the female governor, in Hopital, I use the word: Sir!
 
A small thing: I noticed that addressing the female governor, in Hopital, I use the word: Sir!
This is, of course, wrong.
Not because of gender, but because a governor isn't a mere "Sir". :napoleon The correct address is "your Excellency", which you've probably been using most of the time.

Put this into "PROGRAM\DIALOGS\ENGLISH" and see if you still call her "Sir".
 

Attachments

  • governor.h
    2.8 KB · Views: 120
Put this into "PROGRAM\DIALOGS\ENGLISH" and see if you still call her "Sir".
The "governor.h" file should only be used for anything related to promotions and asking about nation relations and ship hunting quests.
But the start of the dialog is still based on the individual governor dialogs, so that is probably where the error lies....
 
Back
Top