Shank 2 [PC] Translation

Need help translating games in other languages? Have your language problems solved here.
Sartr0n
advanced
Posts: 50
Joined: Mon Nov 14, 2011 1:13 pm
Has thanked: 1 time
Been thanked: 2 times

Shank 2 [PC] Translation

Post by Sartr0n » Wed Feb 08, 2012 2:12 pm

Hi, folks.

Since Shank 2 came out I'm thinking to buy the game but first decided to try the pirate version and test it out and try if the game can be translated, but i can't find where are the text files (maybe the text is encoded into the .exe) but i don't have the skills to research where are they and that's why i have created this thread. I think that there are many fans of the game and if the other members here can help with the translation.

This is the original (non-cracked) .exe - http://uploading.com/files/4cdme4d2/Sha ... 2BExe.rar/

Is there a way to find the text and fully translate the game or there is no chance for translation?

I haven't tried with Shank 1 but i think that the files and the engine are the same.

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Shank 2 [PC] Translation

Post by merlinsvk » Wed Feb 08, 2012 6:49 pm

Engine in Shank 2 is new and it differs from Shank 1. Unfortunately (for translators).
Some texts are in .lua files, but I don't know (yet) if game reads them.

And also textures are in new format (Shank 1 used .dds, and menus are made in Scaleform GFx).

EDIT: Texts are in .chui files.

Now textures have KTEX header.

Some examples in attachment.
You do not have the required permissions to view the files attached to this post.

afsoongar
n00b
Posts: 17
Joined: Wed Jan 04, 2012 9:53 am
Has thanked: 8 times

Re: Shank 2 [PC] Translation

Post by afsoongar » Sat Feb 11, 2012 8:18 am

We help you to decode files KTEX header

pitbon1986
n00b
Posts: 12
Joined: Thu Jan 05, 2012 10:55 am

Re: Shank 2 [PC] Translation

Post by pitbon1986 » Sat Feb 11, 2012 1:52 pm

I need a tool to unpack / repack. tex files of shank 2 because I want to make the Italian translation. THx very much for help

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Shank 2 [PC] Translation

Post by merlinsvk » Sun Feb 12, 2012 5:32 pm

Guys,
Does anybody knows what means these values?

Image

lily4761
ultra-n00b
Posts: 8
Joined: Mon Feb 13, 2012 11:40 pm

Re: Shank 2 [PC] Translation

Post by lily4761 » Tue Feb 14, 2012 4:55 am

I can not find any information
hope the tools

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Shank 2 [PC] Translation

Post by merlinsvk » Tue Feb 14, 2012 8:43 am

I'm not good at QuickBMS scripting, but I have made this and it works.
TEX2DDS script will convert .tex texture to .dds (DXT5) and also extract that unknown values to separate .ktex file

Code: Select all

# Game: Shank 2 (PC)
# TEX to DDS converter
# by MerlinSVK    Feb 2012
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\x44\x58\x54\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
get NAME basename
string DNAME = NAME
string DNAME += ".dds"
string KNAME = NAME
string KNAME += ".ktex"

get ASIZE asize
getdstring KTEX 0x8
get WIDTH short
get HEIGHT short
getDString UNK 0x6        # get that 6 unknown values
log KNAME 0xC 0x6         # save them to .ktex file

math DATASIZE = ASIZE 
math DATASIZE -= 0x12     # 0x12 = size of KTEX header
savepos START

putVarChr MEMORY_FILE 0XC HEIGHT short
putVarChr MEMORY_FILE 0x10 WIDTH short

append
log MEMORY_FILE START DATASIZE
append

get DDSSIZE asize MEMORY_FILE
log DNAME 0 DDSSIZE MEMORY_FILE
If you will try to convert .tex files with only numbers in base name such as, 1.tex, 2.tex, ... QuickBMS will ask you for new name for .ktex file. I don't know if it's because my bad coding, or it is a bug in QuickBMS. But, simply add any letter to that file (a1.tex, abcd2.tex, ...) and you will be fine.

DDS2TEX. Doesn't need an explanation :)

Code: Select all

# Game: Shank 2 (PC)
# DDS to TEX converter
# by MerlinSVK    Feb 2012
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

set MEMORY_FILE binary "\x4B\x54\x45\x58\x00\x00\x01\x02\xAA\xAA\xBB\xBB\xCC\xCC\xDD\xDD\xEE\xEE"

open FDDE DDS 0
open FDDE KTEX 1

get NAME basename
string NAME = NAME
string NAME += ".tex_NEW"  # change extension, as you wish

get ASIZE asize 0
goto 0xC 0
get HEIGHT short 0
get DUMMY short 0
get WIDTH short 0
goto 0x80 0

savepos START 0
math DATASIZE = ASIZE
math DATASIZE -= 0x80     # 0x80 = size of DDS header

putVarChr MEMORY_FILE 0x8 WIDTH short
putVarChr MEMORY_FILE 0xA HEIGHT short
# correction of KTEX header in final .tex file
set CORRECTION short 0x0201
putVarChr MEMORY_FILE 0x6 CORRECTION short
# correction

get UNK1 short 1
get UNK2 short 1
get UNK3 short 1

putVarChr MEMORY_FILE 0xC UNK1 short
putVarChr MEMORY_FILE 0xE UNK2 short
putVarChr MEMORY_FILE 0x10 UNK3 short

append
log MEMORY_FILE START DATASIZE
append

get TEXSIZE asize MEMORY_FILE
log NAME 0 TEXSIZE MEMORY_FILE

And if you can make that scripts harder, better, faster, stronger, do it. :keke:

lily4761
ultra-n00b
Posts: 8
Joined: Mon Feb 13, 2012 11:40 pm

Re: Shank 2 [PC] Translation

Post by lily4761 » Tue Feb 14, 2012 11:12 am

merlinsvk wrote:I'm not good at QuickBMS scripting, but I have made this and it works.
TEX2DDS script will convert .tex texture to .dds (DXT5) and also extract that unknown values to separate .ktex file

Code: Select all

# Game: Shank 2 (PC)
# TEX to DDS converter
# by MerlinSVK    Feb 2012
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x04\x00\x00\x00\x44\x58\x54\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
get NAME basename
string DNAME = NAME
string DNAME += ".dds"
string KNAME = NAME
string KNAME += ".ktex"

get ASIZE asize
getdstring KTEX 0x8
get WIDTH short
get HEIGHT short
getDString UNK 0x6        # get that 6 unknown values
log KNAME 0xC 0x6         # save them to .ktex file

math DATASIZE = ASIZE 
math DATASIZE -= 0x12     # 0x12 = size of KTEX header
savepos START

putVarChr MEMORY_FILE 0XC HEIGHT short
putVarChr MEMORY_FILE 0x10 WIDTH short

append
log MEMORY_FILE START DATASIZE
append

get DDSSIZE asize MEMORY_FILE
log DNAME 0 DDSSIZE MEMORY_FILE
If you will try to convert .tex files with only numbers in base name such as, 1.tex, 2.tex, ... QuickBMS will ask you for new name for .ktex file. I don't know if it's because my bad coding, or it is a bug in QuickBMS. But, simply add any letter to that file (a1.tex, abcd2.tex, ...) and you will be fine.

DDS2TEX. Doesn't need an explanation :)

Code: Select all

# Game: Shank 2 (PC)
# DDS to TEX converter
# by MerlinSVK    Feb 2012
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

set MEMORY_FILE binary "\x4B\x54\x45\x58\x00\x00\x01\x02\xAA\xAA\xBB\xBB\xCC\xCC\xDD\xDD\xEE\xEE"

open FDDE DDS 0
open FDDE KTEX 1

get NAME basename
string NAME = NAME
string NAME += ".tex_NEW"  # change extension, as you wish

get ASIZE asize 0
goto 0xC 0
get HEIGHT short 0
get DUMMY short 0
get WIDTH short 0
goto 0x80 0

savepos START 0
math DATASIZE = ASIZE
math DATASIZE -= 0x80     # 0x80 = size of DDS header

putVarChr MEMORY_FILE 0x8 WIDTH short
putVarChr MEMORY_FILE 0xA HEIGHT short
# correction of KTEX header in final .tex file
set CORRECTION short 0x0201
putVarChr MEMORY_FILE 0x6 CORRECTION short
# correction

get UNK1 short 1
get UNK2 short 1
get UNK3 short 1

putVarChr MEMORY_FILE 0xC UNK1 short
putVarChr MEMORY_FILE 0xE UNK2 short
putVarChr MEMORY_FILE 0x10 UNK3 short

append
log MEMORY_FILE START DATASIZE
append

get TEXSIZE asize MEMORY_FILE
log NAME 0 TEXSIZE MEMORY_FILE

And if you can make that scripts harder, better, faster, stronger, do it. :keke:
you are awesome :)

pitbon1986
n00b
Posts: 12
Joined: Thu Jan 05, 2012 10:55 am

Re: Shank 2 [PC] Translation

Post by pitbon1986 » Tue Feb 14, 2012 4:39 pm

thx sooooo much man

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Shank 2 [PC] Translation

Post by merlinsvk » Thu Feb 16, 2012 4:15 pm

Are they working correctly?

And guys, what about fonts? I tried to add chars from slovak alphabet, but game totally ignores them. It looks like game has defined range of chars, something like 32 - 128, and everything above 128 (which actually is that big red exclamation mark) is ignored. I hope, I'm wrong.

pitbon1986
n00b
Posts: 12
Joined: Thu Jan 05, 2012 10:55 am

Re: Shank 2 [PC] Translation

Post by pitbon1986 » Thu Feb 16, 2012 6:51 pm

I extracted a lot of .tex file and everything worked perfectly, creating (for each .tex file): a .dds file and a .tex file of small size.
In these days, I'll modify some .dds files, I'll recreate the .tex file and then test it in-game (I'll let you know if everything works).

As for the fonts: you must only use the English vocabulary, avoiding the use of accents and using apostrophes in their place. To change the text you have to edit .chui files respecting the number of hexadecimal characters.

Example: when you find a written, check the previous character to the first letter, that character index the number of characters used for the word. You must edit the text and change the index character in the match those characters used in the written. (So is probabily that you insert or delete some characters in the file).

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Shank 2 [PC] Translation

Post by merlinsvk » Thu Feb 16, 2012 7:05 pm

Yeah, I saw that "string length" byte there, but I'm litle bit angry because of that character problem :evil:
It would be cool to have full alphabet in game.

afsoongar
n00b
Posts: 17
Joined: Wed Jan 04, 2012 9:53 am
Has thanked: 8 times

Re: Shank 2 [PC] Translation

Post by afsoongar » Fri Feb 17, 2012 8:00 am

Hello

Please see guide for making Alphabetical

fonts Fnt file

Programs do

With respect

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Shank 2 [PC] Translation

Post by merlinsvk » Fri Feb 17, 2012 9:32 am

afsoongar, what guide you mean? :)

afsoongar
n00b
Posts: 17
Joined: Wed Jan 04, 2012 9:53 am
Has thanked: 8 times

Re: Shank 2 [PC] Translation

Post by afsoongar » Fri Feb 17, 2012 4:49 pm

i wonder how can i create arabic font in the format of Fnt file with low size so i can import it to my translated game?

thanks in advanced

Post Reply