Mod Ren'Py Onhold Universal Choice Descriptor [2024-01-24] [ZLZK]

5.00 star(s) 3 Votes

simple_human

Newbie
Dec 2, 2018
70
2,344
t = t.replace("This is my husband's brother. He's renting a room from me.","He is my [son]."
Are you aware that you are applying this to every dialogue text?
I know. You probably didn't see the whole patch:), I only gave you some of the code to make it easier to find what I changed.

t = t.replace("This is my husband's brother. He's renting a room from me.","He is my [son]."
You can just do if str(who) in (str(gg), "Donald"):
No, it doesn't work.

If you want to filter translations as well you need a wrapper for renpy.translation.StringTranslator.translate
I did that for my mod, because I don't know if there is any other way.

Probably something like this:
Python:
init python hide:

    translate = renpy.translation.StringTranslator.translate

    def hijack(self, s):
        return translate(self, s).replace("Mary", "Mom")
     
    renpy.translation.StringTranslator.translate = hijack
that helped, thanks!


in case you're interested, patch for a game called MILF's Plaza.
 

ZLZK

Member
Modder
Jul 2, 2017
274
568
Python:
    def english(self, s):
        return translate(self, s).replace("As soon as Mary and Christy leave the house", "As soon as Mom and Christy leave the house")
        return translate(self, s).replace("Mary, where are you?!", "Mom, where are you?!")
Dude, you first want compact then you don't.
Python:
    def english(self, s):
        return translate(self, s).replace("As soon as Mary and Christy leave the house", "As soon as Mom and Christy leave the house").replace("Mary, where are you?!", "Mom, where are you?!")
or
Python:
    def english(self, s):
        s = translate(self, s)
        s = s.replace("As soon as Mary and Christy leave the house", "As soon as Mom and Christy leave the house")
        s = s.replace("Mary, where are you?!", "Mom, where are you?!")
        return s
Why multiple node = current_node()?
Just do all in if isinstance(node, Say):

Also instead of multiple replace you can do some regex to replace once.
Like this:
Python:
                t = t.replace("Nicolas","[dad]")
                t = t.replace("Nicholas","[dad]")
                t = t.replace("Nicola","[dad]")
to: r"Nich?olas?" pattern and then re.sub or something.

I know. You probably didn't see the whole patch:), I only gave you some of the code to make it easier to find what I changed.
That is even more horrible.
If you are changing only one specific line, my advice find another way.

Probably something like this:
Python:
translate lang_name strings:
     old "This is my husband's brother. He's renting a room from me."
     new "He is my [son]."
 

ZLZK

Member
Modder
Jul 2, 2017
274
568
have this problem with V. [2023-11-19]
Seems like usual way of getting files doesn't work on linux.

Try below:

1. Replace in file: "game/_mods/ZLZK/scripts/_script.rpy"
config_filepath = os.path.join(RPY_config.gamedir, "%s/config.py" % inst.path).replace("\\", "/")
to
config_filepath = "%s/config.py" % inst.path
But it didn't work before.

or

2. Replace in file: "game/_mods/ZLZK/scripts/adjustments.rpy"
with renpy.notl_file(file) as f:
to
with renpy.file(file) as f:

or both

If above doesn't work you can ignore config files.

Replace in file: "game/_mods/ZLZK/scripts/_script.rpy"
IGNORE = False
to
IGNORE = True

If you are ignoring config files do images work?
I mean try clicking right click in right top corner after loading save.
 

Flojo23

Member
Feb 27, 2020
192
72
Seems like usual way of getting files doesn't work on linux.

Try below:

1. Replace in file: "game/_mods/ZLZK/scripts/_script.rpy"
config_filepath = os.path.join(RPY_config.gamedir, "%s/config.py" % inst.path).replace("\\", "/")
to
config_filepath = "%s/config.py" % inst.path
But it didn't work before.

or

2. Replace in file: "game/_mods/ZLZK/scripts/adjustments.rpy"
with renpy.notl_file(file) as f:
to
with renpy.file(file) as f:

or both

If above doesn't work you can ignore config files.

Replace in file: "game/_mods/ZLZK/scripts/_script.rpy"
IGNORE = False
to
IGNORE = True

If you are ignoring config files do images work?
I mean try clicking right click in right top corner after loading save.
linux is love :love: >_>... ty gonna try later on, anyway almost all mods had problems with that game even URM
 

Flojo23

Member
Feb 27, 2020
192
72
Code:
$ /run/media/xxxxxxxxx/LoL/game/64/completos/Sovereign/Sovereign-6.0-pc-Compressed/Sovereign.sh

File "game/_mods/ZLZK/scripts/_script.rpy", line 89: unexpected indent
                config_filepath = "%s/config.py" % inst.path
                ^
    
$ /run/media/xxxxxxxxx/LoL/game/64/completos/Sovereign/Sovereign-6.0-pc-Compressed/Sovereign.sh

File "game/_mods/ZLZK/scripts/adjustments.rpy", line 84: unexpected indent
            with renpy.file(file) as f:
            ^
    
$ /run/media/xxxxxxxxx/LoL/game/64/completos/Sovereign/Sovereign-6.0-pc-Compressed/Sovereign.sh

File "game/_mods/ZLZK/scripts/_script.rpy", line 89: unexpected indent
                config_filepath = "%s/config.py" % inst.path
                ^
    

File "game/_mods/ZLZK/scripts/adjustments.rpy", line 84: unexpected indent
            with renpy.file(file) as f:
            ^
i just gonna keep using the update before this one .-.
 

tec_rose

New Member
May 8, 2023
13
1
Seems like usual way of getting files doesn't work on linux.

Try below:

1. Replace in file: "game/_mods/ZLZK/scripts/_script.rpy"
config_filepath = os.path.join(RPY_config.gamedir, "%s/config.py" % inst.path).replace("\\", "/")
to
config_filepath = "%s/config.py" % inst.path
But it didn't work before.

or

2. Replace in file: "game/_mods/ZLZK/scripts/adjustments.rpy"
with renpy.notl_file(file) as f:
to
with renpy.file(file) as f:

or both

If above doesn't work you can ignore config files.

Replace in file: "game/_mods/ZLZK/scripts/_script.rpy"
IGNORE = False
to
IGNORE = True

If you are ignoring config files do images work?
I mean try clicking right click in right top corner after loading save.
Thanks for this. I changed the mentioned variables then edited the "config.py" file in the ZLZK folder changing IGNORE = False to IGNORE = True and now the mod is working partially well (it shows values on choices and the like but I haven't seen the tooltip) on Joiplay.

Edit: Oops... it seems to depend on the game whether this method ends up working or not. GGGB works with it but other games I've tried like ORS and Our Life: Beginning and Always doesn't unfortunately (shows the error that Flojo got). College Craze lets me access the game but it doesn't show the values when it gets to the choices
 
Last edited:

Saramago

Member
Sep 23, 2017
231
413
I absolutely love UCD, thank you for your work sir :)

However I'd like to ask you if you could add a toggle, or a scroll bar, or maybe something similar to the spoiler button I'm using below, to avoid situations like this:

You don't have permission to view the spoiler content. Log in or register now.

Doesn't happen often but when it does, I have to close the game and delete the ZLZK folder just to see all the options.
 

ZLZK

Member
Modder
Jul 2, 2017
274
568
I absolutely love UCD, thank you for your work sir :)

However I'd like to ask you if you could add a toggle, or a scroll bar, or maybe something similar to the spoiler button I'm using below, to avoid situations like this:

You don't have permission to view the spoiler content. Log in or register now.

Doesn't happen often but when it does, I have to close the game and delete the ZLZK folder just to see all the options.
My mod doesn't control choice screen.
I have no idea how to handle it.
I need code suggestions not utility.
I can cut excessive flags or all of them.
But I still don't have code idea nor utility idea.
I will figure something out later.
 
5.00 star(s) 3 Votes