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

Anyone translating RandSwear() ??

CouchcaptainCharles

COO (Chief Oddity Officer)
Storm Modder
Pirate Legend
The function " RandSwear() " puts random, more or less funny swearing into a dialog. That is.. it DID once, before I installed the latest modpack.

Once the function looked like this:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->string RandSwear()
{
    int RandS = Rand(7);

    switch (RandS)
    {
        case 0:
            return "Anchor in my stern! ";
        break;

        case 1:
            return "Damn! ";
        break;<!--c2--></div><!--ec2-->That yielded plain English phrases. The lates version of that function looks like this:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->string RandSwear()
{
    int RandS = Rand(7);

    switch (RandS)
    {
        case 0:
            return XI_ConvertString("Anchor in my stern"+"!");
        break;<!--c2--></div><!--ec2-->

and yields NOTHING. At least not for me. Unfortunately I can find no comment explaining this. My questions:

Who changed this?

Is this an attempt to use this function for other languages? An abandoned attempt?

Can it be made to work?

Is there anybody still around who knows something about this? If not I'll (carefully) restore the function.


Speaking of other languages, there are some "Russian" subfolders in the modpack with e.g. translated moddialogs. Is there some translation project going on?
 
<!--quoteo(post=134824:date=Nov 7 2005, 01:58 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Nov 7 2005, 01:58 PM) [snapback]134824[/snapback]</div><div class='quotemain'><!--quotec-->Who changed this?<!--QuoteEnd--></div><!--QuoteEEnd-->
That I don't know...
<!--quoteo(post=134824:date=Nov 7 2005, 01:58 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Nov 7 2005, 01:58 PM) [snapback]134824[/snapback]</div><div class='quotemain'><!--quotec-->Is this an attempt to use this function for other languages? An abandoned attempt?<!--QuoteEnd--></div><!--QuoteEEnd-->
I don't think, it's abandoned. Just far from completion.
<!--quoteo(post=134824:date=Nov 7 2005, 01:58 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Nov 7 2005, 01:58 PM) [snapback]134824[/snapback]</div><div class='quotemain'><!--quotec-->Can it be made to work?

Is there anybody still around who knows something about this? If not I'll (carefully) restore the function.<!--QuoteEnd--></div><!--QuoteEEnd-->
Very simple: XI_ConvertString() reads a string from the common.ini in your language subfolder. You simply have to put the string to display there (have a look at the file to check the syntax). I've already put the RandSwear()-phrases in the file, but I never published the file.

It works like this. In file \RESOURCE\INI\TEXTS\<your_language>\common.ini add lines like:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->string = Anchor in my stern,"Anchor in my stern"<!--c2--></div><!--ec2-->

But strange: those strings are already in the file (at least mine). Maybe I published it, but it doesn't work because of the blanks in the string's key? It worked, when I tested it... But I just saw: the strings are not in \RESOURCE\INI\TEXTS\common.ini. Maybe try to copy it there.

<!--quoteo(post=134824:date=Nov 7 2005, 01:58 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Nov 7 2005, 01:58 PM) [snapback]134824[/snapback]</div><div class='quotemain'><!--quotec-->Speaking of other languages, there are some "Russian" subfolders in the modpack with e.g. translated moddialogs. Is there some translation project going on?<!--QuoteEnd--></div><!--QuoteEEnd-->
AFAIR there's a translation project going on. I don't know, if it's related to <a href="http://robotsdontbleed.com/wacko/wakka.php?wakka=TextAndVoiceProject&v=txp" target="_blank">Text And Voice Project</a>, but seems so...
 
Maximus (who made the interface changes) is working on a translating mod into Russian. It is finished for the most part, but there might still be some bugs left like the ones you found. It should be fixed.
I think the bug is that it doesn't work as being "XI_ConvertString("Anchor in my stern"+"!")" but should have been rewritten (in common.ini too) as "XI_ConvertString("Anchor in my stern!")". Maybe that would work better?
 
Thanks a lot, you two <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Both your hints combined did it.
The entry in common.ini must look like this:

string = Anchor in my stern,"Anchor in my stern"

and the functioncall like this:

case 0:
return XI_ConvertString("Anchor in my stern") +"!! ";
break;

I'll include that in the Greater Oxbay fix.
 
<!--quoteo(post=134879:date=Nov 8 2005, 06:57 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Nov 8 2005, 06:57 PM) [snapback]134879[/snapback]</div><div class='quotemain'><!--quotec-->The entry in common.ini must look like this:

string = Anchor in my stern,"Anchor in my stern"

and the functioncall like this:

case 0:
return XI_ConvertString("Anchor in my stern") +"!! ";
break;<!--QuoteEnd--></div><!--QuoteEEnd-->

Maybe you could do instead:

string = Anchor in my stern,"Anchor in my stern!!"

and

return XI_ConvertString("Anchor in my stern");

would make the code cleaner <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

<!--quoteo(post=134879:date=Nov 8 2005, 06:57 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Nov 8 2005, 06:57 PM) [snapback]134879[/snapback]</div><div class='quotemain'><!--quotec-->I'll include that in the Greater Oxbay fix.<!--QuoteEnd--></div><!--QuoteEEnd-->

Thanks a lot! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
<!--quoteo(post=134887:date=Nov 8 2005, 10:03 PM:name=Swindler)--><div class='quotetop'>QUOTE(Swindler @ Nov 8 2005, 10:03 PM) [snapback]134887[/snapback]</div><div class='quotemain'><!--quotec-->Maybe you could do instead:

string = Anchor in my stern,"Anchor in my stern!!"<!--QuoteEnd--></div><!--QuoteEEnd-->
Thought that as well <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> and tried that first, but the '!' do not show up in the dialog then. 'F***' or '##@@@' don't work either. Looks like language convert deletes all punctuation <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
 
Back
Top