How to replicate the id generated by Ren'Py?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
vitaummm1
Newbie
Posts: 8
Joined: Wed Apr 19, 2023 3:28 pm
Location: Brazil
Discord: Vitor Eduardo#4432
Contact:

How to replicate the id generated by Ren'Py?

#1 Post by vitaummm1 »

Good morning!
Currently, the voice acting process we use involves creating the script for the visual novel, generating the .rpy files from this script, updating the dialogue.tab, and then using a script to extract all character lines into a spreadsheet, accompanied by the id (which is the title of the audio file that will be saved, to be used through auto voicing).
However, I need to modify this flow so that the dubbing takes place before we generate the .rpy files. Therefore, I need to be able to generate the same id that Ren'Py creates for each of the dialogues, so that when the .rpy files are generated, the already saved audios do not need to be renamed one by one. Does anyone have a suggestion on how I can do this? I looked in the Ren'Py SDK and couldn't find where these ids are generated and what process is done.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2420
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: How to replicate the id generated by Ren'Py?

#2 Post by Ocelot »

Long story short, it is generated from current label name, hash of line contents and potentially a number if ID collides with any other previous ID.

Relevant code is here:
https://github.com/renpy/renpy/blob/8f2 ... __.py#L297
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: No registered users