Ren'Py Newbie questions regarding the creation of an incest patch

Deleted member 1044747

Formerly 'decent'
Donor
Nov 27, 2018
335
1,551
Hello!

I've been playing / reading VN's - especially made with Ren'Py - for a while.
I also did several Mac ports of Ren'Py games - other than that I'm almost completely ignorant of Ren'Py, especially coding.

Recently I stumbled upon a game that was originally intended with an incest background, but changed due to Patreon policy.
Neither the developer of the game nor anyone else has made an incest patch until now.

With that said, I'd like to create one (for now I'd rather not tell for which game).
Don't get me wrong: I'm not obsessed with incest - I like any adult game with a good story, but if a game is or was intended to be incest themed, I prefer to play it that way.

First I thought about editing the game's script.rpy file, but then changed my mind to work on a patch.rpy file as that seems to make it easier to work on future game updates and to "deinstall" the incest content if needed.

As a basis I used an incest patch file made for Kindred: The Redburns by Bossapplesauce (I think his name changed to bas).
I already started the project and can see some progress - however I (naturally) already stumbled upon some problems, which I hope someone can help me with.

1. I already figured out how to replace text ("original text" : "altered text"), but somehow some of my alterations get ignored and the original text still shows up.
Any idea why? I checked the code and it seems exactly like the one used in the other cases...

2. How do I delete text altogether with a patch?
I try to stay as close to the original script, but need to remove some redundant explanations from the introductory story why the MC moved to family x.

3. How do I replace character names that show up upon the text box (for example "Susi" -> " mom")?
In the script.rpy file I found this code: define x = Character("Susi") - is this the code I need to alter? How?

4. I'm still undecided if I should write "mom" capitalised or not. Thoughts?

Maybe wurg is still around - we once had a nice conversation regarding Ren'Py coding, but really any help by anyone is appreciated.
 
Last edited:

wurg

Active Member
Modder
Apr 19, 2018
705
1,655
While I'm still kind of a noob with Ren'py I get most of what I learn by looking at others code. I would suggest looking at the incest patch for Freeloading Family that I think Bossapplesauce wrote. I still takes me a bit to decipher as I am not an expert in Python by any stretch.

The hardchanged I think you have figured out, the text you are going to replace has to be exactly like it is in the game, spaces and everything, otherwise it won't replace it. The most important line is in "def aliceName ( text ):" in that patch, it is the line that begins with return. This is what replaces the line in the game with the one you have changed, without this nothing in the game will change. The first part substitutes what you have typed in hardchanged, the second part will return the individual lines of text you have defined in "def innerChange".

Just follow normal grammar rules when capitalizing, I can't remember them exactly, but if I remember right you capitalize when you can substitute "Mom" with her name. otherwise lowercase. ex: "Mom let's go to the store" - "My mom is over there" or "This is my mom Janet"

As far as the textbox, you can redefine the character in this file: define x = Character("Mom"). The only issue is when she is talking to someone other than the family it will still appear this way. If that isn't an issue, don't worry about it.

If you name the patch 'zzpatch.rpy' it will be the last one the game loads up, they load in alphabetical order, so any changes you make to the files that load before this one will overwrite those variables or characters because they are loaded last.

The most important thing is to not try and do all of it at once, do a couple of lines of dialog change in 'hardchanged', get that to work, then work on changing the other things you want. Take small bites at a time, this is how I learn, and it is a lot less frustrating. One piece at a time. Once you sort out how that one piece works, it is just rinse and repeat after that, and it is a lot easier to find where you are making a mistake than if you have 10 pages of code you have typed.

It will take some time, but in the end it will be less frustrating and you will understand how it works better.

Also take a look at the patch for Kindread Redburns, it is along the same lines but has slightly different code. It is the one I learned from, and you can never have to many examples of how the code works.

If I got something wrong, please someone correct me, but this is what I remember off of the top of my head.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,611
2,258
There are lots of options, most of which have been discussed a fair amount here on the forums.

Firstly, your question about Mom/mom, Sister/sister... it was something I didn't know myself until I started messing around with patching games in this way. Basically, if someone is using "mom" instead of the mom's name, then it should be "Mom"... capitalized the same way the character's name would be. If however if someone is using "mom" as a description of who that person is, then it stays as "mom"... lower case.
"Hi Mom!" - Capitalized because you're using "mom" instead of her name "Lucy".
"Yeah, Sam's mom is hot!" - Not capitalized because "Yeah, Sam's Lucy is hot!" doesn't really work.

Meanwhile, back to your incest patch solutions...

One is to create a second language version of the game, translating everything from "English" to "Uncensored". It's an option at least.
It's been suggested as a solution... but I'm not sure I've ever seen it done.

Another is to create a patch routine that scans each bit of dialogue before it is displayed on screen and swap certain words/phrases for other words/phrases. It's not for the faint of heart, and requires that the sentence structure of the underlying game be pretty consistent in how words are used throughout the game.
Love Thy Neighbor's patch works like this.
Though I'm trying to remember another game that does it with slightly less complicated code. I'll update here if I think of it.

Another variation on this, is to forget matching words at all and just list all the bits of dialogue you want to swap out and what it's replacement looks like.
Summertime Saga's patch does it this way. It's like a mini translation.

Another option is to have a variable that is checked anywhere you'd have Mom/Landlady, Sister/Roommate type dialogue. Depending on what that variable says, you get one of the other. When you ship your game, that variable is set to "off" (usually as a boolean variable with a value of False). Then you can add an optional file that isn't shipped with your game that sets that variable to "on" (True). Usually this is delivered using different "init python" levels, where both init python code blocks are run, but the level number makes sure one is run before the other. ("censored" first, patched after that).
Estate: Dominate does it this way. As do lots of other games.

A word of caution: There's a variation on this "if patched" type check that checks to see if a file exists within in the RenPy game folder to see how the variable should be checked. It's fine most of the time... but if you (or someone else) ports your game to Android... the filenames are changed - and so the check fails.

Another way is for all the various "Mom", "Sister", "Aunt" type descriptions to all be held as variable too. Have their original values be "Landlady", "Roommate", "Neighbor", etc and then use one of the solutions above to swap the values back. My only reservation is that it makes for some very silly sentences if you're not careful. Also character motivations matter if you're telling a story and just swapping "Sister" for "Roommate" doesn't really work when you end up with something like "We can't do that! You're my roommate!".

Another warning: Some people will suggest that if you do this... you can let the player type in the relationship between characters. It rarely works out well if you do that. You stop proof reading properly and all sorts of stupid sentences fall through the gap.

Love Thy Neighbor's patch also features another method that can work, which is to use config.label.overrides to force the game to swap the name of a label in the game to another label. The "new" label is within the patch file, and does some other logic instead of the way the game originally worked. It's not great for swapping individual lines of dialogue... but can still prove very useful.

By far the simplest solution is to do what Estate: Dominate and many other games do and just have both variations within the game already and pick which sentences/lines to display based on a flag. It means you have to double up every time you might use Mom or Sis or something, but you have much more control of how individual sentences read.

You can mix in the "mom/sister/aunt/landlady/roommate/neighbor" variables too to reduce the amount of duplicated dialogue lines... but honestly, I think just duplicating the lines is easier.
 

Deleted member 1044747

Formerly 'decent'
Donor
Nov 27, 2018
335
1,551
Thank you for your replies.

Even though I have a hard time to understand everything you guys are writing about, some input was still helpful.

Until now I have been replacing each dialogue by hand - and most of the times it works (still haven't figured out why in some cases it won't), but as there's already a massive amount of content (= text) I'm afraid this approach will take ages.
Since most of the text I'm replacing is related to the character of the mother (for siblings I think it's more usual to call each other by name) I was thinking about some sort of auto-replacement, but as you already mentioned - this method is prone to failure, as it can easily inflict code or dialogue by other characters and mess things up.
So, I guess I have to do it all by hand.
Not sure if I'm up for such a colossal task, but at least it's pure routine even a newbie like me can do.

Thanks for your objection in regards of changing the text box name of the mother - you're right that this could easily lead to nonsensical situations when the MC isn't involved.
For now I think I simply leave the mother's name as her text box name.

Also thanks for your input regarding capitalisation - very helpful!

Now I still have three major problems:

1. I don't understand a lot of code.
Take for example the "header" and "footer" I borrowed from Bossapplesauce's incest patch:
You don't have permission to view the spoiler content. Log in or register now.
I tried to delete parts of it as a lot of it is related to a different game and doesn't seem to make sense, but as soon as I do, my patch will stop working.

2. I still haven't figured out why in some cases my replacement incest text gets ignored.
I checked time and again for correct spelling, spaces, etc. - I'm clueless.
Maybe someone is willing to take a look (pm) why some of these text replacements won't work?

3. Last but not least: I still don't know how to delete text.
So far I helped myself with a workaround:

"original text" : " "

That way there's no text displayed, but there's still a blank text box which requires a mouse click to advance.
How do I get rid of redundant text altogether?

Well, it seems like 90% of this project is about diligence, but the rest requires knowledge about coding.
Maybe I should team up with someone who is more knowledgable than me in that regard...
 
Last edited:

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,611
2,258
I forgot an option... which is pretty bad, since it's the only option I've actually used myself to date.

Since you're talking about patching someone else's game, you can just edit their game files and publish those updated files as a "patch".

The way RenPy works is that there is a hierarchy of which files are used when the game starts.
Short version is that it'll use the latest files.

The starting point to any RenPy game is the *.rpy files. They are the source. Those are "compiled" into *.rpyc files.
A lot of games will go further and put all the game files into a RenPy archive (*.rpa files).
You can use UnRen to unpack .rpyc and .rpa files in order to go backwards until you have the .rpy source files. You can edit those.

If you have an script.rpy file within an .rpa archive AND a script.rpy file (with a newer date/time) in the /game/ folder... it'll use the script.rpy file from the game folder to create an updated script.rpyc file - and that will override the one in the RenPy archive. Same goes for any of the game's source files.

So you use UnRen to get to the *.rpy files. Then edit those source files. When you've finished and got your updated version of the game working how you want it... then use something like , or to bundle all your updated .rpy files into a ZIP/RAR/7z archive that be downloaded by players who are told to unpack the updated files into their game folder.
 

wurg

Active Member
Modder
Apr 19, 2018
705
1,655
Take a look at this small language fix I made for the game Two Weeks, this was my first foray into making one of those patches. I used one of Bossapplesauces patches for reference. I had problems making it work also until I followed the format that was in the original, I'm sure you can make it work without:
You don't have permission to view the spoiler content. Log in or register now.

But, I don't know exactly how, I've tried different variations and can't get it to work without the game throwing an error. so I added the 'def' parts. You should be able to put your code from "hardChanged" in this file and place it in the game to make sure it works. You don't need to change anything in the second part, just leave it as it is. It is looking for 'lydia' in the dialog, and if it finds it will replace it with 'lydia test', I changed this from the original so it won't throw an error on the game you are working on.

This will give you the core to start your patch with and you can go from there, get the 'hardchanged' working, then try the other stuff, one thing at a time.

Edit: If you are trying to delete text from the game, I tried a couple of different ways to do it in 'hardChanged' and couldn't get it to work without throwing an error. So I believe the only way to do it is they way you are without going into the original files and manually deleting it and including them with the patch you are making, which if you are going to do that you might as well just change the lines in the files. There may be a way to delete it all together, but I don't know how.
 
Last edited:

Deleted member 1044747

Formerly 'decent'
Donor
Nov 27, 2018
335
1,551
Thanks again for your input!

Frustrated with above-named obstacles regarding the patch.rpy approach I simply started to edit the original script.rpy file.
This lets me easily alter, add or remove text, change text box names and auto-replace names with an editor - all without any knowledge in coding.

I'm tempted to simply go with the user-friendliness of the script.rpy method, but I still prefer the use of a patch.rpy file because it works with future content releases while a script.rpy file needs to be remade with every new game version.
Also, a patch.rpy file can easily be applied and removed while a script.rpy file will physically overwrite original code.

Okay, to give you an example of my issues with the code...

Original code (green = "good" code, yellow = to be edited, red = to be removed)

"Yeah, that’s me, [player_name]."
"I finished high school last year."
"To everyone’s amazement (mine included) I got into college."

"But a storm cloud threatened to rain on my success…."
"The College that offered me a place was in another town. "
"And that town was in another state!"
"Fortunately the 'storm cloud' had a silver lining....."
"....a super-close friend of my Mom and Dad lives in that town."
"When I was a kid, Joanne and her family were our next door neighbours."
"Well, they moved interstate about ten years ago, and Joanne and my Mom kept in touch."

"Thank goodness!"
"So, guess where I live now…. {w} Yep, with Joanne...and her two daughters."
"Rent free, so long as I help out… and behave myself. "
"Not totally impossible? {w} Hmmmm, let's see how things go."
"And it gets better......"
"First, I found a part-time job at the local café, so I can make a bit of spending money."

"And second...Joanne and her daughters are hot....no I mean {i}really{/i} hot!!"
"Here, I'll show you….."

scene nm jo 01

"Here is my lovely landlady. Her name is Joanne but she insists I just call her Jo."

scene nm jo 02
with dissolve1
"If I die tomorrow I want to be reincarnated as that shirt!"

"Jo had kids while she was still young, and she works at keeping her incredible figure. Oh man, the fantasies I have about those tits!"

scene nm jo 01
with dissolve1

"Jo is great. She works in the city all day but still makes us dinner every night with smiles and love. "
"She says her “family time” has become extra special since her husband died a few years back."


Here's my patch.rpy code (red = I don't know how to remove this text code properly):

# Naughty Magic Incest Patch by Casual Voyeur

init python:
hardChanged = {
"But a storm cloud threatened to rain on my success….":" ",
"The College that offered me a place was in another town. ":"Fortunately I was accepted at a college in my hometown.",
"And that town was in another state!":"The college isn't far from where me and my family used to live so I didn't have to look for a place to stay.",
"Fortunately the 'storm cloud' had a silver lining.....":" ",
"....a super-close friend of my Mom and Dad lives in that town.":" ",
"When I was a kid, Joanne and her family were our next door neighbours.":" ",
"Well, they moved interstate about ten years ago, and Joanne and my Mom kept in touch.":" ",

"So, guess where I live now…. {w} Yep, with Joanne...and her two daughters.":"So, guess where I still live…. {w} Yep, with Mom...and my two sisters.",
"And second...Joanne and her daughters are hot....no I mean {i}really{/i} hot!!":"And second...Mom and my sisters are hot....no I mean {i}really{/i} hot!!",
"Here is my lovely landlady. Her name is Joanne but she insists I just call her Jo.":"Here is my mom. Her name is Joanne but everyone just calls her Jo.",
"Jo had kids while she was still young, and she works at keeping her incredible figure. Oh man, the fantasies I have about those tits!":"Mom had us while she was still young, and she works at keeping her incredible figure. Oh man, the fantasies I have about those tits!",
"Jo is great. She works in the city all day but still makes us dinner every night with smiles and love. ":"Mom is great. She works in the city all day but still makes us dinner every night with smiles and love.",
"She says her “family time” has become extra special since her husband died a few years back.":"She says her “family time” has become extra special since dad passed away a few years back.",
}

def NaughtyMagic (text):
def change (m):
if m.group(0) == "Jo": return "Mom"
return hardChanged[text] if text in hardChanged else renpy.re.sub( r'()', change, text)

config.say_menu_text_filter = NaughtyMagic

This is how the scene gets displayed ingame (green = "good" code, yellow = wrong code, red = blank text box):

Yeah, that’s me, [player_name].
I finished high school last year.
To everyone’s amazement (mine included) I got into college.

<Blank text box>
Fortunately I was accepted at a college in my hometown.
The college isn't far from where me and my family used to live so I didn't have to look for a place to stay.

<Blank text box>
<Blank text box>
<Blank text box>
<Blank text box>

Thank goodness!
So, guess where I still live…. {w} Yep, with Mom...and my two sisters.
Rent free, so long as I help out… and behave myself.
Not totally impossible? {w} Hmmmm, let's see how things go.
And it gets better......
First, I found a part-time job at the local café, so I can make a bit of spending money.
And second...Mom and my sisters are hot....no I mean {i}really{/i} hot!!
Here, I'll show you…..
Here is my mom. Her name is Joanne but everyone just calls her Jo.
If I die tomorrow I want to be reincarnated as that shirt!

Jo had kids while she was still young, and she works at keeping her incredible figure. Oh man, the fantasies I have about those tits!
Jo is great. She works in the city all day but still makes us dinner every night with smiles and love.

She says her “family time” has become extra special since dad passed away a few years back.

1. As you can see, in some cases the original code gets displayed instead of the edited one.
2. I would also like to know how to get rid of the blank text boxes (redundant text).
3. The name replacement code (display "Jo" as "Mom") for the rest of the game isn't working at all.
4. I could easily edit the displayed text box name in the script.rpy file
define j = Character("Jo") -> define j = Character("Mom")
But how do I do that in a patch.rpy file?
 
Last edited:

wurg

Active Member
Modder
Apr 19, 2018
705
1,655
For changing Jo to 'Mom' you should try this:
return hardChanged[text] if text in hardChanged else renpy.re.sub( r'(?:Jo)', change, text)
This is following the template in the Freeloading Family patch, I'm not completely sure how it works, but my guess is it is looking for 'Jo' and when it finds it will replace it with what the 'return' value is.

As far as removing lines, the hardChanged part is for editing a line here and there, if there is a label with a lot of dialog you have to edit or remove, the best idea would be like it's done in the FF patch, create by example.

config.label_overrides = {"start" : "start_icpatch", "school_15" : "school_15_p", "ahq" : "ahq_p"}
This line of code says 'when the game calls the label on the left of the colon, substitute the label on the right of the colon for it'.
So, best solution when there is a lot to change or delete in a label like you are trying to do is to copy the whole label in the patch, rename it like above ( add '_p" or something like that to it ), add the original and substitute to the config.label_overrides line, then edit, delete, or whatever you want to do in the label itself.

If some of the lines in hardChanged are working and some aren't, there is some spacing or other errors with the lines in hardChanged, it is not random, the lines have to be exactly like they appear in the game code for it to work, if the are off by one space, comma, of just one capital letter, no substitution will take place.

For #4 you should be able to just redefine j in the patch file without an issue, when making a patch, best practice is to leave the original code alone as much as possible, best case is to not touch it at all. If you mess something up in the original code and it breaks the game, now you have to hunt down the error and try to fix it before the game is usable again. If something goes wrong in the patch file, you or the user just has to remove that file for the game to work again. And, as long as the original code is intact, you will always have the original for reference to make changes.

Remember. Ren'py loads the files in alphabetical order, so if you name your file z_patch.rpy and redifine j in it, it will be the last instance of that character loaded and will overwrite the original.

I know it's frustrating when you are not familiar with it, but, I can't emphasize enough to do one thing at a time, get one working the way you want, then go to the next piece you want to change. This will limit your errors to one thing at a time, and you will have errors, everyone does. Coding is not a fast process, especially if you are not familiar with the language, it takes me time also, Ren'Py and Python are not languages I have ever learned in a classroom, all my knowledge is self taught ( with help from others when I couldn't figure it out ) tinkering and looking at how other people have done it and figuring out how they did it, one piece at a time.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,976
16,231
1. As you can see in some cases the original code gets displayed instead of the edited one.
The only possible reason is that you didn't used the exact same text as key for hardChanged. It should be exactly the same thing, so no uppercase when there's a lower one, no "'" when it's a "`" or an UTF "'", and so on.


2. I would also like to know how to get rid of the blank text boxes (redundant text).
Isn't it said in the thread pointed out by 79flavors , that you can't ? I haven't looked at his link, but I'm pretty sure to know which one it was ; he should have used the most complete one, involving among others, Rich, him and me.
There's possibility to do it, but it need that you edit the code directly into Ren'py's memory, which isn't something easy nor something that should be done.


3. The name replacement code (display "Jo" as "Mom") for the rest of the game isn't working at all.
Because of this part : renpy.re.sub( r'()', change, text)
Try renpy.re.sub( r'\b(Jo)\b', change, text), it should works.


4. I could easily edit the displayed text box name in the script.rpy file
define j = Character("Jo") -> define j = Character("Mom")
But how do I do that in a patch.rpy file?
I'm sure that the answer is also in the thread pointed by 79flavors. This said, using this will works only if the game use [j.name] in the dialog to refer to the mother. Else she'll still be called "Jo". Which lead me to another interpretation of your point 3.
When you say that "Jo" isn't changed, you don't mean "in the dialog", but as name of the sayer, right ? If yes, it can't be changed by the "NaughtyMagic" (bas no titled name for functions, it's limited to classes :D). That's why the former Care Bear also redefine the characters in his mod.
 

bas

retired
Donor
Respected User
Former Staff
May 6, 2017
3,988
30,555
When you say that "Jo" isn't changed, you don't mean "in the dialog", but as name of the sayer, right ? If yes, it can't be changed by the "NaughtyMagic" (bas no titled name for functions, it's limited to classes :D). That's why the former Care Bear also redefine the characters in his mod.
I didn't write that - what patch are you talking about? If it's the Kindred one the OP mentions, I've never even heard of that game, so no idea how I'm getting credit for writing their IC patch.
 

bas

retired
Donor
Respected User
Former Staff
May 6, 2017
3,988
30,555
LOL, yeah, I didn't write this, someone was just giving me credit for the original code.

1559303332086.png
 

Deleted member 1044747

Formerly 'decent'
Donor
Nov 27, 2018
335
1,551
Thanks again for your patience and input.

Yes, I checked the other thread - I barely understand what people are talking about there.
I already have a hard time to make sense of the input I'm receiving here.
Again - I'm a total newbie and as soon as people are starting to talk about coding I'm almost instantly like: :oops:

Because of this part : renpy.re.sub( r'()', change, text)
Try renpy.re.sub( r'\b(Jo)\b', change, text), it should works.
Thanks, that worked! Finally a sense of achievement...

It's a bummer redundant text can't be deleted.
So I guess the only way to bypass it would be to create some sort of filler text - or deal with blank text boxes.

Regarding the display of wrong code:
I copied and pasted the original text code and checked it, time and again, each letter and spacing.
Still...
Could it be due to

scene nm jo 02
with dissolve1

that the code isn't displayed correctly?
Though I'm pretty sure it also happens with code that isn't affected by "image fade" effects.

Yes, I meant to change the (coloured) name of the person speaking displayed above the text box.
First I decided to leave it as "Jo", but I think it's more immersive if it's changed to "Mom".
I know it's pretty much standard for incest patches to change those names.
I also checked the code of some of those patches, but I can't make sense of it.
Could you maybe give me a (simple) example how to do it?

This is how the original script.rpy looks like:

# The script of the game goes in this file.

# Declare characters used by this game. The color argument colorizes the
# name of the character.


define a = Character("Arion")
define g = Character("Genie")
define j = Character("Jo")
define e = Character("Evie")
define s = Character("Sara")
define b = Character("Both")
define p = Character("[player_name]")
define q = Character("????")
define k = Character("Kate")
define mrp = Character("Indi's Dad")
define d = Character("Dani")
define i = Character("Indi")
define an = Character("Ani")
define m = Character("Mel")
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,976
16,231
someone was just giving me credit for the original code.
I have a complain regarding an abusing credit thief member of the staff :D



It's a bummer redundant text can't be deleted.
So I guess the only way to bypass it would be to create some sort of filler text - or deal with blank text boxes.
It's all an art to deal with the text change will still complying to the number of dialog available. It's like translation in tv/movie ; they don't just translate the text, but also make it phonetically near the original to correspond with the lips movement.


Regarding the display of wrong code:
I copied and pasted the original text code and checked it, time and again, each letter and spacing.
Still...
Could it be due to [...]
There's no reason for this to interfere ; which don't mean that it's really not the reason, sometimes life is strange. Can you give me a more precise example (file name and line number) of few lines that don't works ? I'll try to figure out why.


Could you maybe give me a (simple) example how to do it?
Well, the simplest way :
[zzpatch.rpy] <- The leading "zz" are important.
Code:
define j = Character("Mom")
And do the same in the same file for any other character that need to be changed. Because of the leading "zz", the file will be proceeded after the many "scriptX" ones, and so override what's defined in them.
 
  • Haha
Reactions: bas

wurg

Active Member
Modder
Apr 19, 2018
705
1,655
It's a bummer redundant text can't be deleted.
Redundant text can be removed if you follow the method I suggested that is also done in the patch for Freeloading Family. You copy the entire label over to the patch file, add '_p' to the end of the label name, make your changes to the label that you want to, then type in the line:

config.label_overrides = {"label_that_I_want_to_change": "label_that_I_want_to_change_p"}

If like in the example you gave there are a number of lines you want to get rid of, this is the way, if it's just one or two here and there throughout the game, the "" would be the best way to do it, if you didn't want to copy the label over to the patch just do get rid of one line. It all depends how meticulous you want to be.
 

Deleted member 1044747

Formerly 'decent'
Donor
Nov 27, 2018
335
1,551
It's all an art to deal with the text change will still complying to the number of dialog available. It's like translation in tv/movie ; they don't just translate the text, but also make it phonetically near the original to correspond with the lips movement.
Well said.
And I will gladly do that rather than racking my brains over another coding issue. ;)

There's no reason for this to interfere ; which don't mean that it's really not the reason, sometimes life is strange. Can you give me a more precise example (file name and line number) of few lines that don't works ? I'll try to figure out why.
Meanwhile I was able to figure out why some of the code didn't display properly.
Turns out it was due to the dev leaving some blank spaces - and here I thought I shouldn't touch the original code...

There are currently still 2 issues which both also have blank spaces.
I tried to run the file with and without blank spaces - to no avail.

1. "Before I came to stay...
2. "One day soon after...

I added the original script.rpy file and my patch.rpy file as an attachment (hopefully that works - I never uploaded anything but pics to F95Zone before - and sorry, TextEdit doesn't show any line numbers).

Well, the simplest way :
[zzpatch.rpy] <- The leading "zz" are important.
Yup, my patch file is already called zzNaugthyMagic_Patch.rpy

And do the same in the same file for any other character that need to be changed. Because of the leading "zz", the file will be proceeded after the many "scriptX" ones, and so override what's defined in them.
I tried
Code:
define j = Character("Mom")
- it works in the script.rpy file, but when I put this code into my patch.rpy file I get an error.
Could you please point out where exactly this code needs to go in my patch file?

config.label_overrides = {"label_that_I_want_to_change": "label_that_I_want_to_change_p"}
I tried that, but it didn't work for me.
To be honest I'm not sure how to exactly use the syntax - could you maybe give me an example (possibly with some code I posted above)?
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,976
16,231
[...] if it's just one or two here and there throughout the game, the "" would be the best way to do it,
I am a fucking idiot !!!!

Code:
#  Real paranoid style. 0 font size, fully transparent black, 
# totally outside of the screen.
style invisible is empty:
    size 0
    color "#00000000"
    xpos config.screen_width + 100
    ypos config.screen_height + 100

screen say(who, what):

    style_prefix "say"

    if what == "":
        text what id "what" style "invisible"
    else:

        window:
            id "window"

            if who is not None:

                window:
                    style "namebox"
                    text who id "who"

            text what id "what"


        ## If there's a side image, display it above the text. Do not display on the
        ## phone variant - there's no room.
        if not renpy.variant("small"):
            add SideImage() xalign 0.0 yalign 1.0
And now you can remove dialog lines by replacing them by "".
 

wurg

Active Member
Modder
Apr 19, 2018
705
1,655
Here is a little demo on how to substitute the labels in the game, the game will break as soon as it's over, this is because I used the start label and left all of the stuff he typed in it out.

You took on a project here, just by glancing at the code it's like a tutorial on how not to code, everything is mixed up in the labels, variables, screens, and the dialog. Take a look at it in the game, I hope this will help you, just start a new game with the file in it and see how it behaves.
 

wurg

Active Member
Modder
Apr 19, 2018
705
1,655
One thing about these games, spacing is important, I don't think it is affecting 'hardChanged', but it's important to keep the spacing correct when coding. An indention means that code is part of the previous statement, if the code lines up with the previous statement the game thinks that is separate from it and treats it differently.

Pic one is how I got the file from you, pic 2 is how it should look not to confuse the game engine. It also serves as a visual reference to let you know what goes with what.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,976
16,231
I tried
Code:
define j = Character("Mom")
- it works in the script.rpy file, but when I put this code into my patch.rpy file I get an error.
Could you please point out where exactly this code needs to go in my patch file?
Er... It should works whatever place you put it in the file. Put them before the "init python:" line in your patch file by example.


One thing about these games, spacing is important, I don't think it is affecting 'hardChanged', but it's important to keep the spacing correct when coding.
After taking a look at the original code, it's not what "spacing" mean here. The author put space at the end of some of his dialog line, before the effective end of the said dialog line. Like by example :
Code:
    "Evie that kept to herself as a kid grew up to become Evil Evie.  "
As for the space you talk about, the original code is a mess. (screen defined in a label with initial indentation, label defined at the same indentation level than the following code, and so on).
 

Deleted member 1044747

Formerly 'decent'
Donor
Nov 27, 2018
335
1,551
Okay, another milestone.
Code:
define j = Character("Mom")
actually worked this time, yay!
Not sure why it didn't before - maybe I had put a comma behind the code to separate it from the other code.
2 out of 4 issues solved. :)

Code:
#  Real paranoid style. 0 font size, fully transparent black,
# totally outside of the screen.
style invisible is empty:
    size 0
    color "#00000000"
    xpos config.screen_width + 100
    ypos config.screen_height + 100

screen say(who, what):

    style_prefix "say"

    if what == "":
        text what id "what" style "invisible"
    else:

        window:
            id "window"

            if who is not None:

                window:
                    style "namebox"
                    text who id "who"

            text what id "what"


        ## If there's a side image, display it above the text. Do not display on the
        ## phone variant - there's no room.
        if not renpy.variant("small"):
            add SideImage() xalign 0.0 yalign 1.0
And now you can remove dialog lines by replacing them by "".
Hmm...
I added this code to my patch file and changed the text I'd like to remove to
Code:
"text that has to go":""
It doesn't have any effect - the blank text boxes are still there.
Or do I have to use the code in conjunction with
Code:
config.label_overrides = {"label_that_I_want_to_change": "label_that_I_want_to_change_p"}
?

Here is a little demo on how to substitute the labels in the game, the game will break as soon as it's over, this is because I used the start label and left all of the stuff he typed in it out.
Well, thank you for the neat little demo.
However, I still don't understand how to utilise this code to skip text.

Sorry, if I may appear a bit dense (maybe I am), but I'm really not good with abstract stuff.
With that said could someone explain in a tangible way how to remove - let's say the middle line from this code:
Code:
"To everyone’s amazement (mine included) I got into college."
"But a storm cloud threatened to rain on my success…."
"The College that offered me a place was in another town."

Pic one is how I got the file from you, pic 2 is how it should look not to confuse the game engine. It also serves as a visual reference to let you know what goes with what.
Well, I did arrange the code exactly like the code in the original script.rpy file.
Now I rearranged the code the way you suggested in pic 2, but it doesn't have any effect - the code I mentioned above is still not displayed correctly.
Still haven't figured out why.
I managed to get some code to work simply by deleting some spare spaces "left" by the game dev like:
Code:
"original text_":"edited text"
 
Last edited: