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.

WIP Improve Baldewyn Coffier & Arnaud/Sabine Matton Sidequests

Discussion in 'Build Beta and Brainstorming' started by Pieter Boelen, Jan 4, 2016.

  1. 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
    Indeed it would.

    Checking gender is what @Grey Roger does in his Ardent storyline too.
     
  2. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    This is how I've done it in "Ardent":
    Code:
    if(PChar.sex == "man")
    {
    <do man stuff>
    }
    else
    {
    <do woman stuff>
    }
    A simple one is in "PROGRAM\DIALOGS\Laurence Wellman_dialog.c":
    Code:
           if (PChar.sex == "man") Preprocessor_Add("person", "man");
           else Preprocessor_Add("person", "woman");
           d.Text = DLG_TEXT[45] + GetMyName(Pchar) + DLG_TEXT[46];
           Link.l1 = DLG_TEXT[47];
    And "Laurence Wellman_dialog.h" contains this:
    Code:
    "Do you consider me a worthy #sperson#?",
    So your dialog line will correctly call you a man or woman.
     
    Pieter Boelen likes this.
  3. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,707
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    @Grey Roger don't you want to put a translate string function round those man and woman string?
    You included them in the common.ini right?
     
  4. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    What's a translate string function?

    "man" and "woman" are already in "common.ini".
     
  5. 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
    Something I stopped bothering with a long time ago because it takes extra time, makes the code more complex and, historically speaking, nobody ever finishes their translation efforts anyway. :wp
     
  6. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    Seriously, what is the translate string function? As we do now have someone working on a translation, I'd rather not make things harder for him, so if you can tell me what I should use in that 'Preprocessor_Add("person", "man")' command, I'll use it.
     
  7. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,707
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    Like this
    Code:
    TranslateString("","man")
    
    That way the string will be translated right?
    Now it's just a hardcoded string altough you put it in the processor it won't be translated, or am I remembering something wrong?
     
  8. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,707
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    I try at least to always put a comment with TODO next to it so if someday someone actually gets close to finishing it I can search for those things and change it :p.
     
  9. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    Does 'TranslateString' correctly take account of whether a word is at the start of a sentence? So that if I have 'TranslateString("","He") because the preprocessed word is in something like "#spronoun# has been kidnapped.", it will produce "He has been kidnapped." rather than "he has been kidnapped."

    Otherwise one or two of my dialogs will need a bit of rephrasing or re-punctuating.

    I've a vague feeling I've seen other translation functions. Which is the correct one to use?
     
  10. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,707
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    I don't know anymore either. I think best is to just test what it does. I do know it wont take beginning of sentences etc into account.

    Most transtlate functions just make sure it reads from another file if I remember right...
     
  11. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    Here's "Laurence Wellman_dialog.c" with "man" and "woman" replaced by 'TranslateString("","man")' and 'TranslateString("","woman")' respectively. I'll go through the rest of my dialog files doing the same.
     

    Attached Files:

  12. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,707
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    Did you test it? Does it work?
     
  13. 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
    I very much support that! :onya

    No, it doesn't. Because the game code is not capital-sensitive, we've had to work around that for that very reason.
    Bit annoying, really. :facepalm

    There is also XI_ConvertString, which I think checks only common.ini .
     
  14. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    So, which should I be using - 'TranslateString' or 'XI_ConvertString'? I'd like to get this right before I start fixing all Ardent's dialogs, so I don't need to do it all over again. ;)
     
  15. 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
    It depends on the situation, really. I think for a single word, XI_ConvertString will probably do the trick.

    I've never really investigated the translation stuff in-depth....
     
  16. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,707
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    feel free to investigate it a bit. I still would love to make a wiki article about it because I'm struggling with it a lot also.
     
  17. 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
    I can guarantee you with 100% certainty that I will NOT do so.
    Once I finally find the time to do stuff, I really have more important things to tackle.
     
  18. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,707
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    I actually mean @Grey Roger to investigate it :p
     
    Pieter Boelen likes this.
  19. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    6,415
    See @Pieter Boelen's reply. :p The main difference is that I have even less idea what the various functions in PoTC do, or for that matter, which functions even exist. That's why I didn't have a translation function in those dialogs.

    My main priority remains to develop the "Ardent" storyline. Now I'm aware of the need to use 'TranslateString' or 'XI_ConvertString', I have to go through all the storyline and related dialogs to use it - all I need to know is which one to use. If 'XI_ConvertString' does its translation by looking at "common.ini" then that seems to be the one to use - I just need to check that the word being translated is in there, and add it if it isn't. Whoever translates the game into another language will have to create a new version of "common.ini", and that should then take care of all my dialogs.
     
  20. 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 correctly, 'TranslateString' is used mostly for longer texts that could be in different TXT files.
    On the other hand, 'XI_ConvertString' is mostly used for single, short terms like the other ones in common.ini .

    Since making all code translation-ready takes substantial extra effort, my own opinion these days is that whoever wants to do a translation can take care of that as well.
     
    Last edited: Sep 23, 2016

Share This Page