Jump to content

[V] Modifying PC GXT2 files w/ GXT2Tools


SonofUgly

Recommended Posts

Update: It's easier to use XBLToothPik's Editor (or Stanper's modified version of it).

I've made a short video on how to use them to create a .gxt2 file:

 

 

 

The tutorial below is still useful if you're editing large .gxt2 files, though.

 

 

For this you will need:

*OpenIV

*GXT2Tools (mirror)

*A hex editor (I'll be using Hex Workshop)

 

Now the important part here is that GXT2Tools only works for the PS3/360 version of .gxt2 files. The PC .gxt2 files are slightly different in that some of the information is byte flipped, so we have to unflip the bytes so the files will work in GXT2Tools.

Here is how the gxt2 files work:

 

dhmG4ME.png

Everything but the light blue 'Descriptions' in the image is what's going to need reversed. I'll refer to this image in the future.

 

 

Step #1

First up, use OpenIV to extract the .gxt2 language files, they'll be under x64/data/lang/ in an rpf file. The main .gxt2 file is Grand Theft Auto V\update\update.rpf\x64\data\lang\american_rel.rpf\global.gxt2 (replace 'american' with whatever language you're working with).

 

 

Step #2

Now open the .gxt2 file in your hex editor and select everything but the Descriptions (should note that the Descriptions start 4 bytes after the second "2TXG" header):

 

An easy way to do this with large files is to click on the byte before the description starts, and at the bottom it'll tell you what byte that is.

For example you can see I'm on byte 0000091F here:

 

0LSN4Dn.png

Make note of that byte and then click on the very first byte (00000000), then select by block in your hex editor (in Hex Workshop it's Edit → Select Block) and input the byte you noted down:

 

oUf6Y8q.png

Make sure you're selecting by Hex and it's going to the Ending Position.

 

After you select the necessary block of data, you need to byte flip it (in Hex Workshop this is Tools → Operations → Byte Flip...). You need to treat data as 32 bit, and make sure you're only applying this to the selection, not the entire file. Then save the file.

 

fNbZZjP.png

 

Step #3

Now you have a file that GXT2Tools will accept. In GXT2Tools load your .gxt2 file with File → Load GXT2, and once it's done loading (the main global.gxt2 may take a second to load) go File → Export TXT.

This will create an easily editable .txt file that you can change with any text editor. Just make sure you keep the format the same (the hash, then a tab, then the description).

 

After you're done editing the .txt file, open it in GXT2Tools with File → Import TXT (make sure GXT2Tools is empty before doing this, either open/close the program or hit File → New GXT2).

Save that as a .gxt2 file with File → Save GXT2.

 

 

Step #4

Now all you have to do is repeat Step #2, and then import it back into the .rpf file with OpenIV.

 

 

 

Adding new entries

For this I'm going to assume you have an editable .txt file (Step #3 above), and know what you're hash names are that you're adding.

 

If you want to add a completely new entry to a .gxt2 file you need to create a hash out of whatever name/entry you're adding to the game. OpenIV has a nice hash generator that you can use, Tools → Hash Generator.

Just drop the name/list into the Input section, make sure you're on Hex, and hit Generate.

 

1NXdUGv.png

You can add that hash directly to your .txt file (minus the 0x bit). Edited by SonofUgly
Link to comment
Share on other sites

where can you change the name of a weapon name that is listed in the GUI of Ammunation when previewing a weapon selected before purchase?

Link to comment
Share on other sites

where can you change the name of a weapon name that is listed in the GUI of Ammunation when previewing a weapon selected before purchase?

That's in global.gxt2.
Link to comment
Share on other sites

its throwing an error when exporting from gxt2 tools " blah blah is not a valid integer"

BxEmW4r.png

also what is a byte? one value or character? and it seems to be the first part of the txt when exporting back to gxt2 .it would also help to show how many values after 2txg you are suppose to select

 

also in hex editor is there any presets that could mess up the export or save after reversing 32bit?

i have it set to

 

offsets in hex

and little Endian in byte order

 

after messing with it for hours. i give up but i did find that everytime i try to import txt then save it works but if i alter the text it throws that not valid integer. and then no matter what if i just open the gtx2 in gtx2 tools it changes some letters and values in the header, hashes, or entries to different than it was before opening in gtx2 the first time...

Edited by DrGta
Link to comment
Share on other sites

XBLToothPik

Made a small tool for editing GTAV GXT2 Files on PC, specifically for PC with no conversions needed. Tool is in C# and source code is provided.

 

* Note: Tool requires .NET Framework 4.5 to run

* Note: The tool is not PERFECT!, so please don't hate. I created it in less than 20 minutes.

 

Tool Download: Mega Link Here

 

Tool Virus Scan: Virus Total Link Here

 

Tool Source: Mega Source Code Here

 

Double click an item to edit it

Right click anywhere on the list to add an item

Right click on an item to remove it.

 

1bcb8633b3.png

Edited by XBLToothPik
Link to comment
Share on other sites

UPDATE AGAIN. removed all special carbine and replaced with various names. no luck changing this name in ammunition though..

any idea?

IyN6Nk7.png

Link to comment
Share on other sites

Made a small tool for editing GTAV GXT2 Files on PC, specifically for PC with no conversions needed. Tool is in C# and source code is provided.

Nice. Once you make a release thread for it I guess mods can go ahead and lock this thread.

Also good to see more open source modding tools get released :^:

 

 

UPDATE AGAIN. removed all special carbine and replaced with various names. no luck changing this name in ammunition though..

any idea?

It's a DLC weapon so you'll need to edit the global.gxt2 in the DLCpack. For mpbusiness it's Grand Theft Auto V\x64w.rpf\dlcpacks\mpbusiness\dlc.rpf\x64\data\lang\americandlc.rpf\global.gxt2
Link to comment
Share on other sites

 

Made a small tool for editing GTAV GXT2 Files on PC, specifically for PC with no conversions needed. Tool is in C# and source code is provided.

Nice. Once you make a release thread for it I guess mods can go ahead and lock this thread.

Also good to see more open source modding tools get released :^:

 

UPDATE AGAIN. removed all special carbine and replaced with various names. no luck changing this name in ammunition though..

any idea?

It's a DLC weapon so you'll need to edit the global.gxt2 in the DLCpack. For mpbusiness it's Grand Theft Auto V\x64w.rpf\dlcpacks\mpbusiness\dlc.rpf\x64\data\lang\americandlc.rpf\global.gxt2

 

believe me i have edited i searched in hex edit for the "special carbine" and nothing comes up...

Link to comment
Share on other sites

believe me i have edited i searched in hex edit for the "special carbine" and nothing comes up...

There's also some entries for it in the main global.gxt2 file, Grand Theft Auto V\update\update.rpf\x64\data\lang\american_rel.rpf\global.gxt2. Did you edit that as well?
Link to comment
Share on other sites

 

believe me i have edited i searched in hex edit for the "special carbine" and nothing comes up...

There's also some entries for it in the main global.gxt2 file, Grand Theft Auto V\update\update.rpf\x64\data\lang\american_rel.rpf\global.gxt2. Did you edit that as well?

 

it is now fixed yet im still awaiting how to put a weapon in the new dlc slots like this one below the Hatchet. on very right?

99ehThs.jpg

Link to comment
Share on other sites

StateofMind15

Made a small tool for editing GTAV GXT2 Files on PC, specifically for PC with no conversions needed. Tool is in C# and source code is provided.

 

* Note: Tool requires .NET Framework 4.5 to run

* Note: The tool is not PERFECT!, so please don't hate. I created it in less than 20 minutes.

 

Tool Download: Mega Link Here

 

Tool Virus Scan: Virus Total Link Here

 

Tool Source: Mega Source Code Here

 

Double click an item to edit it

Right click anywhere on the list to add an item

Right click on an item to remove it.

 

1bcb8633b3.png

 

Are you going to be updating this? It's a great tool so far. I think it just needs a Search function.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Hello guys.

 

Thanks for this gtreat software, but I made small modifications,

 

I a bit change design and add hotkeys

next I add functions for searching, export/import from/to CSV

 

for import you must create a new file and it will enabled import button.

 

Image

gtx2.png

 

Download

https://mega.nz/#!AwtiHSaJ!Jqe19fAa4z_3ylz6y0etzwSpbxeUzv96ADbR5wak2Mo

Edited by Stanper
  • Like 1
Link to comment
Share on other sites

Great tool! Is there any chance you add cyrillic encoding? :)

P.S. Some ideas for future releases:

  • CTRL + Z Undo action;
  • Centering the Search window (not being in the upper left side);
  • Implementing the ~a~, ~s~, ~b~ etc into the editing window box (Instead of ~r~WASTED could be just WASTED);
  • ~BLIP_INFO_ICON~ (and similar) could be replaced with their corresponding icons;
  • And the Item Name values with text... So the lines could be sorted like subtitles.

I guess there is going to be much research on the last two, but just thought I could throw in some ideas.

I know this tool is in its early stage and I have so much respect for you. And I'm really thankful for that as a translator and ex-modder (if that's a thing).

 

Another useful feature could be having three columns - Item Name, Item Text and Translated Text. In the last column the user can see his translation of the Item Text, while the text under Item Text is the original one. After saving the file though, the text under Translated Text is now under Item Text as being a new original instance. Hope I made it sound logical.

 

Cheers!

Edited by hristobg
Link to comment
Share on other sites

Hey wondering if you could help me out here. I am trying to add new vehicle to the game via the dlc pack I have manageg to get around 10 new vehicles installed and fully working ranging from helis planes supers and police cars. no ofcourse I have so real world cars like the aventador I want to change the game name and brand from...

 

Grotti, Vacca, Sports

 

to...

 

Lamborghini, Aventador, Sports

 

Now in the vehicles.meta file we can change this such as

 

<gameName>VACCA</gameName>

<gameMakeName>GROTTI</gameMakeName>

 

in order to change it to this...

 

<gameName>AVENT</gameName>

<gameMakeName>LAMBO</gameMakeName>

 

I need to add a global.gxt2 file to the dlc.

 

so within the file itself we need to add...

 

LAMBO Lamborghini

AVENT Aventador

 

Now this is where I get stuck as when I do this and then view the file in openiv it looks like this

 

0x85D84G Lamborghini

0x5D844A Aventador

 

(not actual hex just example)

 

I have tried just putting in the hash/hex but that still doesn't work yet if we look at the games original global.gxt2 file

it have things like

 

BUCK Buckingham

VAPID Vapid

0x548F48S SOME RAMDOM SUBTITLE LINES

 

And I can't figure it out what so ever.

 

I feel like there is a another file I need to edit which contains code such as

 

0x557D444A SLAMVAN

0X44D76G4 VAPID

 

This file in theory if it exists tells the game what these numbers and letters in the global.gxt2 actually mean.

 

PLEASE HELP

Link to comment
Share on other sites

WildBrick142

 

Hey wondering if you could help me out here. I am trying to add new vehicle to the game via the dlc pack I have manageg to get around 10 new vehicles installed and fully working ranging from helis planes supers and police cars. no ofcourse I have so real world cars like the aventador I want to change the game name and brand from...

 

Grotti, Vacca, Sports

 

to...

 

Lamborghini, Aventador, Sports

 

Now in the vehicles.meta file we can change this such as

 

<gameName>VACCA</gameName>

<gameMakeName>GROTTI</gameMakeName>

 

in order to change it to this...

 

<gameName>AVENT</gameName>

<gameMakeName>LAMBO</gameMakeName>

 

I need to add a global.gxt2 file to the dlc.

 

so within the file itself we need to add...

 

LAMBO Lamborghini

AVENT Aventador

 

Now this is where I get stuck as when I do this and then view the file in openiv it looks like this

 

0x85D84G Lamborghini

0x5D844A Aventador

 

(not actual hex just example)

 

I have tried just putting in the hash/hex but that still doesn't work yet if we look at the games original global.gxt2 file

it have things like

 

BUCK Buckingham

VAPID Vapid

0x548F48S SOME RAMDOM SUBTITLE LINES

 

And I can't figure it out what so ever.

 

I feel like there is a another file I need to edit which contains code such as

 

0x557D444A SLAMVAN

0X44D76G4 VAPID

 

This file in theory if it exists tells the game what these numbers and letters in the global.gxt2 actually mean.

 

PLEASE HELP

 

The hex numers is a Jenkins hashed name of the string. It's another way the game can read/request stuff. Modders that have more knowledge can say more about it.

 

You have to go to "C://Users/username/AppData/Local/New Technology Studio/Apps/OpenIV/Games/Five/strings" and edit a file called "GxtKeys.txt" and add "AVENT" (or any other new string names you added) at the end so instead of displaying "0x9C108375" it will display "AVENT" in OpenIV. Doesn't matter if you do it all caps or all lowercase, it will display anyway.

 

I wouldn't worry about making the value readable as long as you know for sure it's correct.

Link to comment
Share on other sites

I have stil problems, i dont know what to do :/:(. Where i make a mistake :/

Do you have dlctext.meta in your DLCPack? And in it, does hasGlobalTextFile = true?
Link to comment
Share on other sites

UHDFreddyEST

 

 

You're missing:

 

<Item>dlc_caraddon:/common/data/dlctext.meta</Item>
In CARADDON_AUTOGEN in content.xml

 

i don't understund, :/

 

http://i.imgur.com/h3DgBun.png

 

do you mean that, i must add that <Item>dlc_caraddon:/common/data/dlctext.meta</Item> to the left side where is blucolored box ? http://i.imgur.com/anzhPft.png

Edited by UHDFreddyEST
Link to comment
Share on other sites

Hello guys, Can you tell me, if there is any problem with my modified application? :) thanks

Edited by Stanper
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.