Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Displaying messages from language files


mockba.the.borg
 Share

Recommended Posts

mockba.the.borg

Hi there all,

 

I am writing a garage mod, but instead of using my own text messages, I want to use the ones from the game (hash based), so they would appear on the correct languages to people from different countries.

I have found may useful messages inside the american_rel.rpf file, on the global.gxt2 file inside it.

However, those messages do seem to be relate to a hash (also present there), which I don't know how to access from inside the code.

Does anyone have experience using the game's text messages? This would be very useful for people writing mods, as it would allow automated language specific menus.

I know I would be stuck with whatever messages the game has, but this is basically all I need for my mods.

 

For example: 0xBCECF0C2 = This vehicle is too hot to modify. Purchase high-end vehicles online.

I have searched this hash inside the decompiled scripts and couldn't find it.

 

Maybe someone could share some ideas, or maybe examples of usage inside the scripts.

I am already researching on it, but if someone already knows it would save me the time.

 

Thanks,

The Borg.

Link to comment
Share on other sites

Hi there all,

 

I am writing a garage mod, but instead of using my own text messages, I want to use the ones from the game (hash based), so they would appear on the correct languages to people from different countries.

I have found may useful messages inside the american_rel.rpf file, on the global.gxt2 file inside it.

However, those messages do seem to be relate to a hash (also present there), which I don't know how to access from inside the code.

Does anyone have experience using the game's text messages? This would be very useful for people writing mods, as it would allow automated language specific menus.

I know I would be stuck with whatever messages the game has, but this is basically all I need for my mods.

 

For example: 0xBCECF0C2 = This vehicle is too hot to modify. Purchase high-end vehicles online.

I have searched this hash inside the decompiled scripts and couldn't find it.

 

Maybe someone could share some ideas, or maybe examples of usage inside the scripts.

I am already researching on it, but if someone already knows it would save me the time.

 

Thanks,

The Borg.

 

Share the code you have so far and then I can help you, because accessing hashes is normally easy

Link to comment
Share on other sites

mockba.the.borg

Hi Kryo4lex,

 

I don't have any code yet. I have found the library which contains the message files: american_rel.rpf (in my case), and inside this file there's global.gxt2, which contains the text messages and their hashes.

However, I have searched on the decompiled scripts for an example of usage of those hashes and couldn't find it.

So I am asking if someone has had the experience or printing such messages before.

 

Thanks,

Mockba the Borg

Link to comment
Share on other sites

jedijosh920

Use this:

void DISPLAY_HELP_TEXT_THIS_FRAME(char *message, BOOL p1) // 960C9FF8F616E41C 18E3360A

Where the message is the name of the string in american_rel.rpf

  • Like 2
Link to comment
Share on other sites

qiangqiang101

Game.GetGXTEntry("ROOSEVELT2") result: Roosevelt Valor

Link to comment
Share on other sites

Hi,

known GXT labels are not the problem :)

Example:

//...EMSTR_683 = Automated Response – Wild Amateur Picschar* _GET_LABEL_TEXT(char* labelName) // 0x7B5280EBA9840C72

But what if the label is unknown (like mockba.the.borg's example)!?

0x00371714 = Daddy's Little Girl

We need s.t. like this GTA IV native:

char* GET_STRING_FROM_HASH_KEY(Hash hashKey)
Link to comment
Share on other sites

mockba.the.borg

Hi Skopro,

 

Yeah, that's exactly my problem. I am also researching the messages there to try and find out which script calls them, for example:

 

0xBCECF0C2 = This vehicle is too hot to modify. Purchase high-end vehicles online.

 

I can't find which script displays this message. Maybe it is not being displayed with its hash, but a name that would then turn into this hash. So far I couldn't find it.

I believe there must be a native somewhere that would receive this hash as a parameter, still searching.

 

Cheers,

Mockba.

Link to comment
Share on other sites

Hi,

 

I was bored to browse through the scripts every time to find the right label for unknown hash-sums...

Maybe there is a native for this or maybe not...

Anyway! I made a small tool today that extracts the strings (incl. calculated hash-sums) out of C4 mission files, so it's easier now to find unknown hash-sums.

It's NOT a perfect solution for this problem but it works :)

 

DOWNLOAD

 

With this tool I found the requested hash 0xBCECF0C2 (= "CMOD_FTRIG3" in carmod_shop.c4) within a minute :)

 

PS: I coded this prog today afternoon, so it's very simple and without any extras (no double sort out, no nothing). I haven't time for more ;)

 

 

  • Like 2
Link to comment
Share on other sites

mockba.the.borg

Cool man ... awesome!!!

I will download it once I am back from work and give it a spin.

 

Thanks a lot for spending time on this. I will definitely replay that on any collaboration I can provide (as I learn and discover more)

 

Cheers,

Mockba.

Link to comment
Share on other sites

mockba.the.borg

Hi Skopro,

 

The app worked nicely and helped me a lot.

Thank you so much.

 

I can consider this one solved.

 

Cheers,

Mockba.

Link to comment
Share on other sites

  • 1 month later...
uNiverselEgacy

Hi,

 

I was bored to browse through the scripts every time to find the right label for unknown hash-sums...

Maybe there is a native for this or maybe not...

Anyway! I made a small tool today that extracts the strings (incl. calculated hash-sums) out of C4 mission files, so it's easier now to find unknown hash-sums.

It's NOT a perfect solution for this problem but it works :)

 

DOWNLOAD

 

With this tool I found the requested hash 0xBCECF0C2 (= "CMOD_FTRIG3" in carmod_shop.c4) within a minute :)

 

PS: I coded this prog today afternoon, so it's very simple and without any extras (no double sort out, no nothing). I haven't time for more ;)

 

 

 

This is great! However I can't seem to use it to find labels for weapons and some other stuff. nvm.

Thank you so much! Do you mind sharing the algorithm used by the game to compute hash values?

Edited by uNiverselEgacy
Link to comment
Share on other sites

Do you mind sharing the algorithm used by the game to compute hash values?

It's Bob Jenkin's "One-At-A-Time" hash:

static int OneAtATimeHash(string key){    int hash, i;    for (hash = i = 0; i < key.Length; i++)    {        hash += char.ToLower(key[i]);        hash += (hash << 10);        hash ^= (hash >> 6);    }    hash += (hash << 3);    hash ^= (hash >> 11);    hash += (hash << 15);    return hash;}
Edited by Fireboyd78
Link to comment
Share on other sites

unknown modder

Hi,

 

I was bored to browse through the scripts every time to find the right label for unknown hash-sums...

Maybe there is a native for this or maybe not...

Anyway! I made a small tool today that extracts the strings (incl. calculated hash-sums) out of C4 mission files, so it's easier now to find unknown hash-sums.

It's NOT a perfect solution for this problem but it works :)

 

DOWNLOAD

 

With this tool I found the requested hash 0xBCECF0C2 (= "CMOD_FTRIG3" in carmod_shop.c4) within a minute :)

 

PS: I coded this prog today afternoon, so it's very simple and without any extras (no double sort out, no nothing). I haven't time for more ;)

Kind of wish i saw this when I build mine, though mine was designed to find all gxt hashes that open iv hasnt defined but appear in scripts

Link to comment
Share on other sites

  • 5 months later...

 

Hi,

known GXT labels are not the problem :)

Example:

//...EMSTR_683 = Automated Response – Wild Amateur Picschar* _GET_LABEL_TEXT(char* labelName) // 0x7B5280EBA9840C72

But what if the label is unknown (like mockba.the.borg's example)!?

0x00371714 = Daddy's Little Girl

We need s.t. like this GTA IV native:

char* GET_STRING_FROM_HASH_KEY(Hash hashKey)

You can create your own:

auto funcAddress = Pattern::Scan("48 89 5C 24 08 48 89 6C 24 18 89 54 24 10 56 57 41 56 48 83 EC 20");typedef LPSTR(__fastcall *GetLabelTextByHashFunc_t)(__int64 address, unsigned int hash);GetLabelTextByHashFunc_t GetLabelTextByHashFunc = (GetLabelTextByHashFunc_t)funcAddress;auto patternAddress = Pattern::Scan("84 C0 74 34 48 8D 0D ?? ?? ?? ?? 48 8B D3");auto address = patternAddress + *(int *)(patternAddress + 7) + 11;inline LPSTR GetLabelTextByHash(unsigned int labelHash){    return GetLabelTextByHashFunc(address, labelHash);}
  • Like 2
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
 Share

  • 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.