Do these methods work to add complete events?
Example 100 images 400 lines of dialogue in the patch?
Yes.
But...
It depends on how you are handling your event system.
If you've got your events stored in a
You must be registered to see the links
(or tuple or dict or set), then all your patch needs to do is expand that list.
If you've
You must be registered to see the links
your events to react to a players choices, then you might need to use the label override solution above to have an alternate (expanded) version of that event choice logic in the patch code. Then have those choices jump to labels that only exist in the patch code. As long as that expanded code jumps back into the main script somewhere at some point, it'll be fine. Doesn't matter if that's 1 image and 4 lines of code or 1,000 images and 8,000 lines of code.
You could do something we haven't talked about yet, which is to check if the label exists before jumping to it.
You must be registered to see the links
will do that for you. So you have code in your main game that will check if the label exists and go there if it does. But if the label doesn't exist, it will do something else. If that label ONLY exists in the patch file, then it will only be invoked if the patch file(s) are present.
If you didn't want to include the 100 extra images, you could put all the images in a subfolder of
/images/
like
/images/patch/
and then exclude them during the build process by adding a line like this one to your
options.rpy
:
build.classify('**/patch/**', None)
I haven't tested it, but I think it should work exactly like that.
How do I add this patch to the game?
Up to you.
Keep in mind RenPy doesn't care where the source code is, as long as it is in a file with the file extension
.rpy
.
You could call your patch file
patch.rpy
or
patch1.rpy
or
cuthbert.rpy
.
In the two examples I gave in my original post, they were both using either
init:
or
init python:
, both of which are run during game startup. RenPy allows for multiple
init:
or
init python:
blocks in ANY source file. If you had 10 different
init:
blocks across 6 different
.rpy
files, it would just run each one in turn (You can force the order by using
init {number}
, where the "number" is a number from -999 to +999... RenPy will run them from lowest to highest. If you omit the number, it defaults to
init 0
).
But, as above...
it depends.
Depending on how you've written your code may change how you implement your patch.
You just need to play around with it all a bit until you understand it, then adapt your code as you see fit. As with most things related to RenPy... there is no single right answer... and the best answer is usually the one you understand the most.
Do I have to put as in the other example persistent.patch_installed = False?
Erm... No... I mean
No?
You can if you want. Some people would code it that way - but I thought one of your goals was to hide evidence of patch existing if someone looked at your code. A game with a massive number of
if persistent.is_patched == False:
checks kinda gives the game away, even if the can't see the patched version.
But as I said in the previous post, I'm not sure people at Patreon are really digging that deep. More like they're relying on screenshots sent to them by "concerned citizens".
If so, isn't there another way where I don't have to write in the script.rpy that there is a patch?
All the examples in those threads quoted earlier would go in a separate script file that wouldn't be included with the "public"/"sanitized" version of the game. Just the replacements
(be it replacement words, replacement sentences or entire replacement blocks of code).
You could remove/rename the patch file(s) before building your game.
Or you could add lines like:
build.classify('**/patch.rpy*', None)
... in the relevant part of your
options.rpy
file to force the build process to exclude both the
.rpy
and
.rpyc
files when it builds the game for distribution. You could make it a little less obvious by calling the file
extras.rpy
instead of
patch.rpy
... or as I said earlier
cuthbert.rpy
.
Can the patch be updated with new content without breaking the game?
Yes.
Probably.
Again, it depends... in this case, probably dependant on how well you understand how these patching mechanics work.
Like anything else in life... if you don't understand it... you'll probably fuck it up at some point. That's fine. That's how we learn.
The thing I will add is my usual disclaimer... If you can't quite follow it... play around with it a bit. If you still don't understand it after that... forget it and do it another way... In the case, even if that other way is "code everything in the main script file and hope Patreon doesn't look at the script"... Or "Just write the version of the game you WANTED to write in the first place... and don't monetize it using Patreon. Subscribestar will still quite happily take their cut if your MC is tag teaming your twin sisters with dad and mom going at it in the corner.
Also keep in mind that RenPy only needs the
.rpyc
files to run your game. You could exclude all the
.rpy
source files when building your game too. Not that it's especially hard to recreate them. But if you're worried about someone reading your source code... just don't include it within the publicly distributed version of the game.