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

WIP Improve Baldewyn Coffier & Arnaud/Sabine Matton Sidequests

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.
 
@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?
 
What's a translate string function?

"man" and "woman" are already in "common.ini".
 
What's a translate string function?
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
 
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.
 
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?
 
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
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.
 
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?
 
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...
 
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.
 

Attachments

  • Laurence Wellman_dialog.c
    5.5 KB · Views: 210
Did you test it? Does it work?
 
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.
I very much support that! :onya

Does 'TranslateString' correctly take account of whether a word is at the start of a sentence?
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

I've a vague feeling I've seen other translation functions. Which is the correct one to use?
There is also XI_ConvertString, which I think checks only common.ini .
 
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. ;)
 
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....
 
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.
 
feel free to investigate it a bit.
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.
 
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.
 
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:
Back
Top