Tool Ren'Py UnRen.bat v1.0.11d - RPA Extractor, RPYC Decompiler, Console/Developer Menu Enabler

5.00 star(s) 9 Votes

FallenLondon

Active Member
Aug 5, 2016
716
503
Hi! I have the problem where after running unren.bat is says "cannot find python". I copied in the main game folder which contains "game". Any ideas? Thank you!
I couldn't find if you have gotten an answer, didn't see it in my quick scroll through the last few pages.
Got the same issue for some games. It boils down to a changed (default?) location of python.exe. Used to be in "..\lib\windows-i686" but in newer games (eg Bad Memories) it's in "..\lib\windows-x86_64". Unren only checks the first one.
Your options are:
1) modifying unren.bat to include using the new location or
2) copying python.exe from the "..\lib\windows-x86_64" folder to "..\game"

I'm not aware of issues option 2) could cause. If there are issues I'm sure someone knowledgeable about Ren'py will call me out on it.
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
I couldn't find if you have gotten an answer, didn't see it in my quick scroll through the last few pages.
Got the same issue for some games. It boils down to a changed (default?) location of python.exe. Used to be in "..\lib\windows-i686" but in newer games (eg Bad Memories) it's in "..\lib\windows-x86_64". Unren only checks the first one.
Your options are:
1) modifying unren.bat to include using the new location or
2) copying python.exe from the "..\lib\windows-x86_64" folder to "..\game"

I'm not aware of issues option 2) could cause. If there are issues I'm sure someone knowledgeable about Ren'py will call me out on it.
Firstly, this problem has been more than six months. Secondly, even the updated version of UnRen in the header is suitable for new versions of RenPy. And thirdly, I have created a separate thread for my personal modification of this tool, where I try to add support for all new changes as far as possible.
 
  • Like
Reactions: yoyomistro

Arcana3147

Newbie
Aug 21, 2017
27
13
Can't get it to work. I did that, along the folder that says "game", inside the Au-Pair (which is the game I'm doing this for), folder. When I run Unren, I keep getting the error that says, "Cannot locate python.exe, unable to continure. Are you sure we're in the game's root directory?"

I've been trying in all the folders and still can't get it to work.

In your "game" folder, open the "lib" folder, locate the "windows-x86_64" folder and rename it "windows-i686". It solved the problem for me.
 

frelon71

Active Member
Nov 29, 2018
617
447
Hello, which would have been good is to make an option 1 and 2 extract and decompile it will save time :)
 

Walter Victor

Forum Fanatic
Dec 27, 2017
5,688
19,629
Up through one message.
Not helpful. The lib folder already has the windows-i686 folder.

The error message for all 3 .rpa files is "ValueError: the given file is not a valid Ren'Py archive, or an unsupported version".

Here are the details for the script.rpa file:
+ Unpacking "script.rpa" - 635810 bytes Traceback (most recent call last):
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 363, in <module>
archive = RenPyArchive<archive, padlength-padding, key=key, version=version, verbose=argument_verbose>
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 65, in __init__
self.load<file>
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 229, in load
self.version = self-get_version<>
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 87, in get_version
raise ValueError<ValueError<'the given file is not a valid Ren\'Py archive, or an unsupported version'>


If someone knows what is happening, fine. Otherwise, I don't have to play this game.
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
Not helpful. The lib folder already has the windows-i686 folder.

The error message for all 3 .rpa files is "ValueError: the given file is not a valid Ren'Py archive, or an unsupported version".

Here are the details for the script.rpa file:
+ Unpacking "script.rpa" - 635810 bytes Traceback (most recent call last):
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 363, in <module>
archive = RenPyArchive<archive, padlength-padding, key=key, version=version, verbose=argument_verbose>
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 65, in __init__
self.load<file>
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 229, in load
self.version = self-get_version<>
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 87, in get_version
raise ValueError<ValueError<'the given file is not a valid Ren\'Py archive, or an unsupported version'>


If someone knows what is happening, fine. Otherwise, I don't have to play this game.
Most likely, the archive header was simply changed, the usual practice, but I will say more precisely after downloading. I don't know yet how to bypass random headers beautifully. Only adding to the list of known ones.
 
  • Like
Reactions: Walter Victor

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
Not helpful. The lib folder already has the windows-i686 folder.

The error message for all 3 .rpa files is "ValueError: the given file is not a valid Ren'Py archive, or an unsupported version".

Here are the details for the script.rpa file:
+ Unpacking "script.rpa" - 635810 bytes Traceback (most recent call last):
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 363, in <module>
archive = RenPyArchive<archive, padlength-padding, key=key, version=version, verbose=argument_verbose>
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 65, in __init__
self.load<file>
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 229, in load
self.version = self-get_version<>
File "F:\Games\JASOM\JASON-U02-pc\_rpatool.py", line 87, in get_version
raise ValueError<ValueError<'the given file is not a valid Ren\'Py archive, or an unsupported version'>


If someone knows what is happening, fine. Otherwise, I don't have to play this game.
I was right. Changed the Header. And it's capital like this. Added in support there.
 
  • Like
Reactions: Walter Victor

Jake2000

Member
Oct 14, 2018
336
792
I am a beginner in renpy. I have a decent idea how to play with console commands. But now I wanna learn about rpy files.

Can anyone tell me, after extracting RPA packages and decompile rpyc. I can edit those however I want. After successfully editing those rpy file. How can I recompile all those files. Do I even need to recompile all those file. Because the game runs without an issue even after decompiling files.
I know experience modders make a patch file (ex: patch.rpy) to mod the game. But I'm not quit there yet.
And lastly I cannot find the tread tutorial for making patch.rpy or other mod like unlock gallery mod. If anyone know then please link at me.
 
  • Like
Reactions: no1milfhunter

Walter Victor

Forum Fanatic
Dec 27, 2017
5,688
19,629
I am a beginner in renpy. I have a decent idea how to play with console commands. But now I wanna learn about rpy files.

Can anyone tell me, after extracting RPA packages and decompile rpyc. I can edit those however I want. After successfully editing those rpy file. How can I recompile all those files. Do I even need to recompile all those file. Because the game runs without an issue even after decompiling files.
I know experience modders make a patch file (ex: patch.rpy) to mod the game. But I'm not quit there yet.
And lastly I cannot find the tread tutorial for making patch.rpy or other mod like unlock gallery mod. If anyone know then please link at me.
The game will take care of everything for you. After you change a .rpy file, just restart the game and it will recreate the .rpyc file based on your changes.

If you have used option 3 of UnRen, you can even modify the script while playing the game, Then hitting Shift+R will reload the game with your changes. Once you've done that while playing the game, any further changes to that script will automatically be affected without having to hit Shift-R.

In games where there are a lot of errors, especially in the sayer-names, I will fix the errors as I play. It pisses me off when the wrong person is talking, and it's a simple change to make. :)

Of course, until you are really sure of what you are doing, you should make a backup of the .rpy file before changing it. Of course, if you really screw up, you can always delete everything and re-extract the .rpa packages or unzip the downloaded file.
 
  • Like
Reactions: VepsrP and Jake2000

moskyx

Engaged Member
Jun 17, 2019
3,969
12,778
I am a beginner in renpy. I have a decent idea how to play with console commands. But now I wanna learn about rpy files.

Can anyone tell me, after extracting RPA packages and decompile rpyc. I can edit those however I want. After successfully editing those rpy file. How can I recompile all those files. Do I even need to recompile all those file. Because the game runs without an issue even after decompiling files.
I know experience modders make a patch file (ex: patch.rpy) to mod the game. But I'm not quit there yet.
And lastly I cannot find the tread tutorial for making patch.rpy or other mod like unlock gallery mod. If anyone know then please link at me.
If you just want to make a mod patch, you don't need to recompile anything.

RPA, as you said, is just a package. Ren'Py runs the rpyc files and it doesn't matter if they are within the rpa package or outside of it. Once you extract it, Ren'Py will run the rpyc files outside that package because, when Ren'Py finds two rpyc files with the same name, it runs the last modified one, and that's the one outside the rpa package. That's why, once extracted, you can safely delete the rpa and the game will work just fine.

Rpy files are the 'printable' version of rpyc files. Those are the ones where devs code the game. Ren'Py reads them and compile its info in their respective rpyc files. So when launching a game, Ren'Py first looks for rpy files: if any, Ren'Py automatically compiles them in rpyc files (updating the existing ones so that they include the last changes made on the rpy files) and then run those updated rpyc files.

So you only need to mod those rpy files with the changes you want to make to the game. If you're a noob, the easiest way to create a patch is to put into a 'game' folder all your modded rpy files AND their respective rpyc files (that way you'd likely avoid saves compatibility issues). Let's say the game comes with a RPA package and, after extracting it, you have 10 rpy files and 10 rpyc files. If you only modify 3 of those rpy files, those are the only ones you have to include in your patch: players will have the other 7 inside their original RPA package and your 3 modded rpyc files will 'override' the other 3 within the package.

Expert modders include all those changes in a brand new 'patch.rpy' file with some functions that override the original ones, so that players can safely install the mod without replacing their original files (that way you can uninstall the mod just by deleting that 'patch.rpy' and restore everything as it was before installing it). Because not all games come with their files in RPA, and your 'noob patch' will force players to replace original files thus making it impossible to 'uninstall' your patch - their onlyway to get rid of it will be to re-install the whole game
 

lambdadw

Active Member
Feb 17, 2018
509
1,833
Hello.
Thanks a lot for this helpful tool. For a long time I don't play any more, but I continue to get acquainted with projects of interest.

However, there were a couple of games, archives of which both the past and the current version could not be unpacked, for example current versions of "Wicked Paradise". Can you help with this? :confused:
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
Hello.
Thanks a lot for this helpful tool. For a long time I don't play any more, but I continue to get acquainted with projects of interest.

However, there were a couple of games, archives of which both the past and the current version could not be unpacked, for example current versions of "Wicked Paradise". Can you help with this? :confused:
Specify which version of the tool you use?
 

lambdadw

Active Member
Feb 17, 2018
509
1,833
Specify which version of the tool you use?
And UnRen 0.8, and today I looked here and tried UnRen 0.91.

Sorry, I did not describe the error, as I wrote from the phone.
This is what the tool gives me when I try to unpack (as well as several previous versions of this game).
You don't have permission to view the spoiler content. Log in or register now.
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,367
And UnRen 0.8, and today I looked here and tried UnRen 0.91.

Sorry, I did not describe the error, as I wrote from the phone.
This is what the tool gives me when I try to unpack (as well as several previous versions of this game).
You don't have permission to view the spoiler content. Log in or register now.
Version 0.8 has not supported all games for a long time. And 0.91 was created by a moderator who messed up a little. If you look at the previous page with messages, you will see my link to the current version of the tool, which should support all modern games on RenPy.
 
  • Like
Reactions: trauts and lambdadw
5.00 star(s) 9 Votes