• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

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

5.00 star(s) 3 Votes

robrize2169

Well-Known Member
Oct 8, 2022
1,467
3,045
i had issues with this new version too, so i just use the previous version and it works fine. i play on pc and got the errors first time i used the new version in the _mods folder.
 

ZLZK

Member
Modder
Jul 2, 2017
274
576
Apparently the errors only occur when playing through Joiplay, if you could test to see if this is the case it would be great.
I can not, but I suppose it can't find the file due to OS.
Test 1:
- edit '_mods/scritps/__namespace.rpy' file
- change IGNORE = False to IGNORE = True
If that resolves all issues than the fault is probably in notl_file function.
Test 2:
- edit '_mods/scritps/adjustments.rpy' file
- change renpy.notl_file to renpy.file or renpy.open_file

But it's odd, I mean how can it find images when it can't files?
 

ZLZK

Member
Modder
Jul 2, 2017
274
576
i had issues with this new version too, so i just use the previous version and it works fine. i play on pc and got the errors first time i used the new version in the _mods folder.
Was it one or more issues, and what those issues were?
 

robrize2169

Well-Known Member
Oct 8, 2022
1,467
3,045
Was it one or more issues, and what those issues were?
any of the game saves i tried to play would crash when a choice was due.removed the folder and tried again and everything was normal. also tried to put just the ZLZK folder itself in..game crashes on startup with this new update i tried. like i said, i used the previous update of the ZLZK folder that i had copied from a game i had played without issue before updating and it worked fine. so not sure what the issue is. sorry i deleted the traceback with the info. just giving a report on the issue i had.
 

ZLZK

Member
Modder
Jul 2, 2017
274
576
any of the game saves i tried to play would crash when a choice was due.removed the folder and tried again and everything was normal. also tried to put just the ZLZK folder itself in..game crashes on startup with this new update i tried. like i said, i used the previous update of the ZLZK folder that i had copied from a game i had played without issue before updating and it worked fine. so not sure what the issue is. sorry i deleted the traceback with the info. just giving a report on the issue i had.
New update has to be in exact location due to images, config files, and uninstall option.

Sounds like an error I could fix, but without traceback I have no lead.
Can you recreate error, or tell what OS you have, and what game you tried it with?
 

ZLZK

Member
Modder
Jul 2, 2017
274
576
You don't have permission to view the spoiler content. Log in or register now.
Not a bug, more like linux is trolling.

Edit '_mods/ZLZK/_mods/UCD/scripts/pillars.rpy' file:
below: _STATES = dict( (v, k.lower() ) for k, v in vars().items() )
add: raise Exception(str(_STATES))
For me output is: Exception: {0: 'idle', 1: 'busy'}
If it's not for you try changing vars() to locals()

Actually try this: raise Exception(str(vars()))
and this: raise Exception(str(locals()))
This will tell if the issue is in vars() or dict()
Output should be: Exception: {'IDLE': 0, 'BUSY': 1, '_STATES': {0: 'idle', 1: 'busy'}}


I meant python on linux, but it's bugged even on my windows.
New version of python breaks locals() in generator expressions.

To fix it, replace:
Python:
        _STATES = dict( (v, k.lower()) for k, v in vars().items() )
with:
Python:
        _STATES = vars()
        _STATES = dict( (v, k.lower()) for k, v in _STATES.items() )
 
Last edited:
  • Like
Reactions: Flojo23 and doujin1
Feb 7, 2022
173
107
Not a bug, more like linux is trolling.

Edit '_mods/ZLZK/_mods/UCD/scripts/pillars.rpy' file:
below: _STATES = dict( (v, k.lower() ) for k, v in vars().items() )
add: raise Exception(str(_STATES))
For me output is: Exception: {0: 'idle', 1: 'busy'}
If it's not for you try changing vars() to locals()


Actually try this: raise Exception(str(vars()))
and this: raise Exception(str(locals()))
This will tell if the issue is in vars() or dict()
This has also happened to me playing the fresh start version of Halloween on Joiplay
 

Flojo23

Member
Feb 27, 2020
192
72
Not a bug, more like linux is trolling.

Edit '_mods/ZLZK/_mods/UCD/scripts/pillars.rpy' file:
below: _STATES = dict( (v, k.lower() ) for k, v in vars().items() )
add: raise Exception(str(_STATES))
For me output is: Exception: {0: 'idle', 1: 'busy'}
If it's not for you try changing vars() to locals()

Actually try this: raise Exception(str(vars()))
and this: raise Exception(str(locals()))
This will tell if the issue is in vars() or dict()
Output should be: Exception: {'IDLE': 0, 'BUSY': 1, '_STATES': {0: 'idle', 1: 'busy'}}


I meant python on linux, but it's bugged even on my windows.
New version of python breaks locals() in generator expressions.

To fix it, replace:
Python:
        _STATES = dict( (v, k.lower()) for k, v in vars().items() )
with:
Python:
        _STATES = vars()
        _STATES = dict( (v, k.lower()) for k, v in _STATES.items() )
ty
 

wsg123

New Member
Mar 4, 2022
5
1
Hello, forgive this google translator, I don't understand English.
I have a problem with version 2023-10-29.
It seems to make an error in giving the MC name.
But when I changed to version 2023-04-07 it worked.
What's going on here?
 

ZLZK

Member
Modder
Jul 2, 2017
274
576
Hello, forgive this google translator, I don't understand English.
I have a problem with version 2023-10-29.
It seems to make an error in giving the MC name.
But when I changed to version 2023-04-07 it worked.
What's going on here?
It's a bug, above is solution.
 

ZLZK

Member
Modder
Jul 2, 2017
274
576
Hi!
I wanted to ask: I made a patch for the game The Veritate, but it doesn't work with your mod (vers 2023-10-29 also with 2023-04-07). Can you please give me a hint if there is anything I can do to make my patch compatible with yours?

[...]
Does it not? It works for me.
You shouldn't have to do anything, my mod should be the one to be compatible.
Seems like it doesn't work in newer python, I will look into it.


BTW, if you are using frame, you should have del frame as well, otherwise memory leaks may occur.

But I wouldn't use frame at all for script that works all the time.
I would do this:
You don't have permission to view the spoiler content. Log in or register now.

EDIT: Nevermind, it's your design fault.

I mean my mod adds its own text_filter, that is using yours text_filter,
which is making another frame, which your mod doesn't handle.

But above code works with my mod and URM.
 
Last edited:
  • Red Heart
Reactions: simple_human

ZLZK

Member
Modder
Jul 2, 2017
274
576
Oh, thank you very much! You're the best! [...]
My script had an error with extend, I have corrected it now.
I have also included function from my mod.

[...] more compact [...]
What for do you need it?
I made script that way for faster object lookups.
Also it's styled for better reading.
Pros: -faster lookup
Cons: -additional references

init python:
It should be with hide, otherwise you may override something or something might override your code.

Python:
        who = renpy.ast.eval_who(node.who) if isinstance(node, renpy.ast.Say) and node.who != "extend" else _last_say_who


        if who in [mC, lAn, ti]:
            t = t.replace("Alice", "Mom")
            t = t.replace("Lisa", "Aunt Lisa")
if who in [mC, lAn, ti]: should be in upper if.
Also, tuple is faster than list.

[...] (I'm not sure if I should add del replace_text)
Only needed if your script does lookups like mine with additional references.
It removes name reference from lookups. (Just the name not function itself.)
Since it's not needed anymore, and slow down lookups a tiny bit.

Without additional references:
You don't have permission to view the spoiler content. Log in or register now.
I'm not convinced it's better. It's just raw code.
 
Last edited:
  • Red Heart
Reactions: simple_human

ZLZK

Member
Modder
Jul 2, 2017
274
576
Crap.... I exactly need it, in one game there's a moment where mc mentions his mother in his phone, and thanks to this thing the replacement happens, without it no. It worked in the old version of my patch. Well, I need to think about how to solve this...
(I partially used this game as practice for the mod, I just want to make as universal and simple patch as possible so that there is one approximate core)
Without exact dialogue line I can't redesign.
You can use config.replace_text without config.say_menu_text_filter.
It's just that it's inefficient.

It's possible to add wrapper to renpy.text.text.Text.apply_custom_tags
to make it perform node lookup once instead for each text segment, but it would make it too complex.

Also I don't think it's good idea to use config.replace_text, and I think it doesn't exist in older ren'py.
 

ZLZK

Member
Modder
Jul 2, 2017
274
576
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 mean you check all dialogues to change 1 of them. Doesn't it seem like not the right way?

t = t.replace("Nicolas", "[dad]")
This doesn't seem right as well, just do t = t.replace("Nicolas", str(dad))

if who == "[gg]" or who == "Donald":
You can just do if str(who) in (str(gg), "Donald"):

[...] without config.replace_text, the following text is not replaced [...]
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
 
Last edited:
5.00 star(s) 3 Votes