Difference between revisions of "Tutorial: Custom Paintings in Sims 3"

From SimsWiki
Jump to: navigation, search
Line 30: Line 30:
 
#* [[Image:PaintingOriginal.jpg]] [[Image:PaintingResult.jpg]]
 
#* [[Image:PaintingOriginal.jpg]] [[Image:PaintingResult.jpg]]
 
# Now you need a new instance ID for your modified painting. Generate one using the hash generator. Using Snaitf's generator, you can just click on Input Text, and then on Generate... that generates a hash based on your name and the date/time. Select the hash under FNV64/Normal.
 
# Now you need a new instance ID for your modified painting. Generate one using the hash generator. Using Snaitf's generator, you can just click on Input Text, and then on Generate... that generates a hash based on your name and the date/time. Select the hash under FNV64/Normal.
#* [[Image:Snaitfs FNV]]
+
#* [[Image:Snaitfs_FNV]]
 
# Rename the image file, replacing the part of the filename containing the old ID with the new ID you just generated.
 
# Rename the image file, replacing the part of the filename containing the old ID with the new ID you just generated.
  

Revision as of 06:35, 15 July 2009

[DRAFT 7/7/09. To be updated with screen shots and instructions on editing name, description and price.]

Making custom paintings in Sims 3 is challenging at the moment, and very likely somebody will be along with a tool to make it easier, but it is perfectly doable with a little concentration. You're going to need a variety of tools and techniques here, so if the very idea of hex editing or package unpacking scares you, you might want to wait till somebody codes a tool that automates all this ;)

Snaitf deserves all the credit for discovering the method documented here; I've just fleshed out the steps. Note: the three-part music painting can't be recolored using this method; there may also be other problematic paintings, please comment if you find any.

You will need:

What we are going to do is find the file for the painting object you are going to clone and its image file. You will edit the image file with your new painting, and make the object file point to the new image file. You'll set the object's price in the object file, and create a new string table file containing the painting's name and description. Then you'll make the object file and the string table file point to each other, and save the three new files together as a mod.

Find and extract the .dds file for the picture you want to clone, and modify it

  1. Open S3PE.
  2. Click File|Open, and navigate to GameData/Shared/Packages in the folder your game is installed in (e.g. Program Files/Electronic Arts/The Sims 3).
  3. Fullbuild2.package is the file that contains the images you want. Open it.
    • Openfullbuild2.jpg
  4. Check Sort and Display resource names, and click on Name to see the names of the resources. The paintings all start with the word "painting". Scroll down till you find the one you want. I went for PaintingAnimalGiraf.
    • PaintingResources.jpg
  5. Each painting has a few files resources with it; select them all, click File|Export, and choose or create a folder to put them in (anywhere you want). They'll be saved with the .dds extension.
  6. Open the .dds files in your image editor of choice. It should be readily apparent which one has the painting's image in it; close the others.
  7. Make a note of the part of the painting's filename between underscores right before the world "painting". For paintingAnimalGiraf, it's C1ECA4110BC90E09. This is the instance ID; you'll need it later. (You can use the Paste Bin in Snaitf's FNV generator to save it temporarily, or Notepad if you want a permanent record.)
  8. Modify the painting image with your art, flatten the file, and save it, choosing DXT5 compression in the DDS dialog.
    • PaintingOriginal.jpg PaintingResult.jpg
  9. Now you need a new instance ID for your modified painting. Generate one using the hash generator. Using Snaitf's generator, you can just click on Input Text, and then on Generate... that generates a hash based on your name and the date/time. Select the hash under FNV64/Normal.
  10. Rename the image file, replacing the part of the filename containing the old ID with the new ID you just generated.

Find and modify the corresponding object file to point to your image

  1. Back to S3PE. Open FullBuild0.package.
  2. Sort by name again. Scroll till you find a set of resources with a name similar to your image file; in our case, paintingAnimalGiraffe.
  3. Of those, you want the Object Definition file, which is the one with the value 0x319E4F1D in the Type column. Select that one, click File|Export, and export it to the same folder your image file is in.
  4. Start your hex editor, and open the object file.
  5. You are now going to replace every mention of the original texture file with the new texture file. The trick is, the numbers are in the hex file BACKWARDS... and each digit in a hex string is written with two characters... so you have to reverse the order of each pair of characters, keeping the order the same within the pair.
  6. So, in our case, we want to replace C1ECA4110BC90E09 (old instance ID) with 8AAFF83C1BB5A6E6 (new instance ID). In WinHex, click Search|Replace Hex Values. In Search For, I put 090EC90B11A4ECC1 (the reverse of the old ID). In Replace With, I put E6A6B51B3CF8AF8A (the reverse of the new ID). Select Replace All Occurrences, and click OK. It should make seven replacements. Click File|Save.
  7. Now we need a second new instance ID for our modified object file. We pull out the hash generator again. This time I put in Sri_Giraffe_Painting_Object_070709_22:50, and I get out 3EF918961F858995. I rename the .object file I just hex edited, replacing the old id part of the filename with the one I just generated.

Make a string table with your painting's name and description

We're going to use Postal to set up your string table.

  1. Download this file and save it in your Postal folder: http://chii.modthesims.info/getfile.php?file=950518
  2. Start Postal
  3. Go to Plugins | Open Console
  4. In the GroovyConsole, click File|Open, and select new_stbl.groovy
  5. Find this line in the script: "stbl.strings.put(new Long(Checksum.fnv64("[STRING KEY]")), "[STRING VALUE]")"
  6. Copy that line and paste the copy right below the original, so you now have two identical lines. You're going to use them to make two entries in your string table, one for the painting name and one for the description.
  7. In the first copy of the line, replace [STRING KEY] with some text. (Leave the quotes, but replace the brackets.) To make it unique, use your name and the date/time, e.g. "Srikandi 7/14/2009 10:39pm". That's the ID for the string table entry.
  8. Replace [STRING VALUE] with the catalog title of your painting.
  9. In the second copy of the line, replace [STRING KEY] with slightly different text; e.g. "Srikandi 7/14/2009 10:42pm"
  10. Replace [STRING VALUE] with the catalog title of your painting.
  11. Go to Script|Run, and close the console (you don't need to save the script).
  12. You should now be able to see your new string table in Postal. Double-click the line in the top pane, and the two lines of your string table should show in the bottom pane.
  13. Click the Hex View tab, and then click the Export button. Save the string table in the same place where your other project files are.

Put the new files together in a package

  1. Almost there! Back to S3PE. Click File|New.
  2. Choose File|Import, and select the .DDS file, the .object file and the .STBL file you worked on.
  3. Chose File|Save As, and name your mod whatever you want... for instance, Sri_Puppet_Painting.package.
  4. Close S3PE, copy the .package file to your mods folder, and test in-game.
  5. Congratulations! You just made a Sims 3 object mod :D
Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox