Jump to content

Hi! I'm new here and am having some issues modding my Sims 4 game.


Recommended Posts

Posted

I discovered that I can add one of my kinks to my gameplay if I can just crack open and edit the right .pyc files. I tried following the advice from this guide only to arrive at messages like this:

 

[img]https://i.ibb.co/02WbnF4/wtf-am-I-doing-wrong.png[/img]

It looks to me as if I've been doing everything right and I am so confused. Can someone please help?

 

Extra information: I am using Python and Uncompyle6 and I also have Notepad++ and Pycharm on hand like the guide mentions.

Posted

You did the part to install uncompyle6 the right way?

 -> C:\python37\python.exe -m pip install uncompyle6

 

Your PowerShell is telling you python can't find uncompyle6.exe inside the scripts folder.

Posted
2 hours ago, Estarra said:

You did the part to install uncompyle6 the right way?

 -> C:\python37\python.exe -m pip install uncompyle6

 

Your PowerShell is telling you python can't find uncompyle6.exe inside the scripts folder.

I'll try that again. I'm pretty sure I attempted that and still got an error message. I'll uninstall uncompyle6 and then reinstall it in the correct destination folder again.

Posted
2 hours ago, Estarra said:

You did the part to install uncompyle6 the right way?

 -> C:\python37\python.exe -m pip install uncompyle6

 

Your PowerShell is telling you python can't find uncompyle6.exe inside the scripts folder.

I corrected that mistake but now I have arrived at a new error.

[img]https://i.ibb.co/7vyHY02/still-doing-something-wrong.png[/img]

 

still doing something wrong.PNG

Posted
2 hours ago, Estarra said:

Are you sure you've installed python 3.7 and not 3.10?

Python isn't known for its backward compatibility and if they say you have to run something in 3.7 that's most likely the case.

 

https://www.python.org/downloads/release/python-3712/

Thank you so much for the help. ^^ No, I do not think I have the 3.7 version. Is .pyc an older file type? I heard someone saying that no one uses it anymore. So maybe I should have thought of trying the older python sooner.

Posted
3 minutes ago, HanaImakura said:

Thank you so much for the help. ^^ No, I do not think I have the 3.7 version. Is .pyc an older file type? I heard someone saying that no one uses it anymore. So maybe I should have thought of trying the older python sooner.

The .pyc contains the bytecode for its counterpart .py file.

They make execution faster since Python can skip the "compiling" at runtime.

 

Python likes to break stuff with every new version, which means most times you have to use the version the script was written for.

Posted
3 hours ago, Estarra said:

The .pyc contains the bytecode for its counterpart .py file.

They make execution faster since Python can skip the "compiling" at runtime.

 

Python likes to break stuff with every new version, which means most times you have to use the version the script was written for.

I can't seem to install the older version???

Posted
25 minutes ago, HanaImakura said:

I tried using that but this keeps happening? How do I stop this?

more issues.PNG

Try moving the files to another location outside the users folder.

From what I understand the problem lies in the path.

More precisely the "\U" after C: which python interprets as an escape character.

 

7 minutes ago, HanaImakura said:

I can't seem to install the older version???

There shouldn't be any problem installing multiple versions as long as you keep each in their own folder.

I've got one folder called Python which contains a subfolder for each installed version (C:\Python\Python27, C:\Python\Python37, C:\Python\Python310, ...).

If you used the installer, Python should show up under Apps and Features where you can try to uninstall it first.

Posted
2 hours ago, Estarra said:

Try moving the files to another location outside the users folder.

From what I understand the problem lies in the path.

More precisely the "\U" after ? which python interprets as an escape character.

 

There shouldn't be any problem installing multiple versions as long as you keep each in their own folder.

I've got one folder called Python which contains a subfolder for each installed version (C:\Python\Python27, C:\Python\Python37, C:\Python\Python310, ...).

If you used the installer, Python should show up under Apps and Features where you can try to uninstall it first.

The older version of Python doesn't offer any way to actually install it that I can see??

 

And I tried moving the files. I'm still having problems.

i moved the files.PNG

Posted
7 hours ago, HanaImakura said:

The older version of Python doesn't offer any way to actually install it that I can see??

 

And I tried moving the files. I'm still having problems.

i moved the files.PNG

When you launch the installer for a python version it should give you two options.

First is "Install Now" which puts python inside your user folder.

Second there is "Customize installation" which lets you choose install location and other options.

 

grafik.png.2a4c77bb4e24ce406b16bc37665bd69a.png

 

  Every installer only contains one version, you have to download the specific installer for the version you want.

When installing you shouldn't use the option to add Python to PATH except for maybe the Version you work with most the time.

 

For the Uncompyle6 stuff you want version 3.7.

 

PyCharm officially needs version 2.7 or soemthing between 3.6 and 3.10.

Your run output says it uses version 3.9 which should be good for PyCharm.

While testing, the decompile script wouldn't run with 3.9 and I also had to use version 3.7.

 

I'd say make sure you have version 3.7 installed somewhere.

 

 

Now, in your case the error message suggests another problem too.

Did you modify something inside the settings.py except the line with should_decompile_ea_scripts?

Unless the script doesn't detect the right paths to your game and mod folder, you shouldn't have to change anything else.

Posted

The error you posted makes no sense to me. The code is simple and there is no \U sequence in the path for sure. Unless your $HOME parameter is set differently.
    # Mac

    mods_folder = os.path.join(os.environ['HOME'], 'Documents', 'Electronic Arts', 'The Sims 4', 'Mods')  # line 44
    print(f'Mods folder path: {mods_folder}')  # line 45


Are you using a Mac or Win11? For Win10 os.name is usually 'nt' and there is no unicode in the environment variables.
 

https://www.python.org/downloads/release/python-370/ is the 3.7 installer. I hope that it helps to run it with Python 3.7 instead of 3.9.

Posted
17 minutes ago, Oops19 said:

The error you posted makes no sense to me. The code is simple and there is no \U sequence in the path for sure. Unless your $HOME parameter is set differently.
    # Mac

    mods_folder = os.path.join(os.environ['HOME'], 'Documents', 'Electronic Arts', 'The Sims 4', 'Mods')  # line 44
    print(f'Mods folder path: {mods_folder}')  # line 45


Are you using a Mac or Win11? For Win10 os.name is usually 'nt' and there is no unicode in the environment variables.
 

https://www.python.org/downloads/release/python-370/ is the 3.7 installer. I hope that it helps to run it with Python 3.7 instead of 3.9.

The \U which Python thinks to recognize is the one in "C:\User". 

Moving the files somewhere else should be easier than tampering with the script.

This was a problem with the first attempt to decompile the files with Uncompyle6.

 

The current error with PyCharm looks like "mods_folder" inside print was changed.

At least thats how I could reproduce the Error.

 

Posted
4 hours ago, Estarra said:

The \U which Python thinks to recognize is the one in "C:\User". 

Moving the files somewhere else should be easier than tampering with the script.

This was a problem with the first attempt to decompile the files with Uncompyle6.

 

The current error with PyCharm looks like "mods_folder" inside print was changed.

At least thats how I could reproduce the Error.

 

The string is built with os.path.join() and Python will build a proper string. This works for everyone so far.
With a='c::\user...' the error is 'SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \uXXXX escape'
For a='\user...' the error is also 'position 0-1: truncated \uXXXX escape' - 4 XXXX and not 8 XXXXXXXX.

For Mac the path would be /user/... so it seems that the VM or whatever is used has some issues. Maybe BOM is prepended before 'C:'.

Posted
17 minutes ago, Oops19 said:

The string is built with os.path.join() and Python will build a proper string. This works for everyone so far.
With a='c::\user...' the error is 'SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \uXXXX escape'
For a='\user...' the error is also 'position 0-1: truncated \uXXXX escape' - 4 XXXX and not 8 XXXXXXXX.

For Mac the path would be /user/... so it seems that the VM or whatever is used has some issues. Maybe BOM is prepended before 'C:'.

I think we're meaning different things.

The unicode problem was only with the first decode attempt, using the guide linked in the first post.

After moving the files the new problem was with the wrong Python version.

 

That's unrelated with the current problem with PyCharm.

The error here is:

-> NameError: name 'D' is not defined

 

From the output shown above I guessed they changed something more in the settings.py file than one has to change normally.

 

Also the system should be Windows, based on folders used in the screenshots above.

-> C:\Users\... and D:\...

Posted
22 hours ago, Estarra said:

When you launch the installer for a python version it should give you two options.

First is "Install Now" which puts python inside your user folder.

Second there is "Customize installation" which lets you choose install location and other options.

 

grafik.png.2a4c77bb4e24ce406b16bc37665bd69a.png

 

  Every installer only contains one version, you have to download the specific installer for the version you want.

When installing you shouldn't use the option to add Python to PATH except for maybe the Version you work with most the time.

 

For the Uncompyle6 stuff you want version 3.7.

 

PyCharm officially needs version 2.7 or soemthing between 3.6 and 3.10.

Your run output says it uses version 3.9 which should be good for PyCharm.

While testing, the decompile script wouldn't run with 3.9 and I also had to use version 3.7.

 

I'd say make sure you have version 3.7 installed somewhere.

 

 

Now, in your case the error message suggests another problem too.

Did you modify something inside the settings.py except the line with should_decompile_ea_scripts?

Unless the script doesn't detect the right paths to your game and mod folder, you shouldn't have to change anything else.

I downloaded Python 3.7.1. I'm going to try to see if that will help to change anything using the guide I linked to. Then, if that doesn't work, I'll try the other solutions. The guide for the other decompiler said to change most of the instances of "decompile_ea_scripts=false" to "true" and that was what I did.

Posted
16 hours ago, Estarra said:

I think we're meaning different things.

The unicode problem was only with the first decode attempt, using the guide linked in the first post.

After moving the files the new problem was with the wrong Python version.

 

That's unrelated with the current problem with PyCharm.

The error here is:

-> NameError: name 'D' is not defined

 

From the output shown above I guessed they changed something more in the settings.py file than one has to change normally.

 

Also the system should be Windows, based on folders used in the screenshots above.

-> C:\Users\... and D:\...

I'm back and this is what I got with Python 3.7.1 and uncompyle6... I'm going to try starting from scratch.

new issues.PNG

Posted
17 hours ago, Estarra said:

I think we're meaning different things.

The unicode problem was only with the first decode attempt, using the guide linked in the first post.

After moving the files the new problem was with the wrong Python version.

 

That's unrelated with the current problem with PyCharm.

The error here is:

-> NameError: name 'D' is not defined

 

From the output shown above I guessed they changed something more in the settings.py file than one has to change normally.

 

Also the system should be Windows, based on folders used in the screenshots above.

-> C:\Users\... and D:\...

Update:

 

After I deleted/uninstalled all the Python and Uncompyle6 stuff and started from scratch with the guide I linked to, I'm finally getting the files decompiled! I'll be back if I run into more errors since I am obviously new to Python but thank you so so so soooooo much!!! You've been a huge help. ^^

Posted
20 hours ago, Estarra said:

I think we're meaning different things.

The unicode problem was only with the first decode attempt, using the guide linked in the first post.

After moving the files the new problem was with the wrong Python version.

 

That's unrelated with the current problem with PyCharm.

The error here is:

-> NameError: name 'D' is not defined

 

From the output shown above I guessed they changed something more in the settings.py file than one has to change normally.

 

Also the system should be Windows, based on folders used in the screenshots above.

-> C:\Users\... and D:\...

I ran into a new problem but I'm sure this one should be easier to solve. No matter what I enter, it says I am wrong and won't let me proceed. The credentials request also will not go away. I attempted to restart PowerShell and got the same reaction when I tried to run the code again. I don't know what to do about it and cannot proceed unless it goes away.

new problem.PNG

Posted
13 hours ago, HanaImakura said:

I ran into a new problem but I'm sure this one should be easier to solve. No matter what I enter, it says I am wrong and won't let me proceed. The credentials request also will not go away. I attempted to restart PowerShell and got the same reaction when I tried to run the code again. I don't know what to do about it and cannot proceed unless it goes away.

new problem.PNG

You're trying to rename all the .pyc.py to just .py right?

Following the guide linked in your first post?

 

The command you use in your screenshot doesn't look like the one from the guide and contains -C after rename-item which is interptered as -Credential, which asks for the provided user.

In your case the \Python\Sims4GuineaPigs after the -C: as seen in the request window.

 

To rename your files just switch to the folder where you keep the decompiled files

The command you used set-location c:\python should be ok.

If you keep the files inside the Sims4GuinePigs folder it would be better to specify that

set-location c:\python\sims4guineapigs

 

After that execute

Get-ChildItem -File -Recurse | % { Rename-Item -Path $_.PSPath -NewName $_.Name.replace(".pyc.py",".py")}

like it's written in the guide and it should work.

Posted
7 hours ago, Estarra said:

You're trying to rename all the .pyc.py to just .py right?

Following the guide linked in your first post?

 

The command you use in your screenshot doesn't look like the one from the guide and contains -C after rename-item which is interptered as -Credential, which asks for the provided user.

In your case the \Python\Sims4GuineaPigs after the -C: as seen in the request window.

 

To rename your files just switch to the folder where you keep the decompiled files

The command you used set-location c:\python should be ok.

If you keep the files inside the Sims4GuinePigs folder it would be better to specify that

set-location c:\python\sims4guineapigs

 

After that execute

Get-ChildItem -File -Recurse | % { Rename-Item -Path $_.PSPath -NewName $_.Name.replace(".pyc.py",".py")}

like it's written in the guide and it should work.

I copied what I saw on the guide and it was doing that. I'll try again with your advice here though.

Posted
7 hours ago, Estarra said:

You're trying to rename all the .pyc.py to just .py right?

Following the guide linked in your first post?

 

The command you use in your screenshot doesn't look like the one from the guide and contains -C after rename-item which is interptered as -Credential, which asks for the provided user.

In your case the \Python\Sims4GuineaPigs after the -C: as seen in the request window.

 

To rename your files just switch to the folder where you keep the decompiled files

The command you used set-location c:\python should be ok.

If you keep the files inside the Sims4GuinePigs folder it would be better to specify that

set-location c:\python\sims4guineapigs

 

After that execute

Get-ChildItem -File -Recurse | % { Rename-Item -Path $_.PSPath -NewName $_.Name.replace(".pyc.py",".py")}

like it's written in the guide and it should work.

Using your post worked better than the guide. Thank you. ^^

Posted
17 hours ago, Estarra said:

You're trying to rename all the .pyc.py to just .py right?

Following the guide linked in your first post?

 

The command you use in your screenshot doesn't look like the one from the guide and contains -C after rename-item which is interptered as -Credential, which asks for the provided user.

In your case the \Python\Sims4GuineaPigs after the -C: as seen in the request window.

 

To rename your files just switch to the folder where you keep the decompiled files

The command you used set-location c:\python should be ok.

If you keep the files inside the Sims4GuinePigs folder it would be better to specify that

set-location c:\python\sims4guineapigs

 

After that execute

Get-ChildItem -File -Recurse | % { Rename-Item -Path $_.PSPath -NewName $_.Name.replace(".pyc.py",".py")}

like it's written in the guide and it should work.

I ave one other question now if that's okay. Maybe a few, actually. I'm trying to mess around with the physical growth of Sims with the body sliders. Do you happen to know where they are located or what they are called in the py files?

 

I am also having trouble compiling my edited files. I did not have these issues when I compiled the first mod in the tutorial.

 

Also, these lines of code are what I am currently thinking are the parameters that affect the growth that I am looking for.

 

class SimInfo(SimInfoWithOccultTracker, SimInfoCreationSource.SimInfoCreationSourceMixin, AgingMixin, PregnancyClientMixin, SimInfoFavoriteMixin, ComponentContainer, HasStatisticComponent):

    class BodyBlendTypes(enum.Int, export=False):
        BODYBLENDTYPE_HEAVY = 0
        BODYBLENDTYPE_FIT = 1
        BODYBLENDTYPE_LEAN = 2
        BODYBLENDTYPE_BONY = 3
        BODYBLENDTYPE_PREGNANT = 4
        BODYBLENDTYPE_HIPS_WIDE = 5
        BODYBLENDTYPE_HIPS_NARROW = 6
        BODYBLENDTYPE_WAIST_WIDE = 7
        BODYBLENDTYPE_WAIST_NARROW = 8

powershell sucks.PNG

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...