PDA

View Full Version : About scripts and fonts


Unregistered
2007-01-15, 15:36
Hello,
I am trying to do a french patch for Higurashi no naku koro ni. I converted the script data to a txt with nsdec (or whatever) and I thought that I could just swap the text while paying attention not to erase some of the code, but apparently this doesn't work at all.

So regarding this, I have several questions.

1) Do you guys sorta make a new program make you translate the game? (As in start from scrap and type the code in). Or do you just swap the text and possibly some pics?

2) Does the converting tool (nscmake) support unicode? I need to have japanese fonts enabled anyway to explain some of the puns in the game, so I'm going to write in both languages (french and jp) but when I convert back the Unicode txt file to a nscript.dat file, it bugs. I lose most of the data, and cannot start the game at all.

This is my very first doujin game translation, so I actually don't even know the basics behind it, but if someone could tell me what I'm overlooking here, I would be very grateful.

Roto
2007-01-15, 17:18
Usually the script file is extracted, the Japanese text is commented out, and the translated text is inserted in its place, and the script recompiled. I haven't heard of anyone rewriting a game from scratch.

NScripter doesn't support single-byte characters, nor does it support Unicode. It expects the script file to be ShiftJIS.

ONScripter (an open-source port of NScripter) supports single-byte characters, which works okay for English text, but it still expects scripts in ShiftJIS, not Unicode. That's generally OK for English text, but the accented characters in French are, to my knowledge, not present in ShiftJIS and therefore could not appear in a script file.

It would probably be fairly trivial to modify ONScripter to expect a script in UTF-8 or UTF-16, since everything gets internally converted to Unicode anyway.

So, to summarize those few points, NScripter won't play nicely with anything that's not Japanese text. ONScripter adds support for most roman characters, but not accents. Representing both accented characters and Japanese text in the same script would require the script to be in Unicode, which would require modifying ONScripter to read the script in Unicode.

Message
2007-01-16, 00:20
And as far as I understand things, you cannot type Japanese text in a 1-byte line (ie a line starting with ` ) in ONS. So adding Japanese to your translation to explain puns would be problematic in the current ONS versions.

Roto
2007-01-16, 00:36
Actually, I haven't had any problems with mixing 1- and 2-byte characters on lines with the ` marker. From what I've seen, in 1-byte mode, ONScripter reads the script one byte at a time, and if the byte it reads has its high bit set (meaning it's the first byte of a 2-byte character) it will read the second byte and display the two bytes together as a single character.

Example screenshot (http://roto1.net/misc/dev/ons_prop/mixedtext.jpg)

Message
2007-01-16, 02:02
Hmmm, very interesting. I stand corrected. I wonder where I got that idea then...

Rasqual Twilight
2007-01-16, 07:53
Speaking of ONScripter, what is the status of ONScripter-insani w.r.t. Ogapee's ONScripter? Is it meant to replace it eventually?

AstCd2
2007-01-16, 08:01
つ http://forums.visualnews.net/showthread.php?t=7452

Unregistered
2007-01-17, 04:47
Thanks for all these answers, they help a lot.

It took me a few tries but I eventually understood how to use the backquote properly ^_^

It's a shame that I can't write proper french in game, but well, the players will have to live with it.

Right now I am trying to figure out why the "cutscenes" get skipped but the regular text doesn't. Probably will figure it out when I get to the right part of the code though.

Last question:
Let us fast forward into the future, when I've translated the whole first game.
Will the end user need to run the OS in jp for it to work? (Right now I start the game with the Onscripter exe and the 0.txt file) or will it just work under any language setting as long as I make it a proper script.dat file?

Roto
2007-01-17, 08:48
I think ONScripter should be fine no matter what language Windows is set to, since it uses Unicode internally. Whether it's an 0.txt file or a script.dat file shouldn't matter either.

Unregistered
2007-01-17, 09:48
Hello again,

apparently (from what I read at http://ogapee.at.infoseek.co.jp/onscripter.html ) the jp version of Onscripter supports unicode, but the archive apparently has no exe file...

I have opened a few files of the archive at random with Visual C++, but for now I haven't found out anything useful.

Well... I guess this will be for later. First an ansi version, then a proper one...

Roto
2007-01-17, 12:26
Looking at the latest version of the official source for ONScripter, it still looks to me as though all two-byte characters that are encountered are indiscriminately converted from ShiftJIS to UTF-16 before they're displayed.

The ONScripter page indicates (though my Japanese is not very good, I might be wrong) that it uses Unicode fonts (since the fonts and the display of characters is handled by SDL, which uuses UTF-16 for all of its text display functions.) But, the script file is still expected to be ShiftJIS.

When I get a chance, I'll work on adding support for script files in UTF-8. It doesn't look like it would be too difficult.