|
Post by luna1220 on Nov 18, 2018 16:44:13 GMT -5
I'm new to all this and I need help with part six. Every time I try to set it up it tells me that the path is invalided and I don't know what to do
|
|
|
Post by andrew on Nov 25, 2018 20:42:47 GMT -5
tedw that is strange that you have two Sims 4 folders. Have you reinstalled recently? britalit now that EA has updated to use a version of Python that can be easily installed on a Mac, I'll try to update the tutorial to include the differences. Until then, you can look at the post above by zembee. ellarose18 I'm glad you got it working now Basemental You're welcome. I've looked a little more at the issue you brought up about the lastException.txt's including the full path of the workspace and found a better way that will allow customization of that. I'll include that in the next update to the workspace along with an updated decompiler that is more accurate. bella1963 can you be a little more specific on which part won't work for you? mollymoon sorry to answer this post so late, but the teleporter is already updated. zembee thanks for the info on the Mac I'm glad that this tutorial helped you even though it did not yet have the Mac specifics. helenp71 you can do this by changing this: mods_folder = os.path.expanduser( os.path.join('~', 'Documents', 'Electronic Arts', 'The Sims 4', 'Mods') )
to this: mods_folder = os.path.join('D:', 'Users', 'your name', 'Documents', 'Python')
Let me know if that doesn't work for you. SrslySims do you happen to have two folders with "Sims 4 Python Workspace"? When you open it in PyCharm, it will need to be on the main one (if the folder opened in PyCharm has a subfolder that it shouldn't, it will cause issues like this). luna1220 can you post the full error message that you received (or a screenshot of it)?
|
|
|
Post by Basemental on Nov 26, 2018 3:50:28 GMT -5
That is fantastic andrew . I kinda gave up on figuring out how to adjust that myself, so what I have been doing instead as a workaround is making sure the folder with the scripts is titled like "Myname - Mymod Version Number" and pull the entire folder into C:/ before compiling so the filepath name comes up as "C:/Myname - Mymod Version Number" in LE's. Having a way to customize that and not having to go that extra step sounds great.
|
|
|
Post by morphar on Nov 27, 2018 12:30:54 GMT -5
Tutorial done successfully. Made my own mod, wow.
Next step, how do I decompile just one .pyc or .pyo file.
|
|
|
Post by Wheatley on Nov 28, 2018 17:26:45 GMT -5
I keep getting this error with the compile.py line 1, in <module> from Utilities import compile_module ModuleNotFoundError: No module named 'Utilities' The Utilities folder is there under the downloaded file structure. Sims 4 Python Script Workspace (3.7) > Sims 4 Python Script Workspace > Utilities Any Idea why this would not be reading the Utilities folder? ; EDIT: I got the compile.py to work by moving the Utilities Folder and the Settings.py to the My Script Mods folder > 'MY MOD' folder along side the compile.py. Hello, I had the same issue than SrslySims and I solved it the same way, but I still can't compile. I have this error now when I try: C:\Users\Nylkaa\AppData\Local\Programs\Python\Python37\python.exe "C:/Users/Nylkaa/Desktop/Lyn/Jeux/Mods Sims/Kaa Mods/Sims 4 Python Script Workspace (3.7)/Sims 4 Python Script Workspace/My Script Mods/Example Mod/compile.py" Traceback (most recent call last): File "C:/Users/Nylkaa/Desktop/Lyn/Jeux/Mods Sims/Kaa Mods/Sims 4 Python Script Workspace (3.7)/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\Nylkaa\Desktop\Lyn\Jeux\Mods Sims\Kaa Mods\Sims 4 Python Script Workspace (3.7)\Sims 4 Python Script Workspace\My Script Mods\Example Mod\Utilities\__init__.py", line 62, in compile_module shutil.copyfile(ts4script, ts4script_mods) File "C:\Users\Nylkaa\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\\Nylkaa\\Documents\\Electronic Arts\\The Sims 4\\Mods\\Nylkaa_Example Mod.ts4script'
Process finished with exit code 1 I thought this was because I'm french, my game and the directory are in french so I tried to replace "The Sims 4" in settings.py by "Les Sims 4" but I keep getting the error even when the directory is 'C:\\Users\\Nylkaa\\Documents\\Electronic Arts\\Les Sims 4\\Mods\\Nylkaa_Example Mod.ts4script' Can someone please tell me where did I go wrong? EDIT : ok so I noticed that the .ts4script file had been created, but in the "Example Mod" directory, so i copied it myself into the "Sims 4 / Mods" directory and tested it in the game and it works!!
|
|
|
Post by lilmxplaguerat on Dec 1, 2018 9:33:33 GMT -5
Hey, I'm just getting into modding and was wondering if anyone could help me find all the .py which have the data for CAS in them so I can use them for reference? So far I'm only managing to find the ones in the simulation folder
|
|
|
Post by jacka5597 on Dec 5, 2018 12:45:19 GMT -5
Silly Question but if i follow this tut would i be able to update career mods which have yet to update?
|
|
|
Post by j4nella on Dec 7, 2018 23:49:41 GMT -5
Thank you so much for this tutorial! I already knew Python, but I was looking to modify some files in the Sims 4. I didn't know where to start. My dream is to work in the video game industry, and I wanted to do some projects on my freetime. I don't think I can thank you enough!!
|
|
|
Post by jupneko on Dec 10, 2018 19:47:41 GMT -5
Hi! Thanks so much. I'm new to making script mods & followed this tutorial.
I've been stuck on trying to get the cheat command in the example mod to work in-game. :'( I did it just as written, and compiled it so that it's in my mods folder, & once I enabled script mods in TS4 it shows up in the list of mods/cc when I start up the game. But when I type the command nothing happens!
Any ideas for what I should try first to troubleshoot?
*** Update: I got it to work! -- I had the same issue as a couple people who posted above, where compile.py wasn't in the right location to read Utilities etc. so I moved it up a couple folders. This was what was causing it to not work, apparently, because I moved compile.py AND Utilities & settings & etc. all into my "Example Mod" folder and compiled it that way, and it works now!
|
|
jezzster64
Member
Feeling sad because the EA update has stopped CAS work :(
Posts: 11
|
Post by jezzster64 on Dec 16, 2018 14:58:39 GMT -5
Thank you for a great introductory tutorial, it's got me started down the scripting route The tutorial obviously meets its purpose, ie 'introductory', but it just wets the appetite with a simple "Hello World" type message. There's very little practical help on the Internet about how to achieve any useful effects from scripting. Is there any chance of you writing some follow up intermediate level tutorials demonstrating how to manipulate the Sims 4 environment in-game? Maybe a discussion about the data structures in the Sims 4 and how to correctly access them with Python? And, as I already said - great tutorial, hopefully more to follow
|
|
|
Post by andrew on Dec 16, 2018 17:55:07 GMT -5
morphar one way that you could do it would be to add a new python script to the main folder with the following code (replacing the pyc_to_decompile_path value with the location of your pyc). import io, os from Utilities import unpyc3
pyc_to_decompile_path = 'enter the path to the pyc file here' with io.open(pyc_to_decompile_path.replace('.pyc', '.py'), 'w') as output_py: for line in unpyc3.decompile(pyc_to_decompile_path): output_py.write(str(line) + '\r')
Wheatley I'm glad that you found a way to get it to work. After changing The Sims 4 to Les Sims 4, was the new path in your error message the correct location of your mods folder? jacka5597 if the career that you are updating has a script that needs to be recompiled for the Get Famous patch, then this tutorial could help. It is also possible that the tuning needs to be updated, which is not covered in this tutorial. j4nella you're welcome. jupneko I'm glad you got it to work. jezzster64 I do plan on writing some followup tutorials to this. Topics I was thinking of are: - Creating a custom object script and linking it to an object made in S4S - Creating an interaction and using a script to add it to a sim If you have any suggestions on specific intermediate tutorials, I could consider them as well.
|
|
|
Post by Mathcope on Dec 26, 2018 22:21:48 GMT -5
Hi andrew! I saw this tutorial back when you posted the first version but hadn't have the courage to try it yet! Thank you so much for the step by step tutorial and all the tools that come with it, I appreciate it a lot since it's my first time trying to get into scripting for the game. (I'm new to coding too, but Python seems a good one to start). I've been trying to add to this tutorial steps and make command that you could type and it would execute one of the EA cheats but I'm not sure how to go about it. For example: I would like to make a command called "makemortal" that would make my Vampire sim remove the trait. EA already has a cheat that does this which is (traits.remove_trait trait_OccultVampire). Since this is tricky to remember I would like to simplify the cheat so when I type my text it would execute that EA cheat besides giving an output text. Is it possible to do? Thank you again!
|
|
|
Post by fufu508 on Dec 26, 2018 23:02:06 GMT -5
Hi Mathcope, I too am keen to learn more about direct/ scripted modifications especially ones that make the game easier to play and more versatile. This might make a good starting point for this proposed project.
|
|
|
Post by Mathcope on Dec 26, 2018 23:47:40 GMT -5
fufu508 Thanks ! I will have a look! Edit: I did have a look at it and works!! Thank you so much. This will make my gameplay much easier. And others if I can finish to share it too . There are some tricky cheats though that I'm not sure how to go about them. Some of them require the sim id from the game. I do know how to get the sim id using a cheat and it is displayed in the console windows. However I don't know how to use this output as an input for my cheat to work. Any ideas? I will try to experiment with it and see what I can find in the mean time.
|
|
|
Post by fufu508 on Dec 27, 2018 8:24:31 GMT -5
Hi Mathcope I don't have time to explore this yet (getting ready to travel for a few days), but I think this, and for a deeper dive, this would be very helpful.
|
|