Quick Reply
Search this Thread
One horse disagreer of the Apocalypse
Original Poster
#1 Old 24th Feb 2016 at 5:16 PM
Default Pycharm project from decompiled ts4 scripts
Has anyone had any success turning the decompiled scripts into a pycharm project? Any tutorial etc for doing so? I tried starting a project then dumping the files in there but it just red-wiggled on all the references and couldn't see the files referred to, even tho they were sitting there in the same folder lol.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Lab Assistant
#2 Old 24th Feb 2016 at 11:10 PM
Do your decompiled files have the .pyo.py extension the batch extractor gives them? If you want them to work in a project, at the very least you need to rename them to remove the .pyo part of the filename.

Also, I believe you need to keep the same folder structure, just dropping all files and folders from each of the zip files into a single place. If you are importing, for example, sims.outfits.outfit_utils , then it should be a file named outfit_utils.py in the \sims\outfits\ folder.

If neither of those is the issue then I'm afraid I can't be of help. I don't use any IDE myself, as I tend to only do small tweaks for my own use.

(The extensions being wrong is part of the reason I made my own batch to decompile the files, actually, which you can find in this post. Though I don't use an IDE, I prefer the file names to closely mirror what would be expected by the game, and I got tired of renaming them every time I decompiled them.)
Deceased
#3 Old 25th Feb 2016 at 7:56 AM
Try right-clicking the core and simulation folders in your project and choosing "Mark Directory As" then "Sources Root".

You don't need to include the base folder in your project btw, as that's just stuff that comes with Python (you should see all that stuff in the External Libraries under Lib in PyCharm).

Never tried PyCharm before, but you piqued my curiosity - looks like it could be kind of nice for browsing through the sources.
One horse disagreer of the Apocalypse
Original Poster
#4 Old 25th Feb 2016 at 8:12 AM Last edited by Inge Jones : 25th Feb 2016 at 10:16 AM.
What I have tried so far is getting rid of the top level folders "simulation" "core" and "base" and laying their contents into the same folder, and then marking all folders and subfolders as source. This resulted in the removal of red lines from the "import <module>" lines but moved them to the classname in the "from <module> import <class>" lines. However, when members of the class are accessed further down the scripts they are not red-wiggling which if this was visual studio would seem to indicate that the import had been understood? Or did it simply give up checking after the import statement errors.

What I haven't done yet is remove the .pyo out of .pyo.py so I will try to find an efficient way to do that - I will try yours, Darkwalker, thanks

Later: Bah! That gives me jaddr is none. I do have it in the same folder as unpycwhatever, along with the other decompiling batches I have used in the past which didn't give that error (but all had various *different* shortcomings lol). However, by manually editing a few filenames, I have confirmed your theory that removing the .pyo from .pyo.py does indeed cure the red-wigglies.

Anyway after running a renaming batch over them, it all works well.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Lab Assistant
#5 Old 25th Feb 2016 at 4:29 PM
Quote: Originally posted by Inge Jones
Later: Bah! That gives me jaddr is none.

Woops, sorry. I just noticed that my version of unpyc3.py isn't the stock one, but Aren's tweaked unpyc3, which is able to produce some result even in files that it can't properly handle. That one is able to partially decompile sims4\tuning\tunable.pyo and simulation\clubs\club_tuning.pyo, which the standard version of unpyc3.py can't handle.
I recommend using that one. In any case, I also changed my batch so it can handle unpyc3 failing without crashing.
One horse disagreer of the Apocalypse
Original Poster
#6 Old 25th Feb 2016 at 5:53 PM
I am glad you told me that cos the next post I was going to write was about tunable.py with nothing but "jaddr is none" on the one single line in it :D

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Test Subject
#7 Old 13th May 2016 at 9:05 AM
Quote: Originally posted by Inge Jones
Has anyone had any success turning the decompiled scripts into a pycharm project? Any tutorial etc for doing so? I tried starting a project then dumping the files in there but it just red-wiggled on all the references and couldn't see the files referred to, even tho they were sitting there in the same folder lol.


You're better off with notepad. The Sims 4 scripts are so circular that you'll have to manually reverse and re-write every line, then launch the game to debug. You might find plain text editors and command prompt to be more efficient.
Back to top