Forum Discussion

SachaMagne's avatar
10 years ago

convert a string hash (stbl) into a string ? (guru?)

hello Guru(s)
I made a package that contains an STBL and access it with that:

_minutes=lambda **_:sims4.localization._create_localized_string(0xD6B7C27C)
_mm=_minutes()

Sadly _mm contains the requested hash instead of its content.

Is there a way to get the translated string into a python string ?

thanks
Sacha

3 Replies

Replies have been turned off for this discussion
  • SimGuruEugi's avatar
    SimGuruEugi
    Icon for EA Staff (Retired) rankEA Staff (Retired)
    10 years ago
    "SimGuruModSquad;13996399" wrote:
    Hey there. No python does not have access to the actual localized strings.


    In theory, there is no need for Python to access actual strings. In your case, if you want to display minutes, you can do:

    _minutes=lambda **_:sims4.localization._create_localized_string(0xD6B7C27C, minutes)

    where your string is

    0xD6B7C27C = "{0.Number} minutes left!"


    Hope that helps.
  • Hi, do you know how to generate these id 0xD6B7C27C from an object label? Like for instance I have this:
    action: 'cake_Grab'
    target: 'object_Food_PlateFork_FruitCake_Multi:0x05c90dcf043015d0'
    I want cake_Grab to become 0x811E69FB because it is shown "Take a Piece" and that's the ID of this string in the EN file.

    Sorry for replying to this old thread, but I can't create a new thread.

About The Sims 4 Mods & Custom Content

Find expert tips, troubleshooting help, tutorials for mods and custom content, and The Sims 4 patch files in our forum.15,685 PostsLatest Activity: 14 minutes ago