Your IP : 3.21.46.24
Register | Log in Refresh details

Category ::: Tutorials » Games » Max Payne
-
-    PM
Keywords : MAX PAYNE 3, MP3, RUSSIAN, GXT, MOD, MODDING
0
1
Votes
Created Jul 03, 2012 02:45:26
Last Updated Jul 03, 2012 15:30:19
Viewed 8090 times

What is wrong?
Max Payne 3 has its own rules for cyrilic chars in game text ... it's still ANSI charset, but with shifted characters values in GXT file ... the reason for this is in some chararacters codes which are same for Portuguese and Russian language ... so Portuguese uses native char value, while Russian uses shifted value ... and so we need to shift chars values back for cyrilic chars to make them readable ... we can do it with hex editor ... I prefer to use XVI32 because of its abilities to handle huge files and scripting support which helps to automatize some tasks.


Well ... Let's start :)
When we open russian.gxt file in hex editor we can see that normally each char of text consists of two bytes: first - ANSI char code, second - 00 (i.e. "A" = "41 00") ... and cyrilic chars cosists of: first - shifted ANSI char code, second - 04 (it tells to game engine "This char is shifted cyrilic char!", I think ... it gives us possibility to recognise shifted chars from others in hex editor ... and it must be set to 00 for editing in XGE)
In ANSI table cyrilic characters values has range from C0 to FF, shifted characters values has range from 10 to 4F.
For shifting characters values back to normal it's best to use a script that will replace each shifted characters bytes with normal one by one ... so here it is:

ADR 0
REPLACEALL 10 04 BY C0 00
ADR 0
REPLACEALL 11 04 BY C1 00
ADR 0
REPLACEALL 12 04 BY C2 00
ADR 0
REPLACEALL 13 04 BY C3 00
ADR 0
REPLACEALL 14 04 BY C4 00
ADR 0
REPLACEALL 15 04 BY C5 00
ADR 0
REPLACEALL 16 04 BY C6 00
ADR 0
REPLACEALL 17 04 BY C7 00
ADR 0
REPLACEALL 18 04 BY C8 00
ADR 0
REPLACEALL 19 04 BY C9 00
ADR 0
REPLACEALL 1A 04 BY CA 00
ADR 0
REPLACEALL 1B 04 BY CB 00
ADR 0
REPLACEALL 1C 04 BY CC 00
ADR 0
REPLACEALL 1D 04 BY CD 00
ADR 0
REPLACEALL 1E 04 BY CE 00
ADR 0
REPLACEALL 1F 04 BY CF 00
ADR 0
REPLACEALL 20 04 BY D0 00
ADR 0
REPLACEALL 21 04 BY D1 00
ADR 0
REPLACEALL 22 04 BY D2 00
ADR 0
REPLACEALL 23 04 BY D3 00
ADR 0
REPLACEALL 24 04 BY D4 00
ADR 0
REPLACEALL 25 04 BY D5 00
ADR 0
REPLACEALL 26 04 BY D6 00
ADR 0
REPLACEALL 27 04 BY D7 00
ADR 0
REPLACEALL 28 04 BY D8 00
ADR 0
REPLACEALL 29 04 BY D9 00
ADR 0
REPLACEALL 2A 04 BY DA 00
ADR 0
REPLACEALL 2B 04 BY DB 00
ADR 0
REPLACEALL 2C 04 BY DC 00
ADR 0
REPLACEALL 2D 04 BY DD 00
ADR 0
REPLACEALL 2E 04 BY DE 00
ADR 0
REPLACEALL 2F 04 BY DF 00
ADR 0
REPLACEALL 30 04 BY E0 00
ADR 0
REPLACEALL 31 04 BY E1 00
ADR 0
REPLACEALL 32 04 BY E2 00
ADR 0
REPLACEALL 33 04 BY E3 00
ADR 0
REPLACEALL 34 04 BY E4 00
ADR 0
REPLACEALL 35 04 BY E5 00
ADR 0
REPLACEALL 36 04 BY E6 00
ADR 0
REPLACEALL 37 04 BY E7 00
ADR 0
REPLACEALL 38 04 BY E8 00
ADR 0
REPLACEALL 39 04 BY E9 00
ADR 0
REPLACEALL 3A 04 BY EA 00
ADR 0
REPLACEALL 3B 04 BY EB 00
ADR 0
REPLACEALL 3C 04 BY EC 00
ADR 0
REPLACEALL 3D 04 BY ED 00
ADR 0
REPLACEALL 3E 04 BY EE 00
ADR 0
REPLACEALL 3F 04 BY EF 00
ADR 0
REPLACEALL 40 04 BY F0 00
ADR 0
REPLACEALL 41 04 BY F1 00
ADR 0
REPLACEALL 42 04 BY F2 00
ADR 0
REPLACEALL 43 04 BY F3 00
ADR 0
REPLACEALL 44 04 BY F4 00
ADR 0
REPLACEALL 45 04 BY F5 00
ADR 0
REPLACEALL 46 04 BY F6 00
ADR 0
REPLACEALL 47 04 BY F7 00
ADR 0
REPLACEALL 48 04 BY F8 00
ADR 0
REPLACEALL 49 04 BY F9 00
ADR 0
REPLACEALL 4A 04 BY FA 00
ADR 0
REPLACEALL 4B 04 BY FB 00
ADR 0
REPLACEALL 4C 04 BY FC 00
ADR 0
REPLACEALL 4D 04 BY FD 00
ADR 0
REPLACEALL 4E 04 BY FE 00
ADR 0
REPLACEALL 4F 04 BY FF 00
ADR 0

ADR 0 will send cursor back to begining of the file, which is needed after each char replacement.


So I got script, what next?
We can't shift chars values of all file at once ... because of there are pieces in table area of file which contains same bytes as chars we shifting and script will replace them too ruining file. We need to replace only areas where it's actually text. We can find them in file with TDAT and TKEY tags.

So, let's roll :)
Open russian.gxt in XVI32, press CTRL+F for search, choose "Text string", "Options Case sensitive", "Direction Down", "Scope from Cursor", write "TDAT", hit ENTER key

It will find first match which is starting point of text data in first text table of file.

There are some bytes of internal file data after TDAT, so we need to put cursor where it's first byte of text. Look in hex part of window, it's the byte right after all 00 bytes.

Press CTRL+B to set Block starting mark, press CTRL+F for search, and now write "TKEY", hit ENTER key

It will find next table starting point, which is right after text data of previous table. We need to scroll back a little and put cursor where it's last byte of text. It's the byte right before all 00 bytes.

Press CTRL+B again to put Block ending mark and block of text will turn red.

Unfortunately, there are no possibility (or I don't know how) to execute script for only selected block of file. So we need to open another XVI32 window, copy selected block there, execute script there, and copy data back where we get it.
Press CTRL+H to copy selected block to clipboard as hex string (if it asks about "Really want to copy so a lot of data?", you say "I know what I'm doing here ... don't panic!!"), press CTRL+D to delete selected block, and don't even think about moving cursor from where it is , open another XVI32 window, press CTRL+N to create new file, go to Edit->Clipboard->Paste from hex string (Unfortunately NO hotkey ... SAD for me!! )...

it will paste our block data and put cursor to end of it.

Go to XVIscript->Editor

Copy-paste my script there, press Close (If it asks you "Save this script somewhere?", you say "No!! eONE is not allowing me to do that!!" ... or ... well, ok ... you can save it ... eONE is allowing )

Press CTRL+F9 to execute active script and see how is real magic looks like!!


When it finished your cursor will be at the begining so press CTRL+B to put Block mark, scroll down to the end, press CTRL+B to put another Block mark, press CTRL+H to copy selected block to clipboard as hex string, press CTRL+D to delete selected block, go to first XVI32 window, go to Edit->Clipboard->Paste from hex string to put data back where it was.

Then CTRL+F, find next TDAT, set Block strting mark, CTRL+F, find next TKEY, set Block ending mark, CTRL+H, CTRL+D, paste to another window, execute script, put data back and so on till the end of the file.

When finished and saved, you will need correct characters table for XGE. Launch Characters Set Editor and make table to look like this:

Then open folder where XGE installed (C:\Program Files\Mato Technologies\X GXT Editor by default), find GameInfo.xml and open it with text editor (Notepad or something).

Make a new row after GameInfos and copy-paste this:

<gi name="Max Payne 3" path="" imagename="" crctype="1">
<tables>
SAIRAUD
SBUSAUD
</tables>
</gi>

Now you're good to do and edit russian.gxt with XGE ... enjoy ... untill you want to put it back to game

For shift values to original state you will need to write opposite script, and if you're using all of cyrilic characters add following:

REPLACEALL A8 00 BY CB 00
REPLACEALL B8 00 BY EB 00

Same pipeline, but remember that some Portuguese and Russian chars has same codes, so after running opposite script you will need to find and edit back chars in Portuguese words manually. But it's not too complicated because of after shifting chars values you can easily recognise readable text from other mess.

And now ... I will tell you ... a SECRET (Don't wanted actually, but I must ... for not being selfish jerk). So ... Max Payne 3 ... has same RAGE engine (modified, of course, but it's same) ... and I ... was wondering ... would it take an older versions of game archives? (I think you guess already ) ... and ... it ... WORKS!! ... RPFv3 archives works just fine with Max Payne 3!! ... So you actually can extract original RPFv4 archives, modify anything, repack it to RPFv3 archive and put in instead original!! ... Enjoy MODDING your Max Payne 3!!

Discussions
Start A New Discussion
Replies
Viewed

- No Topic Found -
Approved by xmen | Jul 03, 2012 06:55:51

0 User(s) viewing this page

Designed & Developed by xmen ( W.K. )
Copyright © Mato Technologies 2009-24







GTA 4 Mod Installer  |   Google+   |  Facebook
Page generated in 0.0442262