A multi-purpose tool to assist in modding, combining the capabilities of my previous tools: Auto Hash, Auto STBL, and Auto Tuning Ref. Along with a new XML Editor, STBL Editor/Viewer, and Hash Generator.
Latest: v1.2, hotfix: Fixed issue with Find and Replace Dialog where replace all button greedily took focus from enter key.
Download Source Code (Simfileshare) | Download Source Code (Patreon)
Some of the templates I include come from what S4S extracts (SimData translated into XML) and some are in binary form (.data), which can be read by velocitygrass's tool.
I recommend using S4S's SimData as XML and adding it into a package through there for it to be translated back to binary. Velocitygrass's tool is outdated in subtle ways and despite my stubborn desire to keep using it born out of a habitual workflow, I keep running into edge cases where having a binary SimData file up to date means it won't load in velocitygrass's tool, which defeats the point of editing it through that tool.
Maybe someday in the list of a million and one other things, I'll see if I can do some kind of SimData translation through SHAM. Until then, I recommend sticking to S4S's support for it (which probably means setting File Format Preference to Sims 4 Studio and using it as your package editor, unless you want to switch back and forth between package editors just for SimData).
If you've used the previous version, you may have settings (e.g. preferences.ini) or things in folders you want to keep (ex: edited additionalClasses.txt file). I recommend simply copying them over to where you've put the new version. I don't have an installer (partly cause I didn't anticipate making many changes) but I might consider one in the future.
Sims Hash Assistant to the Modder (SHAM) is sort of like if Sims 4 Auto Hash and Sims 4 Auto STBL had their arms melted into each other and then also had a baby. Probably one of the weirdest analogies I've ever come up with, but the point is that it's both of those programs and more.
If you're already familiar with the GUI version of Sims 4 Auto Hash and Sims 4 Auto STBL, the general idea of how they work is still the same. But I have made a number of changes, additions, and improvements, in part geared toward making some of the features from my previous tools a little more intuitive or having tooltips, instead of you having to pore over documentation to understand.
As of v1.1, it now has an XML Editor, too (the tab is called "XML Tuning"). This was specially designed for those who are used to creating and editing Sims 4 XML Tuning files in a plaintext editor like Notepad++, to make modding easier.
Overview of Changes
Example How To
In the box with the "put location of tuning files here" placeholder text, you put in a file path, and it will do a number of operations on the file: generate a hash for it, insert the hash as its internal file hash in decimal and then apply the hash to its external filename as hexadecimal.
So the simplest usage should look something like the following:
When you're finished, you can exit it out, leave it open for using it more, up to you. You can also click the little save icon or hit CTRL+S to save the contents of the debug log to a file, which should have some stuff in it after hashing.
Multiple Files
You can do more than one file at a time. To do this in windows, select more than one file in windows explorer, use shift + right-click to copy path, and then paste into the program.
What Gets Appended as Name
When choosing an internal filename, consider the example n="Triplis:Interaction_DoThings"
Note the colon, ":" operator in there. That's optional. If included, it will cause the program to ignore anything before ":" when appending the internal filename to the end of the external filename. For example, if you want your external filename to be S4_3C1D8799_00000000_D3613ABC297B23B7_MyZoneModifier even though the internal filename is Triplis:MyZoneModifier, you would include the ":" operator. This is purely a preference thing; it has nothing to do with the hash generation itself. I put it in because I like to use S4PE and S4PE will build a key list for assets that have a name appended to the end of them, making it easier to navigate your projects when looking at them in S4PE, but if my hash generation appended the entire filename, it could get rather long! You might know that your project is only by you and so there is no need to append your modder name to the external name of the file.
Keep in mind, of course, that using a unique modder name does matter for hash generation when it comes to what you choose for the internal filename! You want to make sure the chances of someone using the same hash is as low as possible. MyZoneModifier is not likely to be unique, but TheLastKnightOfBardledom:MyZoneModifier or TheLastKnightOfBardledom_MyZoneModifier probably will be.
Data Template Files
The program comes with a set of template data files. Meaning, existing data files that will be copied for some file types when a hash is generated. This is to speed up the process of hunting down data file types every time you want to make a new tuning file that requires one. Not all data template files have been added yet.
Some, however, have more than one template and you can choose which one will get copied by naming your XML file in the right way.
For example, if you have a buff XML file and you want to generate a data file for the mood Confident, include, somewhere in your internal filename, "BuffConfident." This might look something like: n="Triplis:Buff_StrutAround_BuffConfident"
You can look at the template folder (it comes with the program) and see what the syntax looks like for these template variations. Right now, most of the variation revolves around different types for buffs and different types for traits. Note that you will still need to edit the data file somehow for modifying things like strings.
Additional Classes
In the past, the auto hash tool has ignored classes that aren't in its compiled list, so you could make a custom snippet class called BoopOnTheNoseSnippet and the program would just tell you it can't do anything with it.
Now it will default to snippet as the type if the class doesn't exist in its list, assuming it to be a custom snippet class, which is the most common kind of custom class.
Or if that doesn't cover you, you can add to the additionalClasses.txt file. The program comes with an example in there, so you have an idea of what to do. The "NONE" part will always be "NONE" unless you were going to connect a simdata file to it that is supported by the program, such as in the case of a custom buff class maybe. If you do need to use it, just use the simdata group type (it must be one that shows up in the DataTemplates folder). Note: If you need to set the hash type to something other than 64 high bit, the supported types are: BIT_64, BIT_64_HIGH, BIT_32, BIT_32_HIGH
Hash Text tab is a hash generating tool, similar to the Hash Generator tool you can find in Sims 4 Studio. You put in some text and it gives you different types of hashes that you can copy/paste for use in custom mod files.
It provides:
Example How To
In the box with the "put location of tuning files here" placeholder text, you put in a file path to an XML tuning file. Then you select a target set of STBL files with "Add New Strings To...", or leave it as New STBL File (Default) to create new STBL files intead.
The following is an example to explain how it works.
You have a custom interaction file and you want a unique string name for your interaction that'll show up in-game. Somewhere in the file is a line like the following:
<T n="display_name">0x588ECF04<!--String: "Enchant to Kneel"--></T>
Note that the comment describing what the string should be is important. The formatting the program looks for is precise and is based on strings being commented in the way that standard tools do (like Scumbumbo's XML Extractor—I'm not sure if S4S extraction does the same).
Now let's get the tool to recognize our string. It was Enchant to Kneel, but we're going to change it to Bungalow Banjos. So we do this:
<T n="display_name">0x588ECF04<!--StringCustom: "Bungalow Banjos"--></T>
If we run the program on this XML file, it will find the commented string with the "StringCustom" identifier and create a unique hash for the string in quotes, our "Bungalow Banjos." Note that this hash is created from a combination of the string itself and the internal name of the file (the "n=" value), so for best practice to avoid hash collisions, make sure you've given the file a unique name first!
This also means that you could theoretically put "Bungalow Banjos" in two different files and generate the same string for both, but with a different hash value, which is not ideal. To prevent this, make sure to set Language of New Strings to the language of the strings you're adding. This will have it check against the related file when adding to existing STBL files (e.g. 00 Locale Code STBL file for English), to ensure duplicate strings are ignored.
Next, the program will insert the new hash into the XML file for you. So your line of code might end looking something like this:
<T n="display_name">0xA706DD72<!--StringCustom: "Bungalow Banjos"--></T>
Now all that's left is the string table itself. The target string table (STBL) works as follows:
The goal of the dropdown design is to make it easier to manage multiple sets of STBL files from different projects and in general, have finer control over where STBL files are targeted for string addition.
And that's it! You can add the STBL files from your chosen folder to a package file, add in your interaction, and you're ready to see your string in-game.
STBL Table is both an STBL Editor and STBL Viewer, depending on how you wish to use it. You can switch it back and forth from one to the other as desired, to, for example, safeguard against making accidental changes if you just want to view a file.
It also includes a Find box with Find Next and Find Previous switching to search for particular strings in the table by name
How it works should be fairly self-evident, but I'll provide some details below just in case.
One thing I want to mention is it works like a text editor in that you can make and save changes easily and quickly with saving and shortcut for it (CTRL+S). This means you could also muck up your STBL file pretty easily if you aren't careful and don't know what you're doing. For this reason, I recommend working with backups/copies of files when making edits. This is good practice for software in general, but it's especially important here.
I will note, however, it's creating a new STBL file each time you save; meaning, it's rebuilding it from scratch with whatever entries are in the STBL Table tab's table. So if you muck something up in a way that your STBL file no longer works, it shouldn't be too hard to fix it. The worst you can probably do is delete something you didn't mean to delete, or save an entry with a placeholder Hash like 0x00000000.
Some details on how to use it:
XML Tuning is a standard plaintext editor, but designed to be specialized in ways that are more convenient for working with Sims 4 Tuning Files.
If you are like me and are used to modding XML tuning files by hand in an editor like Notepad++, that is the kind of person I had in mind. I knew I couldn't match the years of detail Notepad++ has, but I tried to bring it up to speed with some of the most essential features for convenient text editing. Things like syntax highlighting, for example.
But I knew that would not be enough. I thought about it from the standpoint of what would convince me to mod with it instead of doing the bulk of my work in Notepad++. So I came up with features like Insert Template and Save As Hash, which together, are designed to make it painless to find an example of a type of tuning and give it a unique hash, without having to hunt it down, copy it, etc. These are based on an open tuningTemplates folder that you can modify yourself to update tuning syntax changes or add templates of your own. There is really no limit on what snippet of xml you can make a template be. You can, for example, use it for entire tuning examples, as it's done in the templates that come with the program, or add short snippets of xml.
There is also notably a Link Tuning feature, which allows you to right-click on a line where a tuning gets referenced, select its location from a file dialog or copy it in, and it'll insert into the correct position with hash and commented name. Making it easier to tie tunings together without having to squint at a bunch of stuff to make sure you've entered it correctly.
Unlike Notepad++, it doesn't allow you to open multiple files at once, but it does provide an optional Project View to the left of the XML Editor, which can be set to a specific folder ("project") location. It'll then provide a filesystem view into that folder sort of like windows explorer does. You can double-click a file in there to open it and right-click to copy its path.
You can also click an open file's displayed title to instantly copy its path. You could then navigate over to the Hash Tuning tab and hash the file from there. So there are multiple ways to go about hashing your files.
Some other details about what it can do:
The usefulness of this tool may not be immediately apparent. Unlike some of the other tools in this program, it doesn't hash or name things for you and it doesn't edit the files you input at all. Its purpose is instead to produce tuning-ready XML with references to other tuning files in it, that can be copy/pasted into XML files as you desire.
If, for example, you have a lot of traits you want to be removed through a loot file: Normally, you'd have to open up each trait file, copy the hash, and then paste it into a trait_remove tuning one after another in your loot file at bare minimum. If you mod like me, you've got to paste the name of the file too, into a comment, so you know what's what at a glance. Extremely tedious with a lot of files, lots of dead time to question your life choices.
With this tool, you can simply navigate to the folder where your traits are, choose trait_remove, process the files, and you'll have some text you can copy/paste into your loot file with all the traits and their IDs in trait_remove procedures, put together for you.
Example How To
You have a bunch of interactions you want to reference in an AffordanceList, but getting all of their IDs to reference them in the file is tedious, not to mention blindingly boring, and error prone. So you:
This will add some XML to the Big Blue Box (BBB). Or Big White Box (BWB) maybe, if you're using the native theme.
From here, you have a number of options to work with the XML. You can hit the Copy Output icon and then paste it into your AffordanceList tuning file. You can select it and copy it more manually. You can hit the Save As icon to save it to a file and then copy/paste it or add to it from there. Whatever works for you.
Advanced Use
I wanted the program to be as simple and flexible as possible, so you can to some extent add your own XML files to the tunables folder that comes with the program and it will recognize them.
Currently, keywords recognized by the program are: TUNING_REFERENCE_GOES_HERE, TUNING_REFERENCE_LIST_GOES_HERE, and ENUM_GOES_HERE
You may notice some files have a comment like this: <!--Instance Restriction: statistic-->
or this: <!--Class Restriction: Trait-->
This is completely optional and is just a "minimize user error" kind of thing. If you give something a restriction, then it will be ignored in processing if the types don't match. For example, if trait_remove has a class restriction of Trait and somebody tries to process a Buff file as a tuning to be placed in trait_remove.
You can also add stuff to the enums folder, but I'm not sure how useful it is as a functionality beyond ParticipantType. At least for the way the program is set up.
If you add a set of enums, make sure to specify it with an <!--Enum Type: ParticipantType-->
kind of comment in tunables that should use it, where ParticipantType is the kind of enum that should be used. Otherwise, it'll be a possible enum, but won't be linked to any specific tunables file.
This deserves its own section not because there is a custom theme I made that you can enable or disable if you want, but because you can also create your own theme if you wish.
In the files for the program, you'll find a folder called Tutorials > Custom Theme Example. The README file in there explains the gist of how you can create a custom theme with a complete example.
You can set one Override theme at a time and Use Custom Theme must be enabled in Preferences > Appearance for it to be applied.
I added support for this basically because I could. It was fairly easy to do and this is a modding tool, after all. Customization is a mindset at home here.
I don't expect anyone to go to the trouble to make a custom theme, but hey, if you do and you'd like to share it, you can let me know on my discord and I'll add a link to it on this page so it has more visibility.
The source code for SHAM is shared freely both to ensure it's possible for the program to be maintained if I disappear and also so that others can learn from the source code.
I encourage others to use the source code to help them make their own tools or improve existing tools where possible. Wholesale copying of SHAM would be frowned upon, partly just because it wouldn't make any sense (why not just use SHAM then?).
But in general, my attitude is one of freely sharing information. I believe that the more is shared and built on freely, the more we can be capable of doing.
In the less literal meaning of open source, as in, "an open source project that others can contribute to," I've considered it for SHAM and am opening to considering it further if there is any interest in it. It's not something I'm currently jumping to do because I don't want to take on the responsibility of managing a public-facing project with all the clerical work of approving commits and deciding what does and doesn't make sense to add to the program.
Short answer: No, but I will update this note if that changes.
Longer answer: You may have seen me give some contradicting or confusing information on cross platform about my programs in the past. At the time, I had little idea what the deal was.
What the deal is, as far as I can tell, is this: Qt is largely built to be a cross-platform library and this program uses it heavily, along with C++. But, to actually be able to use a Qt program cross-platform, you still need to have that platform to compile it on, to get an executable that will work on that platform.
I don't have a Mac, so I can't compile the program for a Mac and test it to make sure it'll all work on a Mac. If you have a Mac and would like to compile it for a Mac and test it to make sure it'll all work on a Mac, you're welcome to do so (the source code is freely available for download). You can even share the result and I'll share a link here.
I can't create a Mac version myself though, or offer support for such a version, since I don't have a Mac or Mac environment of any kind and am unlikely to have one any time soon.