CREATE YOUR AI CUM SLUT ON CANDY.AI TRY FOR FREE
x

Ren'Py Want to learn Ren'py modding

Meushi

Well-Known Member
Aug 4, 2017
1,146
12,752
toChangeMi MUST have as key the whole dialog line, character for character, and in the default language of the game.
Just to reiterate what Anne said... toChangeMi is for whole dialogue lines... word for word... letter for letter... They need to be exact matches for the whole line, including any text tags like [b] or [i].
Thanks for straightening me out, I figured it would be something simple. It's even in the original post I quoted:
Firstly, there is a list of whole lines of dialogue to replaced.
I didn't grasp that literally meant the entire line of dialog, thought we were talking whole arbitrary strings being swapped. Do'h!

Thanks to your help it's all working fine now.
You don't have permission to view the spoiler content. Log in or register now.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
11,009
16,295
Python:
    patchRegExMi = r'\b(?:archon|archon\'s|Zephyr|zephyr)\b'
    regExEquivalentMi = {
[...]
        "archon's": "Archon's",
[...]
        }
Hmm. It's to validate first (RegEx don't strictly works in the same way in all Language), but normally the "archon's" part isn't needed.
The \b represent anything that isn't a letter, while letters are generally A-Z, a-z and _. Therefore, r'\b(?:archon|Zephyr|zephyr)\b' should be enough to put an uppercase to each archon found in the dialogs.

This said, it being present will also not prevent the correction to happen when needed.
 

Meushi

Well-Known Member
Aug 4, 2017
1,146
12,752
Hmm. It's to validate first (RegEx don't strictly works in the same way in all Language), but normally the "archon's" part isn't needed.
The \b represent anything that isn't a letter, while letters are generally A-Z, a-z and _. Therefore, r'\b(?:archon|Zephyr|zephyr)\b' should be enough to put an uppercase to each archon found in the dialogs.

This said, it being present will also not prevent the correction to happen when needed.
Thanks, I wasn't sure how exactly [b] defined word boundaries so put both in.

But I've now tested it without "archon's" and the first replace does indeed fix both. (y)
 
  • Like
Reactions: anne O'nymous

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,611
2,260
Me, just passing by another thread where anne O'nymous and 79flavors are absolutely destroying newbs like me with wisdom and knowledge.
Trust me when I say I'm still very much a newb myself.

Except for the bits I already knew (because of similarities to much older programming languages), also everything I know about RenPy and Python these days is because anne O'nymous and Rich taught me as I went along while I was trying to "fix" someone else's code for my own amusement.