Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Enumerator

Prop name for Hash

Recommended Posts

Enumerator

Does anyone know how to get the prop name for a hashkey? or is it not done that way? I'm trying to get a specific prop name in game however i can't find it on google. Can someone smart enough offer assistance?

 

I've tried casting the entity as a vehicle to get the friendlyname and displayname, no jimmy... huff..

Edited by Enumerator

Share this post


Link to post
Share on other sites
jedijosh920

GET_HASH_KEY

Share this post


Link to post
Share on other sites
Enumerator

GET_HASH_KEY

No no, People are getting litteral strings from hash keys or the model its self, I've only been here a week and a few days and i'm not caught up with everything just yet.

 

example

I have hash: -34839483970

Need to get the name of that model/prop/entity/object

Share this post


Link to post
Share on other sites
Prof_Farnsworth

 

GET_HASH_KEY

No no, People are getting litteral strings from hash keys or the model its self, I've only been here a week and a few days and i'm not caught up with everything just yet.

 

example

I have hash: -34839483970

Need to get the name of that model/prop/entity/object

 

Can I ask why you need the name if you have the hash already? Most objects can be controlled with just the hash. I only ask because I was trying the same and came to no conclusion.

Share this post


Link to post
Share on other sites
lulzmodder

I am currently working on it but it would be a really long process as there are 3284+ props and 306+ vehicles. At first I'll be completing vehicles, if possible.

Edited by lulzmodder

Share this post


Link to post
Share on other sites
sjaak327

There is no native that we know off that will retrieve the model name from a hash, you can only retrieve the hash key from a model name. Since you already have the hash key, you should be good to go.

Share this post


Link to post
Share on other sites
Enumerator

There is no native that we know off that will retrieve the model name from a hash, you can only retrieve the hash key from a model name. Since you already have the hash key, you should be good to go.

Jesus....

[Name from hash], I do not need the hash... just the prop name. People need to stop bumping this thread if they don't have an answer.

Edited by Enumerator

Share this post


Link to post
Share on other sites
InfamousSabre

Here's your answer: It is impossible.

 

You can generate a hash from a name, but not the other way around. The lists are created this way and allow you to look up the name using your hash.

You get the names from a list, or not at all.

Share this post


Link to post
Share on other sites
Enumerator

Here's your answer: It is impossible.

 

You can generate a hash from a name, but not the other way around. The lists are created this way and allow you to look up the name using your hash.

 

You get the names from a list, or not at all.

 

This information is terrible, Just because a hash list was made to sub-execute functions does not mean that gathering data like vehicle names are one-way. Just no one has found the correct hash yet. Please stop bumping this thread untill someone knows the answer.

Share this post


Link to post
Share on other sites
lulzmodder

@Enumerator: If you want something like:

 

Input: GET_HASH_NAME(-114291515)

Output: bati

 

Then I have something for you. By the way I am working on props, vehicles part is completed.

Share this post


Link to post
Share on other sites
Enumerator

@Enumerator: If you want something like:

 

Input: GET_HASH_NAME(-114291515)

Output: bati

 

Then I have something for you. By the way I am working on props, vehicles part is completed.

That's exactly what i'm looking for however, there is a function to get the name of a vehicle using its hash, but not the one which can return the prop name using its handle or hash.

I've tried casting the prop as a vehicle to return the props name but that does not work. I'm out of options till someone finds the propper native nash.

Add me to skype: GTAV.Enumerator

Edited by Enumerator

Share this post


Link to post
Share on other sites
lulzmodder

@Enumerator: The vehicle one is up at my GitHub -> lulzhash and in the same way I am going to do props/objects. Actually there are approx 3284 props which makes a huge list it will take huge time to code it as well.

Edited by lulzmodder

Share this post


Link to post
Share on other sites
Enumerator

@Enumerator: The vehicle one is up at my GitHub -> lulzhash and in the same way I am going to do props/objects. Actually there are approx 3284 props which makes a huge list it will take huge time to code it as well.

I already know how to get vehicle names from hashes

Dim veh As Vehicle = World.CreateVehicle(New Model(VehicleHash.Buzzard), Game.Player.Character.Position)Dim veh_name As String = veh.FriendlyName

The thing with prop names is that we don't want to scan a list for a hash to get its name in another list or the same list.

 

We need direct hash to name conversion using in-game mechanics. I'm sure it's very possible, We just need to wait for the hash to be discovered. Today i might go through some of the hashes that have no name and see if i can find it.

Edited by Enumerator

Share this post


Link to post
Share on other sites
lulzmodder

Well I don't know if a native of that purpose exists or not. But scanning 3200+ objects will be annoying. It's fine for vehicle as they are not in varieties. Good luck for your research.

Share this post


Link to post
Share on other sites
sjaak327

You seem to have a few issues. This is an open forum. I have followed all the guidelines that this forum mandates from me. Apparently you don't like the answer, but it's the only valid answer.

 

There is NO KNOWN native that will get the name of an object using the hash, period. And if you use your brains for just a few seconds, you might also understand why, there is no need, as the get_has_key native does everything that is needed, ie. convert a string to a hash.

 

Yes you can do it the other way, providing you write your own function and have all the names in a big array to match against using Jenkins. Good luck with that.

 

Again why in heaven's name do you need to object name in any case, apart from cosmetics, it is utterly useless. Objects models are requested and spawned using their hash, not their name, and that's why I doubt you will find it.

 

That such a thing exists for vehicles is logical, as it is used to display name + category in game, there is no need to do this for objects, so it is very unlikely R did include this function. As far as I know, they don't for peds either.

Edited by sjaak327

Share this post


Link to post
Share on other sites
InfamousSabre

 

Here's your answer: It is impossible.

 

You can generate a hash from a name, but not the other way around. The lists are created this way and allow you to look up the name using your hash.

 

You get the names from a list, or not at all.

This information is terrible, Just because a hash list was made to sub-execute functions does not mean that gathering data like vehicle names are one-way. Just no one has found the correct hash yet. Please stop bumping this thread untill someone knows the answer.

 

You don't have to like the answer. That's still THE answer.

 

The only way to do this in code is to have a list of hashes that corresponds to a list of strings (list, array, dictionary, vector, etc)

 

(pseudo-code inbound)

array style:

names[0] = bati;hashes[0] = -114291515;

and a simple function to match them up

string GetNameFromHash(int hash){    int i = Array.FindIndex(hashes, item => item == hash);    return names[i];}

but no matter how you do it, you still have to have a pre-written list of them. You CANNOT generate a name from a hash.

Edited by InfamousSabre

Share this post


Link to post
Share on other sites
Enumerator

 

 

Here's your answer: It is impossible.

 

You can generate a hash from a name, but not the other way around. The lists are created this way and allow you to look up the name using your hash.

 

You get the names from a list, or not at all.

This information is terrible, Just because a hash list was made to sub-execute functions does not mean that gathering data like vehicle names are one-way. Just no one has found the correct hash yet. Please stop bumping this thread untill someone knows the answer.

 

You don't have to like the answer. That's still THE answer.

 

The only way to do this in code is to have a list of hashes that corresponds to a list of strings (list, array, dictionary, vector, etc)

 

(pseudo-code inbound)

array style:

names[0] = bati;hashes[0] = -114291515;

and a simple function to match them up

string GetNameFromHash(int hash){    int i = Array.FindIndex(hashes, item => item == hash);    return names[i];}

but no matter how you do it, you still have to have a pre-written list of them. You CANNOT generate a name from a hash.

 

You can generate a name from a hash...

Dim v as string = world.createvehicle(Model(VehicleHash.Buzzard),pos).getfriendlyname

 

Oh the ignorance... These FUNCTIONS "world","createvehicle" obviously use hashes too... :lol:

Edited by Enumerator

Share this post


Link to post
Share on other sites
sjaak327

Of course you can, as long as you know all the strings, you can retrieve the string from the hash. And guess what they did that for vehicles, so they can display the friendly name from the model hash.

 

I doubt they went to the same trouble for objects, as there would not be no immediate need.

 

Fact is, without you knowing the string, there is no way to calculate the string from the hash, whilst it is trivial the other way around, you could easily write your own function instead of using the built in Get_hash_key native.

 

But hey, I am looking for strings for about 20.000 speeches, so if you ever find the function in game to retrieve the string from the hash, let me know.

Share this post


Link to post
Share on other sites
InfamousSabre

 

 

 

Here's your answer: It is impossible.

 

You can generate a hash from a name, but not the other way around. The lists are created this way and allow you to look up the name using your hash.

 

You get the names from a list, or not at all.

This information is terrible, Just because a hash list was made to sub-execute functions does not mean that gathering data like vehicle names are one-way. Just no one has found the correct hash yet. Please stop bumping this thread untill someone knows the answer.

 

You don't have to like the answer. That's still THE answer.

 

The only way to do this in code is to have a list of hashes that corresponds to a list of strings (list, array, dictionary, vector, etc)

 

(pseudo-code inbound)

array style:

 

names[0] = bati;hashes[0] = -114291515;
and a simple function to match them up

 

string GetNameFromHash(int hash){    int i = Array.FindIndex(hashes, item => item == hash);    return names[i];}
but no matter how you do it, you still have to have a pre-written list of them. You CANNOT generate a name from a hash.

 

You can generate a name from a hash...

Dim v as string = world.createvehicle(Model(VehicleHash.Buzzard),pos).getfriendlyname

 

Oh the ignorance... These FUNCTIONS "world","createvehicle" obviously use hashes too... :lol:

 

Oh the ignorance... This METHOD only works on vehicles... :lol:

 

AND

Take a guess what it does internally. Heres a hint:

...no matter how you do it, you still have to have a pre-written list of them. You CANNOT generate a name from a hash.

 

Edited by InfamousSabre

Share this post


Link to post
Share on other sites
Enumerator

 

 

 

 

 

 

Here's your answer: It is impossible.

 

You can generate a hash from a name, but not the other way around. The lists are created this way and allow you to look up the name using your hash.

 

You get the names from a list, or not at all.

This information is terrible, Just because a hash list was made to sub-execute functions does not mean that gathering data like vehicle names are one-way. Just no one has found the correct hash yet. Please stop bumping this thread untill someone knows the answer.

 

You don't have to like the answer. That's still THE answer.

 

The only way to do this in code is to have a list of hashes that corresponds to a list of strings (list, array, dictionary, vector, etc)

 

(pseudo-code inbound)

array style:

 

names[0] = bati;hashes[0] = -114291515;
and a simple function to match them up

 

string GetNameFromHash(int hash){    int i = Array.FindIndex(hashes, item => item == hash);    return names[i];}
but no matter how you do it, you still have to have a pre-written list of them. You CANNOT generate a name from a hash.

 

You can generate a name from a hash...

Dim v as string = world.createvehicle(Model(VehicleHash.Buzzard),pos).getfriendlyname

 

Oh the ignorance... These FUNCTIONS "world","createvehicle" obviously use hashes too... :lol:

 

Oh the ignorance... This METHOD only works on vehicles... :lol:

 

AND

Take a guess what it does internally. Heres a hint:

...no matter how you do it, you still have to have a pre-written list of them. You CANNOT generate a name from a hash.

 

 

 

sigh.. I guess if it's the only way by having a precompiled list then i guess we need to support lulzmotter on his quest..

Share this post


Link to post
Share on other sites
sjaak327

Yes, and that is pretty trivial, you just need to collect all the object names from the files, then write a small function to retrieve the hash key for each of them and put them in an array for future lookup.

 

That is exactly how I did it for IV trainer, where I had a list of 18.0000 or so objects obtained via the IDE files and their hashes, if you have such an array, you can easily match hash with name or vice versa.

 

By the way, that list of 3300 props being discussed is probably just the tip of the iceberg. In any case, the hash you talked about wasn't on there, so you might want to change the hash to positive and see if it matches that way.

 

something like const unsigned int hash = static_cast < unsigned int > ( model); where model = the hash you asked about, this should get you a "positive" hash, and maybe that way you will find a match.

 

 

const unsigned int hash = static_cast < unsigned int > (-34839483970);	char h[100];	sprintf_s(h, "%u", hash);	printf_s(h);
returns 3815221694 Edited by sjaak327

Share this post


Link to post
Share on other sites
lulzmodder

@sjaak327 I have the whole vehicle and prop array ready. But the problem I am facing is, searching a specific data through huge chunk of data. Sometimes the result is in weird characters, specially if the hash 's position is near the end of the array, else a proper result is obtained.

 

 

EDIT: Problem solved, and the result is fast enough. You can browse the code here. hng

Edited by lulzmodder

Share this post


Link to post
Share on other sites
sjaak327

^ Making sure you iterate through it correctly will prevent that :)

 

I do have an object list of around 1800 objects somewhere that is different from the prop list of 3200 items, in case you want it.

 

I personally believe there must be thousands and thousands more, but finding them will require tedious browsing using openIV.

Share this post


Link to post
Share on other sites
lulzmodder

@sjaak327 are those 1800 objects landmasses?

Share this post


Link to post
Share on other sites
sjaak327

not that I'm aware off, it seems to be a mix of stuff, many of them don't spawn at all, object spawning is a problem in this game, due to certain RPF's only loading when you are in a certain area.

Share this post


Link to post
Share on other sites
Enumerator

@sjaak327 I have the whole vehicle and prop array ready. But the problem I am facing is, searching a specific data through huge chunk of data. Sometimes the result is in weird characters, specially if the hash 's position is near the end of the array, else a proper result is obtained.

 

 

EDIT: Problem solved, and the result is fast enough. You can browse the code here. hng

you're using this to itterate the list

for (int i = 0; i < 3300; i++)

Instead of putting 3300 there, you should set it as the size of the list instead as this will prevent errors

Share this post


Link to post
Share on other sites
lulzmodder

 

@sjaak327 I have the whole vehicle and prop array ready. But the problem I am facing is, searching a specific data through huge chunk of data. Sometimes the result is in weird characters, specially if the hash 's position is near the end of the array, else a proper result is obtained.

 

 

EDIT: Problem solved, and the result is fast enough. You can browse the code here. hng

you're using this to itterate the list

for (int i = 0; i < 3300; i++)

Instead of putting 3300 there, you should set it as the size of the list instead as this will prevent errors

 

The code is fine if you are not checking it backwards.

Share this post


Link to post
Share on other sites
sjaak327

No, enumerator is right, you iterate that list from 0 to the size of the array and not an item more. In this case it will not lead to a problem, but if you do stuff like iterating through a list to display items on a menu for instance, the minute you reach the last item, it will try and display the next item, and if you are unlucky that will lead to an exception.

Edited by sjaak327

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


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