name change mod for ren'py

Artiour

Member
Sep 24, 2017
301
1,267
So I used to have this small file to rename characters but lost it when I reinstalled the system
it was basically a mod that I downloaded and edited it for each game separately
it looked something like:
Python:
init python:

label blabla:#not sure if its a label or not
    some_code("original_name", "madeup_name")
    # probably 2 or 3 other lines of code and thats it
I tried to look for change name mods but I find them with a lot of files (hard renaming thru-out all the scripts), whilst in the one I had you only change one name and the mod do all the hard work for you with just one file with few lines
edit:
I was just writing this when I remembred the game I got the mod from, it was Gordon
I thought why dont I share the file here:
Code:
init 1090 python:

    def replace_text(t1):
        t1 = t1.replace("original_name", "madeup_name")
        t1 = t1.replace("original_name2", "madeup_name2")

        return t1
    config.replace_text = replace_text
you just make a .rpy file of this and put whatever names you like and put it in the game folder
sorry if this was repetitive or if its in the wrong forum after I kinda answered myself
 
Last edited:

Turning Tricks

Rendering Fantasies
Game Developer
Apr 9, 2022
1,342
2,497
So I used to have this small file to rename characters but lost it when I reinstalled the system
it was basically a mod that I downloaded and edited it for each game separately
it looked something like:
Python:
init python:

label blabla:#not sure if its a label or not
    some_code("original_name", "madeup_name")
    # probably 2 or 3 other lines of code and thats it
I tried to look for change name mods but I find them with a lot of files (hard renaming thru-out all the scripts), whilst in the one I had you only change one name and the mod do all the hard work for you with just one file with few lines
edit:
I was just writing this when I remembred the game I got the mod from, it was Gordon
I thought why dont I share the file here:
Code:
init 1090 python:

    def replace_text(t1):
        t1 = t1.replace("original_name", "madeup_name")
        t1 = t1.replace("original_name2", "madeup_name2")

        return t1
    config.replace_text = replace_text
you just make a .rpy file of this and put whatever names you like and put it in the game folder
sorry if this was repetitive or if its in the wrong forum after I kinda answered myself

I'm just curious why would you need to use this function if you defined the characters at the beginning of your script? Then you would just have to change the character objects themselves and all dialogue would reflect that. Unless you had names that were just plain text in the dialogue?

Looking at this function in the Renpy docs, it seems like it's more designed to replace special characters in text with something else, like unicode characters. Possibly to avoid formatting and script errors maybe?

Python:
def replace_text(s):
    s = s.replace("'", u'\u2019') # apostrophe
    s = s.replace('--', u'\u2014') # em dash
    s = s.replace('...', u'\u2026') # ellipsis
    return s
config.replace_text = replace_text
One thing that's interesting, is this function not only processes all dialogue text, but user interface text as well.
 

Artiour

Member
Sep 24, 2017
301
1,267
its useful for names that weren't meant to be changed, and a good thing is it doesn't change calls for pictures if those are named after characters, so you wont need to rename images in the images folder