Tool Ren'Py UnRen for MacOS and Linux v0.8.2

5.00 star(s) 1 Vote

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,680
I fixed these by copy and paste to the game folder (next to .exe, .sh etc., where I also put the unren.command), as you mentioned it.



No.

I think it is not downloading from Github either.
Those are in the script, base64 encoded.

Looks like there's another difference between bsd and gnu base64 - bsd base64 takes -o to specify an output file.

Change the 3 base64 lines from this:
base64 --decode <<< $unrpyc -o /tmp/unrpyc.py
to this:
base64 --decode <<< $unrpyc > /tmp/unrpyc.py
 
  • Like
Reactions: cold_arctus

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,816
Those are in the script, base64 encoded.

Looks like there's another difference between bsd and gnu base64 - bsd base64 takes -o to specify an output file.

Change the 3 base64 lines from this:
base64 --decode <<< $unrpyc -o /tmp/unrpyc.py
to this:
base64 --decode <<< $unrpyc > /tmp/unrpyc.py
aye, it works now!

Here is the working GNU version of UnRen.
 

WaveOfPig

Active Member
May 12, 2017
616
250
Ok @goobdoob I have a problem fairly commonly that makes it so that I cannot decompile RPAs on certain files.
Screen Shot 2019-02-19 at 11.24.38 PM.png
The strange thing is that sometimes, all I have to do to make it work is delete some of the text of the folder name.

Forgive me if this has been talked about in previous posts, but I am unfortunately not fluent in rocket science :cry:.
 

WaveOfPig

Active Member
May 12, 2017
616
250
You can use the official webp viewer made by Google , however, it is used by the terminal, I'm sure that you can probably set the default program to open .webp to the webp viewer. If you don't want the complications, then try .
Before I needlessly ask for help with the google viewer, does it open multiple images in the same window like preview?
 

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,680
Ok @goobdoob I have a problem fairly commonly that makes it so that I cannot decompile RPAs on certain files.
View attachment 249303
The strange thing is that sometimes, all I have to do to make it work is delete some of the text of the folder name.

Forgive me if this has been talked about in previous posts, but I am unfortunately not fluent in rocket science :cry:.
That's really odd. I've never seen this, and I run UnRen fairly often.

Some questions:
  1. You say fairly commonly. What games are you having this issue with?
  2. What is the full path of a non-working game? If you don't want to post your username publicly, feel free to PM it.
  3. What is the full path after you change it and get it to work?
  4. Are there any odd characters in the path (not a-z, A-Z, 1-0, +_-.,=)?
 
  • Like
Reactions: WaveOfPig

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,680
New version 0.3 uploaded.

Changelog:
  • Changed rpyc decompile to decompile rpyc files in all game directories recursively.
  • Added option to overwrite existing rpy files. Thanks to randomname42 @ for the suggestion.
  • Changed base64 option -D to --decode because -D doesn't work on GNU base64.
  • Changed base64 option -o to > because -o doesn't work on GNU base64. Thanks to cold_arctus @ for the base64 bug reports.
  • Fixed a bug having to do with spaces in the path to the game. Thanks to waveofpig @ for the bug report.
  • Changed to splash screen to say "@ " instead of "@f95zone".
  • Detect if there are no .rpa files to extract and report that, instead of getting an error from the shell.
Thanks to @cold_arctus and @waveofpig for bug reports, and @randomname42 for the suggestion to decompile recursively and the overwrite option.
 

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,680
Found a bug when trying to unarchive more than 1 .rpa file.

Gotta love bash and its variables that contain things like "file1.rpa file2.rpa file3.rpa". Sometimes that's 1 element, and sometimes that's 3.
 
  • Like
Reactions: WaveOfPig

joel69

Newbie
Mar 30, 2018
15
13
That's a good suggestion. When I feel the need for my lazy ass to release a new version, I'll look into that. :)
in function decompile, you could use the find command instead of the for loop, i.e. you could completely replace the for block with this line:
Bash:
    find . -iname '*.rpyc' -exec python "/tmp/unrpyc.py" '{}' --clobber \;
this way, find looks for all files with the extension .rpyc in all sub-directories of the current directory (= game/) and executes unrpyc on each of the found files. the --clobber argument tells unrpyc to overwrite existing .rpy files.
 

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,680
in function decompile, you could use the find command instead of the for loop, i.e. you could completely replace the for block with this line:
Bash:
    find . -iname '*.rpyc' -exec python "/tmp/unrpyc.py" '{}' --clobber \;
this way, find looks for all files with the extension .rpyc in all sub-directories of the current directory (= game/) and executes unrpyc on each of the found files. the --clobber argument tells unrpyc to overwrite existing .rpy files.
Thanks. I may do that for .rpa files, but it turns out that unrpyc will do it for me, so now there are 2 options - overwrite and don't overwrite:

function decompile
{
echo "Decompiling rpyc files"
pushd "$game" > /dev/null
python "/tmp/unrpyc.py" "."
popd > /dev/null
}

function decompileoverwrite
{
echo "Decompiling rpyc files, overwriting existing rpy files"
pushd "$game" > /dev/null
python "/tmp/unrpyc.py" "." "-c"
popd > /dev/null
}
 

iamabot001

Newbie
Aug 22, 2017
25
13
When decompiling rpyc files I get an error saying this:

Python:
Traceback (most recent call last):
  File "unrpyc.py", line 33, in <module>
    import decompiler
  File "/media/ddrive/Downloads/Jdown/broken-dreamers/BrokenDreamers-0.2.2-pc/unrpyc/decompiler/__init__.py", line 22, in <module>
    from util import DecompilerBase, First, WordConcatenator, reconstruct_paraminfo, \
ModuleNotFoundError: No module named 'util'
I cloned the original unrpyc repo from the github page and tried to run it. It still gives me the same error. Although I can confirm that the file util.py is present in the parent directory of __init__.py

What can be done about this?

EDIT:
Of course it's got to be related to python2. F****. It worked fine when using explicitly with python2. Need to change the script?
 
Last edited:

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,680
When decompiling rpyc files I get an error saying this:

Python:
Traceback (most recent call last):
  File "unrpyc.py", line 33, in <module>
    import decompiler
  File "/media/ddrive/Downloads/Jdown/broken-dreamers/BrokenDreamers-0.2.2-pc/unrpyc/decompiler/__init__.py", line 22, in <module>
    from util import DecompilerBase, First, WordConcatenator, reconstruct_paraminfo, \
ModuleNotFoundError: No module named 'util'
I cloned the original unrpyc repo from the github page and tried to run it. It still gives me the same error. Although I can confirm that the file util.py is present in the parent directory of __init__.py

What can be done about this?

EDIT:
Of course it's got to be related to python2. F****. It worked fine when using explicitly with python2. Need to change the script?
Which distro/version are you using?

Do you have /usr/bin/python2.7 ?

Did you do something to make python 3 the default, or does that distro/version come that way?
 

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,816
Which distro/version are you using?

Do you have /usr/bin/python2.7 ?

Did you do something to make python 3 the default, or does that distro/version come that way?
Your script works fine on Ubuntu 16.04 just tested it with City of Broken Dreamers.

python -V shows 2.7.12

But I also have python 3.5 installed.
 

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,680
Your script works fine on Ubuntu 16.04 just tested it with City of Broken Dreamers.

python -V shows 2.7.12

But I also have python 3.5 installed.
I'm thinking on his system /usr/bin/python is python 3.x. I'm wondering if that's the default for his distro/version, or if it's something he did.

Maybe add code to check the version, and if it's python 3, exit and print an error?
 

iamabot001

Newbie
Aug 22, 2017
25
13
Which distro/version are you using?

Do you have /usr/bin/python2.7 ?

Did you do something to make python 3 the default, or does that distro/version come that way?
I have Arch Linux, and yes it comes with python 3 by default. So to run python2 script it needs to be run explicitly with python2 command. I had to change the script for that but it works now.
 

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,816
Maybe add code to check the version, and if it's python 3, exit and print an error?
Isn't Apple removing old python scripts (2.x) from his upcoming new OS? :unsure:

Scripting Language Runtimes

Deprecations

  • Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. Future versions of macOS won’t include scripting language runtimes by default, and might require you to install additional packages. If your software depends on scripting languages, it’s recommended that you bundle the runtime within the app. (49764202)
  • Use of Python 2.7 isn’t recommended as this version is included in macOS for compatibility with legacy software. Future versions of macOS won’t include Python 2.7. Instead, it’s recommended that you run python3 from within Terminal. (51097165)
(Source: )

Is there a reason why your unren script needs python 2 and not 3? Is it because of Ren'Py?
 

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,680
Isn't Apple removing old python scripts (2.x) from his upcoming new OS? :unsure:


(Source: )

Is there a reason why your unren script needs python 2 and not 3? Is it because of Ren'Py?
unrpyc doesn't work with python 3, according to iamabot001 .

A couple of years ago Apple made a big stink on certain LLVM mailing lists about the switch to python 3. I guess they've changed their tune, now that Microsoft is really dropping support for Windows NT ... er ... python.org is really dropping support for python 2. The real problem with MacOS Catalina, though, isn't python - it's 32 bit apps. It only supports 64 bit apps. Apple has said we should upgrade our apps to 64 bit, but what do you think the chances are that all the games in my Steam library will be updated? I'd say close to 0. So I'm sticking with Mojave for the forseeable future.
 

cold_arctus

Devoted Member
Sep 25, 2018
8,945
10,816
unrpyc doesn't work with python 3, according to iamabot001 .

A couple of years ago Apple made a big stink on certain LLVM mailing lists about the switch to python 3. I guess they've changed their tune, now that Microsoft is really dropping support for Windows NT ... er ... python.org is really dropping support for python 2. The real problem with MacOS Catalina, though, isn't python - it's 32 bit apps. It only supports 64 bit apps. Apple has said we should upgrade our apps to 64 bit, but what do you think the chances are that all the games in my Steam library will be updated? I'd say close to 0. So I'm sticking with Mojave for the forseeable future.
Waaait a minute...! Does it mean that there is the possibility that MacOS Catalina user might not be able to play their favorite adult Ren'Py game in the future? :unsure:
 

iamabot001

Newbie
Aug 22, 2017
25
13
unrpyc doesn't work with python 3, according to iamabot001 .

A couple of years ago Apple made a big stink on certain LLVM mailing lists about the switch to python 3. I guess they've changed their tune, now that Microsoft is really dropping support for Windows NT ... er ... python.org is really dropping support for python 2. The real problem with MacOS Catalina, though, isn't python - it's 32 bit apps. It only supports 64 bit apps. Apple has said we should upgrade our apps to 64 bit, but what do you think the chances are that all the games in my Steam library will be updated? I'd say close to 0. So I'm sticking with Mojave for the forseeable future.
I don't know much about programming or computers in general. But I believe renpy using python 2.7 is why it unrpyc is forced to use python 2. Otherwise the code looks pretty neat to me. On windows I had no problems de compiling scripts, I had only python 3 installed anyway. But I think that was because the script was using the bundled python found in game's folders rather than the installed version. On the error specifically, I can show you that the file it was trying to import -- util.py -- did actually exist in the parent directory. Maybe its related to how importing packages are handled in python 3. Again I don't know much about all these things, maybe its just my installation that is somehow broken or something.
 

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,680
Waaait a minute...! Does it mean that there is the possibility that MacOS Catalina user might not be able to play their favorite adult Ren'Py game in the future? :unsure:
I think the python that Ren'Py uses is 64 bit, so that should be OK. But if you like casual games from bigfishgames.com, you might be screwed.
 

goobdoob

Conversation Conqueror
Modder
Respected User
Dec 17, 2017
7,425
9,680
I don't know much about programming or computers in general. But I believe renpy using python 2.7 is why it unrpyc is forced to use python 2. Otherwise the code looks pretty neat to me. On windows I had no problems de compiling scripts, I had only python 3 installed anyway. But I think that was because the script was using the bundled python found in game's folders rather than the installed version. On the error specifically, I can show you that the file it was trying to import -- util.py -- did actually exist in the parent directory. Maybe its related to how importing packages are handled in python 3. Again I don't know much about all these things, maybe its just my installation that is somehow broken or something.
There are ways to write scripts so they'll work in both python 2 and python 3. unrpyc isn't forced to use 2 because Ren'Py uses 2; it just makes it convenient on windows for UnRen. It could (and presumably will) be upgraded at some point.
 
  • Like
Reactions: cold_arctus
5.00 star(s) 1 Vote