JRoland 0 Posted Saturday at 01:41 PM I am a Star Wars fan from China and want to translate KOTOR 1 into Chinese. But I have no knowledge of software engineering. After searching and learning on various forums, I successfully converted dialog.tlk into a txt and translated the first line of dialogue. However, when I run the game, the translated text appears as garbled characters. After further searching, I learned that KOTOR 1 does not support DBCS languages. Can anyone please teach me how to make KOTOR 1 display GBK-encoded text? Quote Share this post Link to post Share on other sites
DarthParametric 3,825 Posted Saturday at 02:10 PM Odyssey (KOTOR's engine) doesn't use regular fonts, it uses a font sheet (i.e. an image of the characters). So language is effectively "hard coded" unless you edit the font sheet. There is a tool that will help you do that - https://deadlystream.com/files/file/2375-kotor-autotranslate-tool/ - but unfortunately it doesn't support DBCS languages. But it might at least help you create a custom font sheet manually. I assume you already converted the translated text back into a binary TLK file? I'm not entirely sure if the TLK format even supports DBCS languages. Quote Share this post Link to post Share on other sites
JRoland 0 Posted Saturday at 04:32 PM 1 hour ago, DarthParametric said: Odyssey(KOTOR 的引擎)不使用常规字体,而是使用字体表(即字符图像)。因此,除非您编辑字体表,否则语言实际上是“硬编码”的。有一个工具可以帮助您编辑字体表 - https://deadlystream.com/files/file/2375-kotor-autotranslate-tool/ - 但遗憾的是它不支持 DBCS 语言。但它至少可以帮助您手动创建自定义字体表。 我猜你已经把翻译好的文本转换回二进制 TLK 文件了?我不太确定 TLK 格式是否支持 DBCS 语言。 Thank you very much for your reply. I previously came across this forum post and learned that KOTOR doesn't support DBCS languages. As you mentioned, this AutoTranslate Tool also doesn't support DBCS languages. To create a font sheet, I must choose a language that it supports for translation. So, how can I create a DBCS font sheet? I tried selecting a GBK (simplified Chinese character encoding) TTF file and arbitrarily choosing a language to create the font sheet, but nothing happened. Additionally, due to my near-zero software engineering knowledge, I didn’t fully understand what you meant by "hard coded image of the characters." Does this refer to something like SUP subtitle files? If so, what role do the texts in the TLK file play? Quote Share this post Link to post Share on other sites
DarthParametric 3,825 Posted yesterday at 02:42 AM I have no idea if KOTOR actually supports Chinese, since it was never released in that language. I think Neverwinter Nights does though, and Odyssey is based on Aurora (NWN's engine). Start by referring to these links: https://wiki.xoreos.org/index.php?title=Xml2tlk https://wiki.xoreos.org/index.php?title=TLK_language_IDs_and_encodings In theory you'd convert a UTF-8 XML with strings in simplified Chinese to a binary K1 TLK using Xoreos with the following command: xml2tlk --cp936 --kotor dialog.xml dialog.tlk The language ID would need to be changed at the top of the XML file <tlk language="130"> based on the table from the link above. You can get Xoreos Tools here. Here's a vanilla English K1 XML if you need it: dialogK1.7z But the actual translated text is only half the job. As I mentioned above, Odyssey uses a font sheet, not a font file. It's an image with each individual letter of the alphabet in a position that is defined in the accompanying TXI file. There are about half a dozen or so font sheets in K1. They have separate ones for the different resolutions apparently, plus additional ones for the end credits and the cheat console. A font sheet itself typically has a plain white RGB (aside from icons like controller buttons). The alpha channel is a mask. Here's a vanilla English example: Since Wizard's tool doesn't support DBCS languages, you can try this older tool to generate a font sheet and TXI - https://deadlystream.com/files/file/535-kotor-font-tool-nwn-font-maker/ I'm not sure if that will work either, but it's worth a try. Unfortunately the texture sheets it creates are quite low resolution though. You'd need to duplicate the sheet TGA and TXI to match all the vanilla filenames: fnt_console fnt_credits fnt_creditsa fnt_creditsb fnt_d10x10b fnt_d16x16 fnt_d16x16a fnt_d16x16b fnt_dialog16x16 fnt_galahad14 Although I'm not sure if that last one is actually used. Quote Share this post Link to post Share on other sites
JRoland 0 Posted 21 hours ago 2 hours ago, DarthParametric said: I have no idea if KOTOR actually supports Chinese, since it was never released in that language. I think Neverwinter Nights does though, and Odyssey is based on Aurora (NWN's engine). Start by referring to these links: https://wiki.xoreos.org/index.php?title=Xml2tlk https://wiki.xoreos.org/index.php?title=TLK_language_IDs_and_encodings In theory you'd convert a UTF-8 XML with strings in simplified Chinese to a binary K1 TLK using Xoreos with the following command: xml2tlk --cp936 --kotor dialog.xml dialog.tlk The language ID would need to be changed at the top of the XML file <tlk language="130"> based on the table from the link above. You can get Xoreos Tools here. Here's a vanilla English K1 XML if you need it: dialogK1.7z But the actual translated text is only half the job. As I mentioned above, Odyssey uses a font sheet, not a font file. It's an image with each individual letter of the alphabet in a position that is defined in the accompanying TXI file. There are about half a dozen or so font sheets in K1. They have separate ones for the different resolutions apparently, plus additional ones for the end credits and the cheat console. A font sheet itself typically has a plain white RGB (aside from icons like controller buttons). The alpha channel is a mask. Here's a vanilla English example: Since Wizard's tool doesn't support DBCS languages, you can try this older tool to generate a font sheet and TXI - https://deadlystream.com/files/file/535-kotor-font-tool-nwn-font-maker/ I'm not sure if that will work either, but it's worth a try. Unfortunately the texture sheets it creates are quite low resolution though. You'd need to duplicate the sheet TGA and TXI to match all the vanilla filenames: fnt_console fnt_credits fnt_creditsa fnt_creditsb fnt_d10x10b fnt_d16x16 fnt_d16x16a fnt_d16x16b fnt_dialog16x16 fnt_galahad14 Although I'm not sure if that last one is actually used. OMG This is too complicated for a beginner like me, but thank you very much for your reply. I'll try to figure it all out. Quote Share this post Link to post Share on other sites