Recolouring Non-Default Trees
Have you ever wanted some more variation or a personal touch with your sim worlds? Recolouring the foliage to match your world and terrain paints is a great way to do that, but in order to maximise your variants and not override your trees in other saves, you will need to create some custom trees. It's actually pretty easy once you know how, and anyone with the following resources can do it in about 30 minutes.
You will need:
~A hex editor (I use this one)
~A graphics editing program with a DDS plugin (eg. Gimp or Photoshop).
Prep: Installing the Hex Editor to S3pe
It's probably best to get this step out of the way before you start. If you don't currently have a hex editor installed in s3pe, you can download this one here. Once downloaded, extract the files to a convenient location and open s3pe. Navigate to Settings > External Programs and tick Use an external hex editor. Locate the exe file in the location you extracted it. It should look something like this.
Hit okay. You can now exit s3pe.
Step 1: Cloning
The first thing you're going to want to do is clone the object to recolour. Open s3oc and hit Cloning > Normal Objects. This will take a moment to load, but will give you a list of OBJD files. Navigate down to the ones named tree (or hit Name to find them faster) and find the tree you want to clone. You will see a small preview of the tree in the Overview window.
Double click the OBJD file to clone it (hitting clone/fix can sometimes return an error). You should select the following options on the screen:
Hit start and save it in another location most convenient to you. I advise saving it to a folder for the custom item so you can keep it with its textures (more on that in a moment). Once done, you can exit S3oc.
Step 2: Retrieving Textures
For whatever mystical Sims reason, cloning the object file does not bring the textures so we have to find those ourselves. Open up S3pe, and open file: (SIMS 3 INSTALL FOLDER) / Game Data / Shared / Packages / FullBuild(0-4). The exact file path will depend on where you have installed your main game, on many computers it is located under C / Program Files. If the tree / plant is from a different EP, you will need to find that install location and follow the same basic path to find the fullbuild files. Which fullbuild file contains the textures we want is fairly variable too: mine are located in fullbuild02. It may take some trial and error to locate them: you're looking for a fullbuild file with lots of _IMG files.
Eventually, you will find something that looks like this:
Every _IMG with the same name as the tree / plant you cloned is what you want. We're going to do two things with these: export them to file so we can edit / recolour them (to the folder where you saved your cloned tree), and export them to the cloned package we saved of the tree. To do this, right click and hit Export >To file, and navigate to the folder for your custom tree, and then again right click and hit Export > To Package and find the cloned package file in the folder you saved it. Our textures will now be in the package file and in a form that is easy for us to edit later.
Step 3: Hex Editing
This is the most complicated part of the process and where most things can potentially go wrong. Fear not, follow these steps and all should be fine, and if its not, going back to retry is always an option.
Open your saved package file of the cloned tree. Your saved package will look something like this: don't worry too much if the _IMG files aren't named, we're going to change them later anyway. First, you're going to locate the _SPT file, right click it and select Hex Editor.
You will be greeted by this, which looks scary but isn't. This file is what tells the game where to select its textures: currently, they will still be the defaults. We're going to edit it with unique names, so hit the find and replace button shown by the red arrow here.
The name of the tree you cloned will be used in texture paths: in this case, treeAspen. We need to make that name unique, but also the exact number of characters as in the section you're replacing. I advise leaving the tree part of the name there and substituting something meaningful into the other part of the name: in this case, I'm switching Aspen to GhGum standing for Ghost Gum. Ensure the settings are the same as those shown here, then hit replace all. Hit okay and then save the file and exit the Hex editor, NOT s3pe. S3pe will ask if you want to accept changes to the file, select yes and then save the package file.
Step 4: Texture naming
Next, we need to rename our _IMG files so that the game can find and link them with the SPT file we've just edited. The names of each file will correspond to the file names in the SPT (on the right side if you scroll through on the hext editor). The problem is that the SPT names don't always line up neatly with the old IMG file names (which is also why it's okay if it imports without names). These names are CASE SENSITIVE. You have been warned.
You can tell what each texture should be named by the preview image in the overview panel. Text in itallic is what I've changed the original name to: this will change for every tree you clone.
This is a long rectangle with a bit of colour to it, and represents the hue and some of the texture of the bark.
This is a small grey square containing the bark texture.
This is the main colour file of the tree and features leaves and the trunk.
Distance terrain of the tree in colour. Appears pixelly.
Distance terrain of the tree in grey. Appears pixelly.
A small square black and white file containing the shadow image.
These names may not work for all trees, but are a good place to start. To check the correct name, reopen the SPT file and use the search function to check the file names. Search for keywords like composite or billboards: the distance textures (billboards) are most likely to vary (may not have composite in the name). So long as your IMG name matches the SPT name it will work.
To rename your files, double click on the file to bring up the resource details. Check Use resource name, and then input the corresponding name, in this case bark d, and hit FNV54. This will give the _IMG file a unique instance name, completely separating it from the base textures. Hit okay, and repeat the process for the remaining _IMG files. Once done, save your package.
Step 6: (Optional) Testing
At this point, you may wish to test whether your hex editing and renaming has worked correctly. Optional: you can place the package file in your mods / packages folder as per usual, and load the game to ensure everything is working. If you've done everything right up to this point, you will have two instances of the tree you cloned available to buy, one as custom content. It should at this stage look as though you have two identical trees when placed in build mode: if textures haven't been correctly named the custom tree will appear blocky and black. If this is the case, you may wish to go back to the previous sections and check you've not made any typos in naming the IMG files or made your SPT replacements too long / short. If it works, congratulations! You can now move on to editing the textures of your tree.
Step 7: Editing textures
Editing textures is the easiest part in this process. Open your imaging software of choice and find the dds files you extracted into the custom tree folder earlier. These are the same 6 as shown in your package file, but are free to be edited at your leisure. Open the files with default settings, and edit things like colour, saturation etc. You may wish to mix and match textures from other trees: you can locate these through the same process you used to get them for this tree, just make sure the textures you are replacing them with are the same size.
Once you're happy, save the file, but make sure you're using the settings below. You may also wish to rename these files to make telling the difference between them easier, as these file names have no effect on your custom package.
Once done, reopen your custom package in S3pe, and right click the _IMG file to replace with the edited texture you've saved. Once done with all the textures you are editing, save the package and you are ready to put it in game.
Bonus: Putting trees in CAW
Now you've got your fancy new trees, why not put them in CAW to enhance your building too. If you don't currently know how to put CC into CAW, there's a great tutorial here, along with an already amended resource file.
Ooh thank you so much! I've been searching for a good tutorial without luck so this was just what I needed!