|
Post by MizoreYukii on Mar 10, 2021 19:20:24 GMT -5
I'm not sure what you mean by timeline (do you mean an active career? or something similar to owning stores?) but with your description you would only need Python for injecting interactions, which XML Injector can handle. If you don't want to use XML Injector, this thread should help with injecting interactions. To actually make interactions, etc. take a look at Zero's tutorials. There are no tutorials on making careers of any kind by hand in S4S, only making rabbithole careers with Mod Constructor or Create-a-Career, which you should be able to use as a starting point and then have to make everything else you want by hand, depending on what it is you want to do. More resources to help you get started, start with something small like traits to get you familiar with the process. TuningScarlet's Beginner tutorials (starting on page 2): www.simsvip.com/category/the-sims-4/how-to-create-a-mod/page/2/Zer0's tutorials (for beginners and beginning intermediate, covers social interactions, buffs, Mod Constructor and much more): www.patreon.com/posts/tutorials-35031545www.patreon.com/posts/mod-constructor-45356828How to Start a Custom Tuning File: www.patreon.com/posts/how-to-start-38023976How to Add Custom Icons to Your Mod: www.patreon.com/posts/how-to-add-icons-42171247How to Unlock Interactions: www.patreon.com/posts/how-to-unlock-38446873And then you need the TDESCs and TDESC Browser as it helps you understand how files are built and what each thing does. Zer0’s tutorials linked above have 3 different tutorials on how to use the TDESC, so make sure to read them to understand how TDESCs work. Or download one of the programs. TDESCs: forums.thesims.com/en_US/discussion/980807/1-66-139-tdescs#latestTDESC Browser (Windows): www.modthesims.info/download.php?&t=618199TDESC Browser (Mac): modthesims.info/d/649060/tuning-description-browser-for-macos.htmlHow to Properly Setup the TDESC Browser: www.patreon.com/posts/how-to-properly-42170948XML Extractor if you want to update or make new mods before S4S updates, and XML File Finder (needs the extractor and in the same download) to see connections/references between each file without having to manually search for them. File Finder is very useful and highly recommended, even if you don’t use the XML Extractor for modding. modthesims.info/d/563256/xml-extractor-for-the-sims-4.htmlTuning Error Notifier is to help you make sure you don’t make mistakes. scumbumbomods.com/tuning-error-notifier/There are tools that handle injecting for you for common areas, so you don’t need to focus on scripting until the time is right. This includes: XML Injector: (interactions, loots, buffs to traits, reward traits, name objects, object relationships, states): scumbumbomods.com/xml-injector/Injection Tools (for situations, walk-bys, etc.): brainblasted.itch.io/injection-toolsAndrew’s Crafting Enabler (for injecting recipes like food, books, etc.): sims4studio.com/post/72754Mod Constructor: (not an injector, except where needed, but can be used to make interactions, buffs, traits, careers, aspirations, events, and a few others): zerbu.tumblr.com/post/181782526135/the-sims-4-mod-constructor-v4ScriptingWhen you are ready for Sims 4 scripting, know that there are very little tutorials and no documentation, so you have to learn through a lot of trial and error. You will need to learn Python, which is well documented and has plenty of tutorials outside of Sims 4, but it won’t help too much with Sims 4’s data. Beginner's Guide to Python: wiki.python.org/moin/BeginnersGuideGetting Started with Sims 4 Python Scripting: sims4studio.com/thread/15145/started-python-scriptingTuning Inspector, which helps you figure out injection paths: modthesims.info/d/642704/tuning-inspector.htmlThe Sims 4 Modern Python Modding is a new scripting tutorial series that will help teach you about Sims 4 scripting, including getting started to more difficult projects: Part 1 Yes, an active career. Since there are no tutorials for active careers, you should take apart EA's existing careers or mod active careers as guidance. Two of the ones I can think of are Turbo Careers and Get to College.
|
|
|
Post by frankk on Apr 9, 2021 9:08:28 GMT -5
Hello! Firstly, thanks a bunch for the starter project, Andrew - it makes things very easy. However, there is a small issue I noticed in the compiling code a while back, and figured I would leave a note about it here in hopes that you can update the project.
The issue comes up when modders organize their scripts into packages. The `compile_module` function in `Utilities/__init__.py` compiles every package once, including all of its subpackages. This results in duplicated files in the compiled ts4script. So, if you have the following package structure:
package_A - file_1 - package_B --- file_2 - package_C --- file_3
The compiled ts4script will contain 2 copies of each file_2 and file_3, and one copy of file_1. The duplicated code can, and in most cases will, cause issues. The fix for this is quite simple, I've been using it since I started modding and it's never failed me. If you replace the following:
for folder, subs, files in os.walk(src): zf.writepy(folder)
with simply this:
zf.writepy(src)
It will compile all of the scripts correctly, both with and without packages: `writepy` already compiles the entire directory and all of its children, so the `for` loop is redundant in this case. I've mentioned this change to quite a few people when I help them get started with scripting, so it'd be great to have this change in the project itself! Thanks.
Another very small note, but it'd also be nice to note that if you change `optimize=2` to `optimize=1` in the PyZipFile, it will leave in docstrings. This is another good change because it allows modders to leave in documentation and terms of use notices for anyone who happens to decompile their scripts.
(P.S. Also, the `compiler.py` file isn't actually used for anything, so you can probably get rid of it. Whenever you import Utilities, you're just using the code in `Utilities/__init__.py`, which is exactly the same as `compiler.py`)
|
|
|
Post by isabel2 on May 23, 2021 2:04:24 GMT -5
Where do I go after this? Is there any documentation for scripting? How do I make what I wanna make now?
|
|
|
Post by frankk on May 25, 2021 7:11:39 GMT -5
Where do I go after this? Is there any documentation for scripting? How do I make what I wanna make now? Depends on what you want to make - most mods do not actually require a script, and many common scripting tasks can be achieved through tuning by using XML Injector by Scumbumbo and TriplisThere is no documentation for Sims 4 scripting, but there are some script tutorials available. The best way to learn scripting for TS4 is to look through the decompiled code and experiment for yourself, but you can also ask other modders for help, we're very active on Discord. The Creator Musings server for example is a great resource: discord.gg/qxz5Kn5
|
|
|
Post by thedreamersims on Sept 27, 2021 9:52:31 GMT -5
Hi, new aspiring modder here. I'm Bri. I am stuck at the decompile portion. It does not decompile and I get three errors. I'm using a windows MSI laptop. Not sure if that's needed, but wanted to let that be known just in case  My mods folder is located in documents but the Program Files are located in the exact same place as the settings already were so I didn't change anything. I don't know if i am supposed to, I'm new to python as a whole and I'm trying to learn as I go. The Error: Traceback (most recent call last): File "C:\Users\B\Desktop\Sims 4 Python Script Workspace\decompile_all.py", line 1, in <module> from Utilities import extract_folder File "C:\Users\B\Desktop\Sims 4 Python Script Workspace\Utilities\__init__.py", line 6, in <module> from Utilities.unpyc3 import decompile File "C:\Users\B\Desktop\Sims 4 Python Script Workspace\Utilities\unpyc3.py", line 77, in <module> SETUP_LOOP, BREAK_LOOP, CONTINUE_LOOP, NameError: name 'SETUP_LOOP' is not defined Process finished with exit code 1 This is what I changed the settings.py to: import os
creator_name = 'Simplybrix'
mods_folder = os.path.expanduser(
os.path.join('~', 'Documents', 'Electronic Arts', 'The Sims 4', 'Mods')
)
game_folder = os.path.join('C:', os.sep, 'Program Files (x86)', 'Origin Games', 'The Sims 4')
As you can see, I really didn't change anything. :/ Thanks in advance for your help.
|
|
|
Post by peter1011 on Jan 21, 2022 5:32:36 GMT -5
Hello, I'm not new to python but I'm new to mod creation. I'm looking for a way to create an extended pie menu from every sim computer which can:
1. adjust funds households (deduct and add) 2. get information from the real world internet like weather temperature (via API pipe)
Which tutorial should I go to?
Many thanks!
|
|
|
Post by peter1011 on Jan 21, 2022 11:12:16 GMT -5
I have python 3.7.4 and run it, the compiler seems fine. But nothing shows up on the cheat screen, what happens?
|
|
|
Post by rcmxnn on Jun 20, 2022 18:14:25 GMT -5
Hi there! I know that this is an older forum but I thought I would try anyways to see if I might get some help. I am working on a Macbook Pro. I got up to step 8 and have been experiencing an issue with decompling the files. Now, I know I might have done something wrong with the path file when adding an interpreter but I am not sure what and I cannot find any help because I do not know what exactly the problem is only that I am not getting the correct reponse when trying to run the decompile.py
/usr/local/bin/python3.10 "/Users/myname/Desktop/poo for Python/Sims 4 Python Script Workspace/decompile_all.py" Traceback (most recent call last): File "/Users/myname/Desktop/poo for Python/Sims 4 Python Script Workspace/decompile_all.py", line 1, in <module> from Utilities import extract_folder File "/Users/myname/Desktop/poo for Python/Sims 4 Python Script Workspace/Utilities/__init__.py", line 6, in <module> from Utilities.unpyc3 import decompile File "/Users/myname/Desktop/poo for Python/Sims 4 Python Script Workspace/Utilities/unpyc3.py", line 77, in <module> SETUP_LOOP, BREAK_LOOP, CONTINUE_LOOP, NameError: name 'SETUP_LOOP' is not defined
That is the issue I am seeing. If anyone has any tips I would be very greatful.
|
|
|
Post by MizoreYukii on Jun 20, 2022 21:27:08 GMT -5
Hi there! I know that this is an older forum but I thought I would try anyways to see if I might get some help. I am working on a Macbook Pro. I got up to step 8 and have been experiencing an issue with decompling the files. Now, I know I might have done something wrong with the path file when adding an interpreter but I am not sure what and I cannot find any help because I do not know what exactly the problem is only that I am not getting the correct reponse when trying to run the decompile.py /usr/local/bin/python3.10 "/Users/myname/Desktop/poo for Python/Sims 4 Python Script Workspace/decompile_all.py" Traceback (most recent call last): File "/Users/myname/Desktop/poo for Python/Sims 4 Python Script Workspace/decompile_all.py", line 1, in <module> from Utilities import extract_folder File "/Users/myname/Desktop/poo for Python/Sims 4 Python Script Workspace/Utilities/__init__.py", line 6, in <module> from Utilities.unpyc3 import decompile File "/Users/myname/Desktop/poo for Python/Sims 4 Python Script Workspace/Utilities/unpyc3.py", line 77, in <module> SETUP_LOOP, BREAK_LOOP, CONTINUE_LOOP, NameError: name 'SETUP_LOOP' is not defined That is the issue I am seeing. If anyone has any tips I would be very greatful. Might not solve your problem, but make sure to switch to 3.7, 3.10 is not supported by the game. Frankk posted this for Mac users in my creator help server, unsure if this will solve your issue though:
|
|
|
Post by sherimyler on Jul 7, 2022 17:27:04 GMT -5
I'm new to Python and trying to make mods.
Upon reaching step 8:
"8. Before trying to create a script of your own, it is best to first extract the ones from the game. Not only can you look to them for examples, but also having them extracted will allow PyCharm to assist you while creating your own scripts. To extract the game scripts, right-click the decompile_all.py and select "Run 'decompile_all'". You will see a log at the bottom of the screen written for each decompiled file. Wait until it has finished before continuing to the next step."
I click to "Run `decompile.all`" and get the following error message:
"NameError: name 'SETUP_LOOP' is not defined
Process finished with exit code 1"
The full text in the box at the bottom is:
"C:\Users\User\AppData\Local\Programs\Python\Python310\python.exe "C:/Users/User/OneDrive/Desktop/Python/Sims 4 Python Script Workspace/decompile_all.py"
Traceback (most recent call last):
File "C:\Users\User\OneDrive\Desktop\Python\Sims 4 Python Script Workspace\decompile_all.py", line 1, in <module>
from Utilities import extract_folder
File "C:\Users\User\OneDrive\Desktop\Python\Sims 4 Python Script Workspace\Utilities\__init__.py", line 6, in <module>
from Utilities.unpyc3 import decompile
File "C:\Users\User\OneDrive\Desktop\Python\Sims 4 Python Script Workspace\Utilities\unpyc3.py", line 77, in <module>
SETUP_LOOP, BREAK_LOOP, CONTINUE_LOOP,
NameError: name 'SETUP_LOOP' is not defined
Process finished with exit code 1"
I tried deleting and re-downloading the three programs from the links and restarting my laptop, to no avail.
I'd be grateful for any help.
|
|
|
Post by jarilive on Jul 11, 2022 13:23:45 GMT -5
Hi, I have seen that multiple people had this issue, and I have the same, but I haven't seen any way to fix it.
Does someone know how I can fix this error?
"C:\Users\jarid\AppData\Local\Programs\Python\Python37\python.exe "C:/Users/jarid/Documents/De Sims 4 Meuk/Pycharm Sims Project Folder/Sims 4 Python Script Workspace/My Script Mods/Example Mod/compile.py" Traceback (most recent call last): File "C:/Users/jarid/Documents/De Sims 4 Meuk/Pycharm Sims Project Folder/Sims 4 Python Script Workspace/My Script Mods/Example Mod/compile.py", line 5, in <module> compile_module(creator_name, root, mods_folder) File "C:\Users\jarid\Documents\De Sims 4 Meuk\Pycharm Sims Project Folder\Sims 4 Python Script Workspace\Utilities\__init__.py", line 62, in compile_module shutil.copyfile(ts4script, ts4script_mods) File "C:\Users\jarid\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 121, in copyfile with open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\jarid\\Documents\\Electronic Arts\\The Sims 4\\Mods\\JariLive_Example Mod.ts4script'
Process finished with exit code 1"
It isn't a that big issue since I can move the file myself but it would be nice if I wouldn't need to do that.
Thanks in advance!!
|
|
|
Post by shreditdude on Aug 5, 2022 2:57:34 GMT -5
I'm new to Python and trying to make mods. Upon reaching step 8: "8. Before trying to create a script of your own, it is best to first extract the ones from the game. Not only can you look to them for examples, but also having them extracted will allow PyCharm to assist you while creating your own scripts. To extract the game scripts, right-click the decompile_all.py and select "Run 'decompile_all'". You will see a log at the bottom of the screen written for each decompiled file. Wait until it has finished before continuing to the next step." I click to "Run `decompile.all`" and get the following error message: "NameError: name 'SETUP_LOOP' is not defined Process finished with exit code 1" The full text in the box at the bottom is: "C:\Users\User\AppData\Local\Programs\Python\Python310\python.exe "C:/Users/User/OneDrive/Desktop/Python/Sims 4 Python Script Workspace/decompile_all.py" Traceback (most recent call last): File "C:\Users\User\OneDrive\Desktop\Python\Sims 4 Python Script Workspace\decompile_all.py", line 1, in <module> from Utilities import extract_folder File "C:\Users\User\OneDrive\Desktop\Python\Sims 4 Python Script Workspace\Utilities\__init__.py", line 6, in <module> from Utilities.unpyc3 import decompile File "C:\Users\User\OneDrive\Desktop\Python\Sims 4 Python Script Workspace\Utilities\unpyc3.py", line 77, in <module> SETUP_LOOP, BREAK_LOOP, CONTINUE_LOOP, NameError: name 'SETUP_LOOP' is not defined Process finished with exit code 1" I tried deleting and re-downloading the three programs from the links and restarting my laptop, to no avail. I'd be grateful for any help. From the look of it, it looks like you're using Python 3.10 C:\Users\User\AppData\Local\Programs\Python\Python310\python.exe You'll have to download Python 3.7. I use 3.79 and decompiling works fine.
|
|
|
Post by etherias on Aug 9, 2022 5:47:09 GMT -5
Hello!! I also had this error
from Utilities import compile_module ModuleNotFoundError: No module named 'Utilities'
I solved it by adding in decompile_all.py and compile.py the following lines before imports
import sys sys.path.append('C:/Users/your path to/Sims 4 Python Script Workspace') Hope it can help someone
|
|
neowbr
New Member

Hi, I'm new to modding
Posts: 7
|
Post by neowbr on Dec 16, 2022 17:35:53 GMT -5
I'm trying to do the python scripting tutorial, but when I get to the part to run the compile.py, but when I run mine it says FileNotFoundError, should I ignore this?
C:\Users\me\AppData\Local\Programs\Python\Python37\python.exe "C:\Users\me\OneDrive\Documents\Electronic Arts\ProjectFolder\Sims 4 Python Script Workspace\My Script Mods\Example Mod\compile.py"
Traceback (most recent call last):
File "C:\Users\me\OneDrive\Documents\Electronic Arts\ProjectFolder\Sims 4 Python Script Workspace\My Script Mods\Example Mod\compile.py", line 5, in <module>
compile_module(creator_name, root, mods_folder)
File "C:\Users\me\OneDrive\Documents\Electronic Arts\ProjectFolder\Sims 4 Python Script Workspace\Utilities\__init__.py", line 62, in compile_module
shutil.copyfile(ts4script, ts4script_mods)
File "C:\Users\me\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\me\\Documents\\Electronic Arts\\The Sims 4\\Mods\\neowbr_Example Mod.ts4script'
Process finished with exit code 1
I've been at this for days and I really want to complete a tutorial, the last one I tried didn't work and with this one I'm just a step away. So, could someone help me please?
|
|
|
Post by blackmoonsims on Jan 25, 2023 8:14:14 GMT -5
I'm trying to do the python scripting tutorial, but when I get to the part to run the compile.py, but when I run mine it says FileNotFoundError, should I ignore this? C:\Users\me\AppData\Local\Programs\Python\Python37\python.exe "C:\Users\me\OneDrive\Documents\Electronic Arts\ProjectFolder\Sims 4 Python Script Workspace\My Script Mods\Example Mod\compile.py" Traceback (most recent call last): File "C:\Users\me\OneDrive\Documents\Electronic Arts\ProjectFolder\Sims 4 Python Script Workspace\My Script Mods\Example Mod\compile.py", line 5, in <module> compile_module(creator_name, root, mods_folder) File "C:\Users\me\OneDrive\Documents\Electronic Arts\ProjectFolder\Sims 4 Python Script Workspace\Utilities\__init__.py", line 62, in compile_module shutil.copyfile(ts4script, ts4script_mods) File "C:\Users\me\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 121, in copyfile with open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\me\\Documents\\Electronic Arts\\The Sims 4\\Mods\\neowbr_Example Mod.ts4script' Process finished with exit code 1 I've been at this for days and I really want to complete a tutorial, the last one I tried didn't work and with this one I'm just a step away. So, could someone help me please? I haven't done this tutorial yet myself and I'm a complete noob when it comes to scripting and python, but do you have an option in your file explorer called This PC? That's the main folder that pops up when I use my computer and do things on it. It's similar to the users\me\documents way and has all the same stuff, but maybe it won't error out if you use that.
If you have windows 10 and your file explorer shows:
-quick access -One Drive -This PC
on it's side panel, just click the documents option under This PC and navigate to -->electronic arts>The Sims 4>Mods for the directory location. I hope this works.
Edit: OH also, you are navigating to your one drive location for the python script. Did you save it on your computer hard drive or just in the cloud? Instead of using the cloud to do this, try navigating directly to the python script workspace location on your hard drive.
If you've already figured this out, you can ignore me XD
|
|