GXT

From GTAModding
Jump to: navigation, search
40px-Ambox rewrite orange.svg.png This article may need to be rewritten.
Please help improve this article. The discussion page may contain suggestions.

A GTA Text (GXT) file contains almost all texts that are displayed on the screen of GTA2 and above. The location of those files may differ between the various game versions, but they are usualy located in a text\ folder inside the games installation directory. Except for GTA 2 There is one GXT file for each language, but the number of gxt files does not define the number of supported languages by the game.

File Format

Each GXT file contains certain tables with entries. And each entry has a unique CRC identifier and a normal text.

GTA San Andreas / GTA IV Format

Header

The header contains information about the GXT version.

INT32   - 4b   - Version (0x080004 for ASCII, 0x100004 for UTF-16)

Table Block

The Table Block contains data about the subtables and their offsets.

CHAR[4] - 4b   - TABL
INT32   - 4b   - Blocksize

//Array of [Blocksize / 12 Entries]
CHAR[8] - 8b   - Subtablename
INT32   - 4b   - Offset

The Offset of the subtable points to an 8-byte Char Array with the subtable's name, followed by TKEY. For the MAIN Table this points directly to TKEY!

GTA San Andreas has a limit of max 200 tables to be stored GXT file.

TKEY and TDAT

TKEY

The TKEY Block of an subtable contains the CRC32-values of the entrytitles. The game calculates the CRC32-value out of a given string and checks if they exist in the GXT.

CHAR[4] - 4b   - TKEY
INT32   - 4b   - Blocksize

//Array of [Blocksize / 8]
INT32   - 4b   - Entryoffset
INT32   - 4b   - CRC32 (Entryname)

The TKEY block is directly followed by the TDAT Block which contains the contents of the entries. The Entryoffset is relative to the TDAT + 8 offset.

TDAT
CHAR[4] - 4b   - TDAT
INT32   - 4b   - Blocksize

From here the entryoffset of each entry points to the content. The content can have different sizes. However it always ends in '\0'! For Example "Hello!" needs to be transformed to "Hello!\0" here and this gives a size of 6 bytes (To tell it in a short form content is a null-terminated string). If this is the 1st content in TDAT the next got an offset of 0x06!

Encodings
GTA SA          : Windows-1252 always.
GTA IV(8 bits)  : Custom Encoding
GTA IV(16 bits) : Well, its a fake 16 bits encoding, all you need to take care about first 8 bits(1 byte). 
                  Eg. A3F4 C2DD E922, read only A3, C2, E9.


Sorting

The sorting method for TABL, TKEY, TDAT is as follow:

Section Sorting method
TABL Sorted in alphabetical order
TKEY GTA SA: Sorted from the lowest crc32 to the highest crc32,

GTA IV: Unknown. Perhaps randomized order.

TDAT Not sorted. The data is stored from the first line to the last line in the GXT source file

GTA III / GTA Vice City Format

GTA Vice City GXT is almost like San Andreas GXT, but differs in

  • There's no header
  • In TKEY, the keys are stored in a char[8] array instead of a crc32 hash

GTA III GXT is like GTA Vice City GXT, but there's no table, the GXT starts immediately at TKEY block.

Table Block (Vice City only)

The Table Block contains data about the subtables and their offsets.

CHAR[4] - 4b   - TABL
INT32   - 4b   - Blocksize

//Array of [Blocksize / 12 Entries]
CHAR[8] - 8b   - Subtablename
INT32   - 4b   - Offset

The Offset of the subtable points to an 8-byte Char Array with the subtable's name, followed by TKEY. For the MAIN Table this points directly to TKEY!


TKEY and TDAT

TKEY
CHAR[4] - 4b   - TKEY
INT32   - 4b   - Blocksize

//Array of [Blocksize / 12]
INT32   - 4b   - Entryoffset
CHAR[8] - 8b   - Entryname

Unlike San Andreas entrynames are stored directly in 8b chararrays here. This means to calculate the entries in the table you have to divide the blocksize through 12. The Entryoffsets are relative to the end of the "TDAT Header". This means you have to add the entryoffset to the stream position after the TDAT size. (TDAT_Offset + 8 + Entryoffset), to get to the entry.

TDAT
CHAR[4] - 4b   - TDAT
INT32   - 4b   - Blocksize

The TDAT-Block contains the strings which are displayed by the game. But here are some differences towards San Andreas. The strings are encoded in unicode, which means that each character takes the space of 2 characters (which means 2 bytes per character). Mostly the last byte is 0x00.

Sorting

The sorting method is like the San Andreas method, just changing the TKEY sorting method.

Section Sorting method
TABL Sorted in alphabetical order
TKEY Sorted in alphabetical order
TDAT Not sorted. The data is stored from the first line to the last line in the GXT source file


GTA2 Format

Except for additional header at beginning GTA2 GXT files are identical to GTA3 format.

The first 4 bytes can be one of following, and identify the language for the file: GBLE - english GBLF - french GBLG - german GBLI - italian GBLS - spanish GBLJ - japanese

A uint16 file version follows which is always 100 (decimal)

Text is stored with some specialities, characters are 16 bit while only one of these bytes is actual character the other may store special data such as gang message icon id, etc.. the text is zero-terminated.

The rest of file is same as gta3 with familiar tkey & tdat sections.

GTA 1 Format

GTA 1 language files have .fxt extension, and it's different from other games' format. Except the first 8 byte it uses very simple encryption. To get text, just substract 1 from every byte. First 8 bytes have different encryption, probably just to confuse modders. For every byte substract a value returned from left shifting 99.

GXT Editing

Symbols & Colorcodes (Control Character)

Symbol Description
GTA III Vice City San Andreas
~1~ number within a text
~a~ text within a text
~A~ L3 icon (PS2) / LStick icon (XBOX)
~b~ blue text blue text blue text
~c~ R3 icon (PS2) / RStick icon (XBOX)
~d~ ▼-icon
~g~ green text hot pink text green text
~h~ white text highlight
~j~ R1 icon (PS2) / RT icon (XBOX)
~k~ key (followed by keypresses)
~K~ L1 icon (PS2) / LT icon (XBOX)
~l~ black text forces text to default color
and ignores set colors
black text
~n~ newline
~m~ L2 icon (PS2) / WHITE icon (XBOX)
~o~ pink text Circle icon (PS2) / B icon (XBOX)
~p~ purple text purple text purple text
~q~ plum pink text Square icon (PS2) / X icon (XBOX)
~r~ red text hot pink text red text
~s~ reset color to standard
~t~ green text Triangle icon (PS2) / Y icon (XBOX)
~u~ ▲-icon
~v~ R2 icon (PS2) / BLACK icon (XBOX)
~w~ gray text gray text white text
~x~ light blue text Cross icon (PS2) / A icon (XBOX)
~y~ yellow text yellow text yellow text
~z~ subtitle (doesn't shown when
the Subtitles option is off)
~<~ ◄-icon
~>~ ►-icon
Special symbols (otherwise normal or blank)
" triangle icon
< ◄ icon armor icon
> ► icon wanted level (star) icon
@ trademark symbol (™)
^ inverted exclamation mark (¡)
_ degree symbol (°)
{ heart icon
| circle icon
} dollar sign icon (not "$")

Note that using "~" by itself will crash the game when the game attempts to display it.

Keypresses

You can use opcode 00E1 to check if these keys are being pressed.

Foot Controls

Key Game Entry
Fire GTA III Vice City San Andreas ~PED_FIREWEAPON~
Next Weapon / Target GTA III Vice City San Andreas ~PED_CYCLE_WEAPON_RIGHT~
Previous Weapon / Target GTA III Vice City San Andreas ~PED_CYCLE_WEAPON_LEFT~
Group Ctrl Foward San Andreas ~GROUP_CONTROL_FWD~
Group Ctrl Back San Andreas ~GROUP_CONTROL_BWD~
Conversation - No San Andreas ~CONVERSATION_NO~
Conversation - Yes San Andreas ~CONVERSATION_YES~
Foward GTA III Vice City San Andreas ~GO_FORWARD~
Backwards GTA III Vice City San Andreas ~GO_BACK~
Left GTA III Vice City San Andreas ~GO_LEFT~
Right GTA III Vice City San Andreas ~GO_RIGHT~
Zoom In GTA III Vice City San Andreas ~PED_SNIPER_ZOOM_IN~
Zoom Out GTA III Vice City San Andreas ~PED_SNIPER_ZOOM_OUT~
Enter+Exit GTA III Vice City San Andreas ~VEHICLE_ENTER_EXIT~
Change Camera GTA III Vice City San Andreas ~CAMERA_CHANGE_VIEW_ALL_SITUATIONS~
Jump GTA III Vice City San Andreas ~PED_JUMPING~
Sprint GTA III Vice City San Andreas ~PED_SPRINT~
Target / Aim Weapon GTA III Vice City San Andreas ~PED_LOCK_TARGET~
Crouch Vice City San Andreas ~PED_DUCK~
Action Vice City San Andreas ~PED_ANSWER_PHONE~
Walk San Andreas ~SNEAK_ABOUT~
Look Behind GTA III Vice City San Andreas ~PED_LOOKBEHIND~
Look Left GTA III Vice City[1] ~PED_1RST_PERSON_LOOK_LEFT~
Look Right GTA III Vice City[1] ~PED_1RST_PERSON_LOOK_RIGHT~
Look Up GTA III Vice City[1] ~PED_1RST_PERSON_LOOK_UP~
Look Down GTA III Vice City[1] ~PED_1RST_PERSON_LOOK_DOWN~
Next Target GTA III Vice City[1] ~PED_CYCLE_TARGET_LEFT~
Previous Target GTA III Vice City[1] ~PED_CYCLE_TARGET_RIGHT~
Center Camera GTA III Vice City[1] ~PED_CENTER_CAMERA_BEHIND_PLAYER~

Vehicle Controls

Key Game Entry
Fire GTA III Vice City San Andreas ~VEHICLE_FIREWEAPON~
Secondary Fire San Andreas ~VEHICLE_FIREWEAPON_ALT~
Accelerate GTA III Vice City San Andreas ~VEHICLE_ACCELERATE~
Brake / Reverse GTA III Vice City San Andreas ~VEHICLE_BRAKE~
Left GTA III Vice City San Andreas ~VEHICLE_STEERLEFT~
Right GTA III Vice City San Andreas ~VEHICLE_STEERRIGHT~
Steer Foward / Down GTA III Vice City San Andreas ~VEHICLE_STEERDOWN~
Steer Back / Up GTA III Vice City San Andreas ~VEHICLE_STEERUP~
Enter+Exit GTA III Vice City San Andreas ~VEHICLE_ENTER_EXIT~
Trip Skip San Andreas ~CONVERSATION_YES~
Change Radio Station GTA III Vice City ~VEHICLE_CHANGE_RADIO_STATION~
Next Radio Station San Andreas ~VEHICLE_RADIO_STATION_UP~
Previous Radio Station San Andreas ~VEHICLE_RADIO_STATION_DOWN~
User Track Skip San Andreas none
Horn GTA III Vice City San Andreas ~VEHICLE_HORN~
Sub-mission GTA III Vice City San Andreas ~TOGGLE_SUBMISSIONS~
Change Camera GTA III Vice City San Andreas ~CAMERA_CHANGE_VIEW_ALL_SITUATIONS~
Handbrake GTA III Vice City San Andreas ~VEHICLE_HANDBRAKE~
Mouse Look San Andreas ~VEHICLE_MOUSELOOK~
Look Left GTA III Vice City San Andreas ~VEHICLE_LOOKLEFT~
Look Right GTA III Vice City San Andreas ~VEHICLE_LOOKRIGHT~
Turret Left / Special Ctrl Left GTA III Vice City San Andreas ~VEHICLE_TURRETLEFT~
Turret Right / Special Ctrl Right GTA III Vice City San Andreas ~VEHICLE_TURRETRIGHT~
Turret Up / Special Ctrl Up GTA III Vice City San Andreas ~VEHICLE_TURRETUP~
Turret Down / Special Ctrl Down GTA III Vice City San Andreas ~VEHICLE_TURRETDOWN~
Look Behind GTA III Vice City San Andreas[2] ~VEHICLE_LOOKBEHIND~
1. ^ Classic controls key only
2. ^ Hardcoded key in III and VC, unavailable in SA

Unused

Here are some keypress codes only used during development stage. They were removed or replaced later but probably they are still working. Maybe this is useful for further research. Some are only used in PS2 Version.

~TAKE_SCREEN_SHOT~
~SWITCH_DEBUG_CAM_ON~
~TOGGLE_DPAD~
~NETWORK_TALK~

Tools

GTA 2
GTA2 GXT Editor v2.0 - by Delfi
GTA III Vice City San Andreas GTA LCS GTA VCS
Grand Theft Auto GXT Editor v1.3 - by Zverik, retrieved from archive.org
GTA III Vice City San Andreas GTA LCS GTA VCS GTA 4
SAGE v0.9.7 - by AleX AciD
GTA III Vice City GTA LCS GTA VCS
GTA Texter v0.93 - by feroCT5
GTA III
GTA Net GTAGarage: GXT Editor 1.3 - by Jevon
Vice City GTA LCS GTA VCS
GTA: Vice City GXT Editor v1.2 - by CyQ
San Andreas
GTA San Andreas Text Editor - by JernejL
San Andreas
GTA: San Andreas GXT Editor v1.3 - by Hammer83
San Andreas
A-GXT Editor v1.0a - by Aschratt
San Andreas GTA 4
X GXT Editor v2.1 - by xmen
GTA 4
OpenIV - Have Inbuilt GXT file viewer

External links

v · d · e
GTA 4 Grand Theft Auto IV
File Formats.dat.gxt.ide.img.ipl.nod.sco.rpf.rrr.wad.wbd/.wbn.wdd.wdr.wft.whm.wpl.wtd
DocumentationAudioBink VideoCryptographyCutscenesImage listingMap ListingNative functionsPathsScenariosSavesVTableWeapons
ToolsASI LoaderENBSeriesG-TextureGIMSIV NeedleOpenIVScoclSparkIVXLiveLessWPL ManagerX Mod Installer
AliceC++ Script Hook.NET Script Hook
TutorialsImporting Textures with OpenIVImporting Textures with SparkIV
MultiplayerFour MultiplayerIV MultiplayerIV:Online
ModificationsGTA 3 Rage ClassicGTA Vice City RageIV:SAGostown IV
Useful linksCommunity portalDiscussion forumsGTA IV Modding ForumMods on GTAGarage.com
v · d · e
San Andreas Grand Theft Auto: San Andreas
File Formats.col.cfg.cut.dff.dat.fxp.gxt.ide.ifp.img.iplnodes*.dat.rep.rrr.scm.set.txd
DocumentationAudioCryptographyCutscenesGame memoryHandling.cfgMap ListingMission PacksOpcodesPathsReplaysSavesScripts
ToolsCLEOCollision File Editor IIENBSeriesG-ToolsIMG ToolLimit AdjusterMap EditorSan Andreas Audio ToolkitSanny BuilderTXD Workshop
TutorialsSan Andreas v2.0 ModdingHow to create a missionHow to create a threadHow to use Map Editor
ModificationsDesign Your Own MissionGostown ParadiseGTA: UnitedMyriad Islands
MultiplayergtaTournamentMulti Theft AutoSan Andreas Multiplayer(more...)
Useful linksCommunity portalDiscussion forumsMods on GTAGarage.comOpcodes database
v · d · e
Vice City Grand Theft Auto: Vice City
File Formats.adf.col.cfg.dff.dat.gxt.ide.ifp.img/.dir.ipl.raw/.sdt.rep.scm.txd
DocumentationHandlingMap ListingOpcodesScript PathsSavesSound Effects
ToolsCLEOCollision File Editor IIG-ToolsGXT EditorIMG ToolLimit AdjusterKEd (map editor)Sanny Builder (script editor)TXD Workshop
TutorialsHow to create a missionHow to create a thread
ModificationsGTA: Liberty CityState of Liberty
MultiplayerGTA:LC MultiplayergtaTournamentMulti Theft AutoState Of Liberty OnlineVice City MultiplayerVice City OnlineMulti-Vice
Useful linksCommunity portalDiscussion forumsMods on GTAGarage.comModding VC Mobile versionOpcodes database