Forum Announcement, Click Here to Read More From EA_Cade.

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

sachaMagnesachaMagne Posts: 18 New Member
edited March 5 in Nominated Threads
hello Guru(s)
I made a package that contains an STBL and access it with that:
[CODE]
_minutes=lambda **_:sims4.localization._create_localized_string(0xD6B7C27C)
_mm=_minutes()
[/CODE]
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
Post edited by EA_Cade on

Comments

  • Options
    SimGuruModSquadSimGuruModSquad Posts: 597 Member
    Hey there. No python does not have access to the actual localized strings.
  • Options
    SimGuruEugiSimGuruEugi Posts: 503 SimGuru
    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.
  • Options
    DavidLibeauDavidLibeau Posts: 1 New Member
    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.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file
Return to top