Mod Renpy Modding: RPA Editing & RPYC

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,978
16,236
Since you don't gave credits, I assume that it's your works, so few questions :

  1. Why using rpaextractor and unrpycgui ?
    All can be done, more easily, by using (now also available on ). Especially for the cases where there's more than a single archive.
  2. Why extracting all the archives ?
    On your second example, you don't need to extract the fonts.rpa and audio.rpa archives, unless you intend to replace a font or an audio file. In the same way, if you intend to just make some graphical changes, then you don't need to unpack the scripts.rpa ; or you don't need to unpack the images.rpa if you only want to works on the scripts. This even if you works from the SDK.
  3. Why working from the SDK ?
    I'll not say that the SDK isn't useful, just that it isn't when you're just modding a game. The SDK is just a Ren'py game which isn't a game but a project manager.
    You can do exactly the same things (except the repack, see below) by just using the game launcher, with the addition of some advantages :
    • 1 operation to do (move the original rpa files out of the "/game/" folder), against 10 (if I counted right) for your second example.
    • No download time.
    • No need for a, "you forgot something so it will crash" example.
    • If really you care about it, the guaranty to works with the right version of Ren'py.
  4. Why the need of the right SDK ?
    Ren'py is wrote with backward compatibility in mind, so there's really few incompatibility issues. Therefore, in 99% of the case if it don't works it's because the code is wrong from the start, but previous version of Ren'py silently ignored the error.
    This mean that, if your intend is to edit the original code, then it's better to works with the last version of the SDK ; if it don't works, it mean that there's an error and your mod will also fix it. And if your intend is just to make some graphical changes, or use none intrusive code for your mod, then doing it directly from the game is better.
    And for the repack part, you can use (but it need Python), or you just use any version of the SDK. You'll not encounter compatibility issue with the rpa and rpyc files, unless the game or your SDK is on 6.99.4 or above. If there's issues with the code itself, then :
    • Drop the rpyc files from the game folder (Ren'py recreate them each time you launch the game if there's a change in the rpy file or if they are missing) ;
    • Ensure that "force recompile" is not checked (normally Ren'py shouldn't care of the code in this case) ;
    • Drop the newly created rpa in the original game folder ;
  5. Why a so complicated way to find logo ?
    You just extracted the source code, it's easier to look at the splash_screen label to find the picture name and location. It even let you just change the said name and location. This way, you can very easily revert at anytime if finally you don't find a final form that please you.

This said, a big plus for your speaking. As none native English speaker I tend to avoid video because I don't understand what's said, but here it's perfect.
 

Keitaro420

Member
Apr 17, 2018
418
1,005
Since you don't gave credits, I assume that it's your works, so few questions :

  1. Why using rpaextractor and unrpycgui ?
    All can be done, more easily, by using (now also available on ). Especially for the cases where there's more than a single archive.
  2. Why extracting all the archives ?
    On your second example, you don't need to extract the fonts.rpa and audio.rpa archives, unless you intend to replace a font or an audio file. In the same way, if you intend to just make some graphical changes, then you don't need to unpack the scripts.rpa ; or you don't need to unpack the images.rpa if you only want to works on the scripts. This even if you works from the SDK.
  3. Why working from the SDK ?
    I'll not say that the SDK isn't useful, just that it isn't when you're just modding a game. The SDK is just a Ren'py game which isn't a game but a project manager.
    You can do exactly the same things (except the repack, see below) by just using the game launcher, with the addition of some advantages :
    • 1 operation to do (move the original rpa files out of the "/game/" folder), against 10 (if I counted right) for your second example.
    • No download time.
    • No need for a, "you forgot something so it will crash" example.
    • If really you care about it, the guaranty to works with the right version of Ren'py.
  4. Why the need of the right SDK ?
    Ren'py is wrote with backward compatibility in mind, so there's really few incompatibility issues. Therefore, in 99% of the case if it don't works it's because the code is wrong from the start, but previous version of Ren'py silently ignored the error.
    This mean that, if your intend is to edit the original code, then it's better to works with the last version of the SDK ; if it don't works, it mean that there's an error and your mod will also fix it. And if your intend is just to make some graphical changes, or use none intrusive code for your mod, then doing it directly from the game is better.
    And for the repack part, you can use (but it need Python), or you just use any version of the SDK. You'll not encounter compatibility issue with the rpa and rpyc files, unless the game or your SDK is on 6.99.4 or above. If there's issues with the code itself, then :
    • Drop the rpyc files from the game folder (Ren'py recreate them each time you launch the game if there's a change in the rpy file or if they are missing) ;
    • Ensure that "force recompile" is not checked (normally Ren'py shouldn't care of the code in this case) ;
    • Drop the newly created rpa in the original game folder ;
  5. Why a so complicated way to find logo ?
    You just extracted the source code, it's easier to look at the splash_screen label to find the picture name and location. It even let you just change the said name and location. This way, you can very easily revert at anytime if finally you don't find a final form that please you.

This said, a big plus for your speaking. As none native English speaker I tend to avoid video because I don't understand what's said, but here it's perfect.
Why not?
 

djv007

Active Member
Apr 23, 2020
575
535
so i managed to extract rpyc and then decompile them into rpy files. Now rpy files open in Notepad++. But whenever i try to add any code or even a empty new line. I get an error saying "Parser error line no xxx". So what am i doing wrong?
 

DavidCF

Member
Aug 10, 2020
361
130
so i managed to extract rpyc and then decompile them into rpy files. Now rpy files open in Notepad++. But whenever i try to add any code or even a empty new line. I get an error saying "Parser error line no xxx". So what am i doing wrong?
Show short example of the code with the lines you added finished with: ## I added this line
That way we can see what is going on.

In Notepad++ do Settings > Style Configurator
Then as shown in the screen dump.
Select Python and then under User ext add rpy rpyold rpyorig
Play around with the Select theme: to get the setup that you like.
This allows you to have different version of the file and Notepad will treat all of them as Python and you will see
the code highlighted instead of just one colour as it is when it is just a .txt file.

Go to View -> Show Symbol and make sure that
Show All Characters
Show Indent Guide
are ticked.
Converting tabs to spaces in Notepad++.
go to Settings -> Preferences -> Language. Under "Tab Settings",
highlight "lua", then un-check "Use default value", make sure the tab size is 4, and
check "Replace by space".
Add the Plugins Compare and DSpellCheck
Inside DSpellCheck make certain that Spell Check Document Automatically is ticked.
It allows you to choose UK or US English.
 
Last edited: