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.

Need Help Dialogue Gender Overhaul

Discussion in 'POTC: New Horizons Mod' started by DeathDaisy, Sep 18, 2017.

  1. DeathDaisy

    DeathDaisy Freebooter Storm Modder

    Joined:
    Aug 18, 2017
    Messages:
    290
    Gender:
    Female
    Since there are several female captains to play nowadays, I'm doing an extensive overhaul of the dialogue in the game to make characters use the proper titles and pronouns for the player character primarily, but also other NPCs when I come across such references, instead of "Sir" and "man" everywhere.

    I've made very good progress and am soon ready to share it with you wonderful people, but first a question

    I've used GetMyAddressForm(NPChar, PChar ADDR_* etc) from dialog_func for a lot of places, but here and there I used GetMyAddressform(PChar, NPChar, ADDR_* etc) where the player addresses an NPC that can have different genders and/or to add flavor so that the player uses Señor if they play spanish and so on. But I saw in diag_func that GetMyAddressForm uses (ref chr, ref pchar, int addrtype etc). Will it break if I switch it around? If I use GetCharacterAddressForm(ref char, int addrtype etc), it'll use the NPCs nation to determine address, which isn't what I want for those cases.
     
  2. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    If I recall, there has been massive confusion on this one in the past and I spent a lot of time and effort trying to make sense of it.
    The address form from the player to the NPC should use one of the two, while the other function is intended for the reverse case.
    Can't remember now which is which, but it should be pretty much in all recent code files.

    Trying to remember the underlying logic, it was something along the lines that:
    - NPC does not know the player nationality, so uses the player gender with his/her own nationality
    - Player does know, so uses the NPC gender and nationality together

    That being said, yes you can safely swap the arguments around and it won't break anything.
     
  3. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    Will "GetMyAddressForm" with the arguments reversed work properly if the player is a pirate?

    Also, using the player's current nation to decide which pronoun or title to use may look odd if you start the game as, for example, Dutch, but you then get a Portuguese LoM so your served nation is Portugal. You're still a Dutch character but now you're calling everyone "Senhor" or "Senhorita". And I really do not want to end up calling everyone "Comrade" after I've bought a second LoM and my served nation is now Personal!
     
  4. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Does it use the player served nation or the flag you fly?
     
  5. DeathDaisy

    DeathDaisy Freebooter Storm Modder

    Joined:
    Aug 18, 2017
    Messages:
    290
    Gender:
    Female
    Thanks mate :onya It's been an adventure, and I've become a 200% better coder during this (not saying much), trying to work out what everything means and does. :type1

    So while testing now I immediately ran into a problem; when asking my crew about the time, they all answered with different titles. "Ma'am", "Mademoiselle", "Señorita", the whole shebang. I first thought that was cool, having a multicultural crew, but I also get an ERROR - Missing Character ID: error which I guess means it isn't expected behaviour, maybe they're assigned random nationality. Don't random crew get an ID, so NPChar breaks, or have I messed up?

    The log says
    Code:
    ERROR - Missing Character ID: error
    Quest name reset after waiting FOUND in CommonQuestComplete
    for every crewmember I talk to. It works fine with the townfolk. This is during the starting quest given by Malcolm after a generic free play start. Second time I tried they all called me Señorita; I was playing as a spaniard so it felt more like it worked. But I still got the error so maybe it was just coincidence. Or maybe this error already existed before my code? (I got a vague memory that maybe it does,i might be wrong)

    Bonus question, while I've got this thread anyway; In dialogs where there are a lot of Sirs to change, I've straight up put the Preprocessor_Add at the top, above the dialog switch. It's been working fine when I tested, but I haven't seen it in any other files so I still worry a bit :p it's probably fine tho
     
    Last edited: Sep 18, 2017
  6. DeathDaisy

    DeathDaisy Freebooter Storm Modder

    Joined:
    Aug 18, 2017
    Messages:
    290
    Gender:
    Female
    That's very true.. Will GetCharacterAddressForm work better? I worry it'll use Señorita frex if I talk with a woman from spain if I use GetCharacterAddressForm(NPChar, ADDR_POLITE, false, false) even if I'm not from spain myself. But that's less of a problem than using Comrade with everyone I suppose.. :p maybe my character is just very multicultural and want people to feel at ease

    Is the players starting nation stored somewhere maybe so it's possible to check? I don't use the reversed GetMyAddressForm very often, so the code won't get too messy I think
     
  7. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    For your error, you may want to check error.log . It doesn't sound normal.

    The player starting nation is stored as your served nation.
    But it isn't set in stone and can change during the game depending on your actions.

    I just figure the player uses the address form correct for the town he/she is in.
    "When in Rome, do as the Romans do." ;)
    Adds a bit of extra national flavour to visiting different towns.
     
  8. DeathDaisy

    DeathDaisy Freebooter Storm Modder

    Joined:
    Aug 18, 2017
    Messages:
    290
    Gender:
    Female
    Yeah, that makes a lot of sense, actually. I must learn to kill my darlings :p

    Also, my error log only gives
    Code:
    RUNTIME ERROR - file: quests\quests_common.c; line: 2349
    missed attribute: waitedonship
    RUNTIME ERROR - file: quests\quests_common.c; line: 2349
    no rAP data
    RUNTIME ERROR - file: quests\quests_common.c; line: 2350
    missed attribute: location
    RUNTIME ERROR - file: quests\quests_common.c; line: 2350
    null ap
    RUNTIME ERROR - file: quests\quests_common.c; line: 2350
    no rAP data
    RUNTIME ERROR - file: quests\quests_common.c; line: 2349
    missed attribute: waitedonship
    RUNTIME ERROR - file: quests\quests_common.c; line: 2349
    no rAP data
    RUNTIME ERROR - file: quests\quests_common.c; line: 2350
    missed attribute: location
    RUNTIME ERROR - file: quests\quests_common.c; line: 2350
    null ap
    RUNTIME ERROR - file: quests\quests_common.c; line: 2350
    no rAP data
    
    which are these lines:
    As far as I can gather, it's something to do with the asking for time itself, rather than the title? But then again, I've not coded much apart from actionscript 10 years ago, so I may well misunderstand
     
  9. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    That works most of the time. Indeed, if you look at "Father Bernard_dialog.c", you'll see that I did something similar there. (I've already converted some dialogs to address the player correctly when you're playing a female character, though I haven't tried to do the whole lot!) The thing to watch for is if the character's dialog has any "AddQuestRecord" lines, because those wipe preprocessed data. That's why, if you look through "Father Bernard_dialog.c", wherever there's an "AddQuestRecord", shortly after it you'll see a repeat of the "Preprocessor_Add" lines from the top of the file.
    Now you mention it, "GetMyAddressForm" and "GetCharacterAddressForm" do refer to 'chr.nation', which I believe is your flag if 'chr' is you. It may do odd things to deck crew, though. The random deck crew aren't permanent characters, they're "fantoms". Such temporary characters are assigned a nation based on where you're standing, so that if one of them is spawned in the middle of San Juan, he'll be Spanish. I'm not sure what nation they'll be assigned on a ship deck. Officers will presumably have their nation set when you recruit them, which means if you've been recruiting them from all over the Caribbean, they'll all address you differently - fine for a pirate ship, not so fine for a privateer, and really bad for a naval ship...
     
  10. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Isn't that "waited on ship" stuff related to Smuggling?

    I think officers get an "orgnation" that keeps them belonging to the same nation they were when they were hired.
    Crew members are probably "anything goes". I wouldn't expect those to make much sense.
     
  11. DeathDaisy

    DeathDaisy Freebooter Storm Modder

    Joined:
    Aug 18, 2017
    Messages:
    290
    Gender:
    Female
    Maybe I'll make the crew use XI_ConvertString("sir") and ("ma'am") instead of an address. It's not quite as cool, but avoids some weird situations. Or maybe check if the player's a pirate :p Don't know how to handle the officers. It's bad to have officers call you by foreign titles if you're in the navy, but then again you recruited them in a foreign port :p What's your thoughts on it?

    I get the error when asking them about the time where you can also tell them you want to wait for a few hours, which you're also expected to do when waiting for the time with less patrols, but could it also be called when not on that particular mission? I'll try it with the original file when I get back to the computer
     
  12. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Definitely related to that.
    Must be an error in the coding logic where an attribute is deleted too early.

    Sounds sensible enough to me.

    I think even in the navy, it wasn't unheard of to have an officer of a different nation accompanying you.

    Otherwise, hiring of other nation officers could be prevented for navy players.
     
  13. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    You might have had an officer from a different nation, but I'll bet that he'd be required to call you "Sir", not "Senhor". :napoleon

    It might make sense for naval players to at least be prevented from hiring from hostile ports, or at worst, restrict them to hiring only from their own nation and allied ports. Restricting them to hiring only from their own nation might be a bit too harsh. Any idea how I could prevent hiring from hostile ports?
     
  14. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Fair point, I suppose.

    Edit Enc_officer.c so that you never get into the "hiring" dialog?
    Maybe do the same with the tavern owner dialog so you also cannot generate an officer at will?
     
  15. DeathDaisy

    DeathDaisy Freebooter Storm Modder

    Joined:
    Aug 18, 2017
    Messages:
    290
    Gender:
    Female
    That's fair, it's easy enough to change Enc_Officer to use "sir" instead of AddressForm, but is there a list of named officers? Maybe I can find them by searching for phrases all officers use, like "articles" or something..

    EDIT: Turns out they're all in Officers.c in Characters\init, arn't they? should've looked there first I suppose:facepalm

    Another question I came up with; when asking where the brothel is in pirate towns, I thought it'd be funny if the masturbation euphemism was random. Ive come this far yet:
    Code:
                string RandEuphemism;
                string Euphemism;
                if(PChar.sex == "woman"){
                    RandEuphemism = GetRandomSubString("1,2,3");
                }
                else
                {
                    RandEuphemism = GetRandSubString("4,5,6");
                }
    I was then going to do make it so Euphemism changed phrase based on the number RandEuphemism ended up as. Is there a more elegant way to do that than if(RandEuphemism == 1) for all numbers? I've tried to work it out from other code but it's just too complicated for my current skill level :confused:
     
    Last edited: Sep 19, 2017
  16. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    Code:
    switch(RandEuphemism)
    {
        case ("1"):
            <stuff to do in case "1">
        break;
    
        case ("2"):
            <stuff to do in case "2">
        break;
    <other cases>
    }
     
  17. DeathDaisy

    DeathDaisy Freebooter Storm Modder

    Joined:
    Aug 18, 2017
    Messages:
    290
    Gender:
    Female
    That's much better, thanks.

    Turns out Fred Bob was the only one not using Enc_officer at sea, for obvious reasons.
     
  18. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,623
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    There are probably quite a fair few of them that aren't in there, because they're storyline-specific or random or something else... :oops:
     
  19. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    That's fine because you don't want to overhaul the storyline-specific officers anyway. Their dialogs will have been written to fit in with their storylines. For that matter, be careful with rewriting any other officers' dialogs because the pre-generated officers are probably for sidequests. Generic officers are accounted for by "Enc_Officer_dialog".
     
    Pieter Boelen likes this.
  20. DeathDaisy

    DeathDaisy Freebooter Storm Modder

    Joined:
    Aug 18, 2017
    Messages:
    290
    Gender:
    Female
    Oh boy, back to combing the files again.

    I'm trying to be thoroughly careful in adapting to the context, I haven't touched the storylines for stories where you can't choose your character (i.e. all but standard and freeplay), and I haven't changed things where I think it's storyline specific. It should be alright to change just the pronouns for sidequest officers tho? I've just discovered danielle uses Sir and man in the standard story, and possibly even the name Blaze? I might read that wrong tho.. However, it shouldn't mess anything up if I just change sir and man to their dynamic counterparts?

    EDIT: Here's the use of "Blaze" I'm thinking off:

    dialog.text = DLG_TEXT[5] + GetMyName(&Characters[GetCharacterIndex(DLG_TEXT[6])]) + DLG_TEXT[7];

    DLG_TEXT[6] says "Blaze". But maybe the string "Blaze" is changed to the player chars name in the quest?
     

Share This Page