|
Post by Mathcope on Dec 29, 2018 18:09:17 GMT -5
fufu508 I figured out with one of your links. The first line of code in the first link did the trick! I searched for a way to get the sim id, but it was crucial to first call that line first, the code looks like this: client = services.client_manager().get_first_client() sim_id = client.active_sim.id Then you can do anything with that id, I personally converted it to string with str() to be able to add it in the cheat. The mod is ready to be uploaded! Thanks to you and Andrew again. :D
|
|
|
Post by andrew on Dec 31, 2018 2:25:56 GMT -5
|
|
evvi3
New Member
Posts: 2
|
Post by evvi3 on Jan 14, 2019 1:29:42 GMT -5
andrew Thanks so much for this tutorial! I have a question, though; when I run decompile_all, there are a handful of files that say FAILED TO DECOMPILE X. Is that normal, or do I need to edit something...? >_< I checked on most of them and they seem to be there despite the "failure", but IDK. I had to change my settings file for the game path because I have it on an external ssd: import os
creator_name = 'Evvi' mods_folder = os.path.expanduser( os.path.join('~', 'Documents', 'Electronic Arts', 'The Sims 4', 'Mods') )
game_folder = os.path.join('E:', os.sep, 'Origin Games', 'The Sims 4') Not sure if I did it wrong or not. >_>
|
|
|
Post by andrew on Jan 18, 2019 2:30:16 GMT -5
evvi3 at this time, no decompiler is perfect so some of the python files will fail to decompile. The decompiler used in the tutorial has improved since the tutorial was made and will continue to improve, but is still not perfect. You can download the most current version of unpyc37 from the github page linked at the end of the tutorial and use that instead of the one in the zip file. If you find that one of the modules you need failed to decompile or decompiled incorrectly, let me know and I can take a look at it.
|
|
evvi3
New Member
Posts: 2
|
Post by evvi3 on Jan 18, 2019 13:55:40 GMT -5
andrew That makes sense, thanks so much for your reply! I'm good for now, but will do if anything ever comes up. :D
|
|
|
Post by guischilling15 on Jan 22, 2019 22:14:35 GMT -5
I need a help with something, I want to make a mod to aliens have experience powers like vampires.
Sorry for my bad english.
|
|
|
Post by fufu508 on Jan 23, 2019 19:02:33 GMT -5
I need a help with something, I want to make a mod to aliens have experience powers like vampires. Sorry for my bad english. Hi there, Could you please give more details about "experience powers"? I'm not sure what you are asking. Please feel free to reply in your own language and translate a copy of your reply using Google or other translation service. We have other non English-speaking users here who may be able to help you while still allowing those like myself who only speak English to help too.
|
|
|
Post by guischilling15 on Jan 23, 2019 19:28:11 GMT -5
I want to make a mod for aliens to buy perks and evolve their powers like vampires.
|
|
|
Post by fufu508 on Jan 23, 2019 19:35:52 GMT -5
Okay to clarify further do you want the aliens to advance in their own existing evolutionary steps faster, or do you mean you want aliens to be able to do things/evolve in ways that are normally only for vampires? Or perhaps I still don't understand? I don't play aliens very much except for their exotic looks. I also may not be able to help that much because I don't have the vampires for The Sims. Do you have a specific example of your alien currently and what do you want your alien to have or do as a result of proposed mod?
|
|
|
Post by pixaratv on Jan 25, 2019 14:09:51 GMT -5
When I try to run for example "compile.py", I get this:
line 1, in <module>
from Utilities import compile_module
ModuleNotFoundError: No module named 'Utilities' And I get the Error: "Install packages failed" although I installed the latest pip. Moving the Utilities Folder and the Settings.py didn't help. What can I do?
|
|
|
Post by pixaratv on Jan 25, 2019 14:44:21 GMT -5
When I try to run for example "compile.py", I get this: line 1, in <module>
from Utilities import compile_module
ModuleNotFoundError: No module named 'Utilities' And I get the Error: "Install packages failed" although I installed the latest pip. Moving the Utilities Folder and the Settings.py didn't help. What can I do? Okay my problem was that I opened the first folder "Sims 4 Python Script Workspace (3.7)" instead of the one inside it.
|
|
|
Post by fufu508 on Feb 3, 2019 12:20:50 GMT -5
Hi script modders, is there a Python module to read contents of .package files? Ideally, I'd like to be able to use such a module or functionality to generate a collection of clips found in the .package files, and come up with a way to offer the user a way to play them. I know that the Pose player has the "play by name" capability for in-game clips, but I'm wondering if a similar approach could be used to invoke (preview) animations included in package files.
|
|
|
Post by fufu508 on Feb 3, 2019 13:27:13 GMT -5
It just occurred to me I don't need the capability of reading the package files since the game has already done that by the time the proposed script runs. I just need to find out if the game can provide access to a list of clips, animation State machines, etc. to help the script generate and maintain a list of its own.
|
|
|
Post by fufu508 on Feb 9, 2019 18:38:53 GMT -5
Thanks to andrew I have a working test script to get the list of animations, however it's returning *all* of them, which crashes the game presumably because the game's console can't handle that huge a list. I've put an arbitrary limit to show only 5 keys (animations) for now, for testing purposes: import io import struct
import sims4.resources import sims4.commands
def get_clip_name(resource: io.BytesIO) -> str: resource.seek(0x38, io.SEEK_SET) name_length: int = struct.unpack('i', resource.read(4))[0] return resource.read(name_length).decode('ascii')
@sims4.commands.Command('cliplist', command_type=sims4.commands.CommandType.Live) def clipList(_connection=None): output = sims4.commands.CheatOutput(_connection) clip_count = 1 output('Listing clips') for key in sims4.resources.list(type=sims4.resources.Types.CLIP_HEADER): try: resource_loader = sims4.resources.ResourceLoader(key, sims4.resources.Types.CLIP_HEADER) resource: io.BytesIO = resource_loader.load() clip_name: str = get_clip_name(resource) output(clip_name) clip_count = clip_count + 1 if clip_count > 5: output("Limit reached. 5 clips listed. ") break except: output(f'Failed to load {key}')
As the keys are enumerated I'm hoping to figure out how to identify custom animations.
I see the name of the clip is retrieved from here:
sims4.resources.Types.CLIP_HEADER
Is there information I can look at to see what else is available besides the get_clip_name() function? Also, I tried finding a reference to learn more about sims4.resources.Types but found noas there is using the .tdesc file to look up tunings.
For now I will try searching for a substring within each clip_name returned, such as creator name (fufu508) for example. However, I'd like to default to only listing custom animations...
|
|
|
Post by fufu508 on Feb 9, 2019 20:43:09 GMT -5
Perhaps another approach (perhaps preferred, still thinking about it) would be to write the whole output to a file. I tried the "hello world" type script that this tutorial describes, hoping to get something out to a text file. No luck. The two lines were generated in game console as expected, but no file was created.
import sims4.commands
@sims4.commands.Command('myfirstscript', command_type=sims4.commands.CommandType.Live) def myfirstscript(_connection=None): output = sims4.commands.CheatOutput(_connection) output("This is my first script mod - presented by Fufu508!!!") output("Made using PyCharm.") f = open("c:\tmp\mytest.txt", "w+") f.write("a test") f.close()
EDIT: In a post further down this thread I explain what's wrong with the above. I have "\" but Python expects "/" in OS paths!
|
|