Tool Ren'Py UnRenGUI, UnRen-forall(v9.4), UnRen-Powershell-forall(v9.4), UnRen-old

5.00 star(s) 3 Votes

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
I noticed and wondered... A custom type from the dev with rule breaking characteristics? i mean:
AttributeError: 'NoneType' object has no attribute 'linenumber'
A "ast" element shouldn't be like this.
Yeah, custom code from dev in the screen or gui - pain in the ass. :HideThePain:
In fact, I just threw this element out of processing through checking for NoneType. Since the game started, I decided that this was enough, but perhaps it should be handled in some other way :unsure:
 

Madeddy

Active Member
Dec 17, 2017
838
487
In fact, I just threw this element out of processing through checking for NoneType.
I thought about this some and wondered why we get this error... Why is ist "nothing" for this node? Maybe the problem to have "NoneType" is at a earlier point in the decompilation process to find:
Could it be, because it is a "custom user defined displayable" unrpyc cannot find the type in his current code and as a fallback (accidential or by choice?) it gets no type attached? Then the node makes it somehow to the point where it finally errors like seen(...no linenumber)? If so, then maybe this "unidentified" displayables could get a random type/name assigned, so this does not happen anymore.

Greets
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
How is it that UnRpyc can't find a suitable type?:unsure: I thought all the necessary information was contained in the rpyc file, at least everything points to that. There really was a None object and it had much fewer properties than everyone else.
 

Madeddy

Active Member
Dec 17, 2017
838
487
There really was a None object and it had much fewer properties than everyone else.
Really...? o_O Why should renpy put such "illegal" data type in there? A trap by the game dev to fuck the decompiler? OR bad coding? What else? :unsure:
 

Korlaeda

Newbie
Jan 10, 2018
28
44
Just to report on Hero's Harem Guild: I've had to copy-paste in place the folder /lib/py3-windows-x86_64, and then rename the copy to /lib/windows-i686, and after that the unren-forall.bat version 8.7 worked perfectly fine.

I think the "visual hints" button prompts (an in-game setting) .might not work properly, but I left it on "auto" anyway.
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
Just to report on Hero's Harem Guild: I've had to copy-paste in place the folder /lib/py3-windows-x86_64, and then rename the copy to /lib/windows-i686, and after that the unren-forall.bat version 8.7 worked perfectly fine.

I think the "visual hints" button prompts (an in-game setting) .might not work properly, but I left it on "auto" anyway.
The instrument works calmly with this game even without these dances with a tambourine :BootyTime:
 

Korlaeda

Newbie
Jan 10, 2018
28
44
I apologise if I was somewhat unclear, although I'm not sure that justifies the mocking responses <_<

Here's the full report:

For Hero's Harem Guild, (version 0.1.2.2 Public), after putting unren-forall.bat (version 8.7) in the game's root folder (the one where HHGv0.1.2.2.exe is located, along with game, lib and renpy folders), it fails to find python - as seen in another screenshot here:
Screenshot 2023-05-09 172805.png

After "doing the dance", i.e. copy and rename /lib/py3-windows-x86_64 to /lib/windows-i686, it does work.
 
Last edited:

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
I apoloigise if I was somewhat unclear, although I'm not sure that justifies the mocking responses <_<

Here's the full report:

For Hero's Harem Guild, (version 0.1.2.2 Public), after putting unren-forall.bat (version 8.7) in the game's root folder (the one where HHGv0.1.2.2.exe is located, along with game, lib and renpy folders), it fails to find python - as seen in another screenshot here:
View attachment 2608137

After "doing the dance", i.e. copy and rename /lib/py3-windows-x86_64 to /lib/windows-i686, it does work.
strange, but i don't have this error, doesn't matter if the tool is inside the game folder or not :unsure:
 

Madeddy

Active Member
Dec 17, 2017
838
487
...although I'm not sure that justifies the mocking responses <_<
If this was adressed in my direction you misinterpreted. There was really no mocking intended.
After "doing the dance", i.e. copy and rename /lib/py3-windows-x86_64 to /lib/windows-i686, it does work.
  • Which OS variants has this game in the lib directory? Please list them somehow or make a screeny.
  • Whats your OS architecture? 64 or 32 bit?
strange, but i don't have this error, doesn't matter if the tool is inside the game folder or not :unsure:
Do you test with his game(really big, i will not DL it just for tests) or with a different game? This looks to me as if Unren batch jumps from code at lines 89-115 somehow in the wrong lib dir.
 
Last edited:

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
If this was adressed in my direction you misinterpreted. There was really no mocking intended.

  • Which OS variants has this game in the lib directory? Please list them somehow or make a screeny.
  • Whats your OS architecture? 64 or 32 bit?
Do you test with his game(really big, i will not DL it just for tests) or with a different game? This looks to me as if Unren batch jumps from code at lines 89-115 somehow in the wrong lib dir.
with this biiiiiiiig game:BootyTime:
 

Korlaeda

Newbie
Jan 10, 2018
28
44
  • Which OS variants has this game in the lib directory? Please list them somehow or make a screeny.
Sure, here are the original contents of the lib folder
1683653535618.png
  • Whats your OS architecture? 64 or 32 bit?
I'm on Windows 11 x64.

Do you test with his game(really big, i will not DL it just for tests) or with a different game?
Just tested on 4 other ones, and it works right away.


I just thought this game might have some non-standard naming and/or because it's Python 3?


strange, but i don't have this error, doesn't matter if the tool is inside the game folder or not :unsure:
Could it be you have Python installed and in PATH? (I don't right now).
I don't really know if Unren checks for that though.
 

Madeddy

Active Member
Dec 17, 2017
838
487
Korlaeda Thanks for the infos. I'm a bit stumped whats happening in your case. Maybe its related to the following stuff. :unsure: Please take a look at the first cited post and point 1 and test this.

VepsrP Did you by chance miss this posts from me on march 7:
VepsrP
I discovered some potential problematic stuff in the batch:
  1. Py not found error with manual startet win cmd console and certain start conditions
    • Start win cmd by hand
    • Stay on the path in c: where the cmd starts(for me it starts in ("c:\users\my_username>")
    • Execute unren on another drive: > d:\some_path\unren_v8.4.bat
    • Drag and drop some game in and get the error...!
    • ...could this be why some people get this error sometimes and we scratch our heads?
  2. The batch file has 12 cases of missing the closing double-quote: "%gamedir%. I am not sure why this not errors all the time.
  3. "Change dir" curiosity: You have in the unrpa and unrpyc sections 2 different styles to use "cd": One time its %gamedir%, the other time "%gamedir%".
    • Could this be the reason for the parens in path problem?
    • Which of the variants is the right one?
    • Why is "change dir" ever needed at this point? I cant see why. :unsure:
Related to my previous post: I think i found the reason for the parenthesis problem:
The variable %gamedir% misses sometimes one or both quotes, however they are unconditionally necessary to escape special chars inside.
Example from newest unren_v8.4 from VepsrP:
Code:
REM Decompile rpyc files
REM --------------------------------------------------------------------------------
echo    Searching for rpyc files...
cd "%gamedir%"  <-- unneeded command: unrypc searches itself in the target dir for files; same for rpa unpacking section i guess
REM set "PYTHONPATH=%pythondir%Lib"

if exist "%pythondir%Lib" (
    if "%option%" == "2" (
        echo    + Searching for rpyc files in %gamedir%  <-- both quotes missing
        "%pythondir%python.exe" -O "%unrpycpy%" --init-offset "%gamedir%   <-- missing closing quote
    )
    if "%option%" == "9" (
    ...
    ... etc.
This is still unfixed in UnRen v8.7 and i don't think this code parts and facts are unimportant.

Additional stuff:
- Renpy docs for v3.9 state the -O switch isn't needed, so this code for it in Unren is a waste of time. Cite: When running under Ren'Py 8, Ren'Py now runs without the equivalent of the Python -O flag. This means that docstrings and assert statements are available.
- There is no 32 bit support in RenPy v8 anymore, so the code to set Unren for any 32 bit libs would produce a bug with v8. There will logically never exits a dir named "py3-windows-i686"... excerpt from the file:
Code:
if exist "lib\py3-windows-x86_64\python.exe" (
    if not "%PROCESSOR_ARCHITECTURE%"=="x86" (
        set "pythondir=%cd%\lib\py3-windows-x86_64\"
    ) else if exist "lib\py3-windows-i686\python.exe" (
        set "pythondir=%cd%\lib\py3-windows-i686\"
    )
) else if exist "lib\py3-windows-i686\python.exe" (
    set "pythondir=%cd%\lib\py3-windows-i686\"
)
Insead of the current code, this section should in case of 32 bit OS show a warning that the users OS isnt supported and exit.
 
Last edited:

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
Sure, here are the original contents of the lib folder
View attachment 2608423


I'm on Windows 11 x64.



Just tested on 4 other ones, and it works right away.


I just thought this game might have some non-standard naming and/or because it's Python 3?




Could it be you have Python installed and in PATH? (I don't right now).
I don't really know if Unren checks for that though.
Nah, after the last reinstall system, I did not prescribe a third-party Python and my tool only works with a built-in stub.
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
Korlaeda Thanks for the infos. I'm a bit stumped whats happening in your case. Maybe its related to the following stuff. :unsure: Please take a look at the first cited post and point 1 and test this.

VepsrP Did you by chance miss this posts from me on march 7:


This is still unfixed in UnRen v8.7 and i don't think this code parts and facts are unimportant.

Additional stuff:
- Renpy docs for v3.9 state the -O switch isn't needed, so this code for it in Unren is a waste of time. Cite: When running under Ren'Py 8, Ren'Py now runs without the equivalent of the Python -O flag. This means that docstrings and assert statements are available.
- There is no 32 bit support in RenPy v8 anymore, so the code to set Unren for any 32 bit libs would produce a bug with v8. There will logically never exits a dir named "py3-windows-i686"... excerpt from the file:
Code:
if exist "lib\py3-windows-x86_64\python.exe" (
    if not "%PROCESSOR_ARCHITECTURE%"=="x86" (
        set "pythondir=%cd%\lib\py3-windows-x86_64\"
    ) else if exist "lib\py3-windows-i686\python.exe" (
        set "pythondir=%cd%\lib\py3-windows-i686\"
    )
) else if exist "lib\py3-windows-i686\python.exe" (
    set "pythondir=%cd%\lib\py3-windows-i686\"
)
Insead of the current code, this section should in case of 32 bit OS show a warning that the users OS isnt supported and exit.
1) I didn't miss it, I just forgot to answer then :HideThePain: , I'll do it later when I come home from work.
2) If you pay attention to the existence of which folder I check before launching with the key "-O", then you may understand that this key is used for games on the older engine and the second python.:BootyTime:
 

Madeddy

Active Member
Dec 17, 2017
838
487
I didn't miss it, I just forgot to answer then :HideThePain: , I'll do it later when I come home from work.
Ah, ok. But there's no need to break your neck over it. I just wanted to make sure it isn't lost and you have the chance to check my findings/thoughts for any usefulness. If there is something in my nonsense.:LOL:
Buuuut... at least with the missing quotes i am right! Or you made them invisible...
If you pay attention to the existence of which folder I check...
Ah dammit. Trying to understand other devs code... :eek: Didn see this. Obviously.
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
VepsrP
I discovered some potential problematic stuff in the batch:
  1. Py not found error with manual startet win cmd console and certain start conditions
    • Start win cmd by hand
    • Stay on the path in c: where the cmd starts(for me it starts in ("c:\users\my_username>")
    • Execute unren on another drive: > d:\some_path\unren_v8.4.bat
    • Drag and drop some game in and get the error...!
    • ...could this be why some people get this error sometimes and we scratch our heads?
  2. The batch file has 12 cases of missing the closing double-quote: "%gamedir%. I am not sure why this not errors all the time.
  3. "Change dir" curiosity: You have in the unrpa and unrpyc sections 2 different styles to use "cd": One time its %gamedir%, the other time "%gamedir%".
    • Could this be the reason for the parens in path problem?
    • Which of the variants is the right one?
    • Why is "change dir" ever needed at this point? I cant see why. :unsure:
Thats all for now. :coffee:
Greets
1. I didn't quite understand what errors I was talking about, it was a long time ago, if about the error described by frozenfeet, then this has nothing to do with the location and type of script launch.
2. These passes are used for a reason. There, the quotation mark is used more like escaping or something like that, if put a closing quotation mark, then it becomes part of the final string, and not the source code. Example: C:\\namegame\game"
3. "%gamedir%" I personally did not find, only the option "%gamedir% - see point 2.
 

VepsrP

Well-Known Member
Modder
Dec 13, 2017
1,387
1,384
Ah dammit. Trying to understand other devs code... :eek: Didn see this. Obviously.
You haven't read Sancho1969's code yet.:HideThePain: He did such a thing there so that no one stole his code, I wonder how he himself does not get lost in this.:KEK:
 
  • Haha
Reactions: "CJ"

Madeddy

Active Member
Dec 17, 2017
838
487
1. I didn't quite understand what errors I was talking about,...
Did i describe this so bad? :oops:
Thats not about some error from a specific user. What i describe is a general bug and how to trigger it. On my system at least.
2. ...There, the quotation mark is used more like escaping or something like that, if put a closing quotation mark, then it becomes part of the final string, and not the source code.
Quotes becoming part of the string is only correct if you SET a variable. I am talking about calling it, where the quotes are needed if the variable string contains white space characters. See:
Having no closing quotes on a var is like a missing python closing parens. Example from UnRen:
if exist "%pythondir%Lib" (
"%pythondir%python.exe" -O "%rpatool%" -r "%gamedir%
) else (
"%pythondir%python.exe" "%rpatool%" -r "%gamedir%
)
I have no proof so far, but i believe this could be the reason for all the problems with special chars in the path name.
3. "%gamedir%" I personally did not find, only the option "%gamedir% - see point 2.
Really? My editors search function does this for me.
Line 213, 238, 351: cd %gamedir% or cd %currentdir% - no quotes
Line 307: cd "%gamedir%" - quotes
Which variant is the correct one? With or without quotes? I believe WITH quotes is it. The orginal UnRen uses just two times unquoted var calls (titel and titel echo lines) and there where not much problems with the app back in the days...

(All echo lines from 312-342 have also %gamedir% in use, but i think they're unimportant for the correct function.)
 
Last edited:
5.00 star(s) 3 Votes