Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Ms. Byte (Deceased)
Original Poster
#1 Old 7th Apr 2015 at 1:02 AM Last edited by CmarNYC : 13th Feb 2016 at 3:38 PM. Reason: Update and additions
Default s4pe updates: CASP, RegionMap, Image import/export, TONE, RSLT, MTST, FTPT - 12/14/15 update for 12/4/15 patch
These updates are now obsolete. The latest version of s4pe contains these changes and more. Link to announcement thread and link to download: http://modthesims.info/showthread.php?t=572510

I initially did this for myself to make s4pe v0.3b more useful as the CASP format was updated, and now to be able to import modified speculars and thumbnails easily.

Kuree and I have communicated and I've contributed these for the next version of s4pe. (Edit: the CASP, regionmap, and image export/import updates have been included in s4pe v0.3c. Some later minor changes to CASP were not included.)

The relevant s4pe/s4pi source code is attached and freely available to anyone who wants to see how this was done. Image handling: Credit goes to Rick for the original RLE handler coding and @Kuree for modifications and turning it into an s4pe wrapper. They did the heavy lifting. I debugged a few problems and revised code to construct the RLES specular mask from the alpha channel without the artifacts seen previously, and that's about it. For the updated wrappers, updates are based on EA's binary templates and on research by myself and contributors to s4pi and the Sims Wiki.

Installation:
Extract s4pi.CASPartResourceUpdate, s4pi.RCOLChunksUpdate, s4pe-ImageResource-and-Helpers-Update, and s4pi.ExtensionsUpdate with 7-zip into your main s4pe folder. Answer 'yes' when it asks whether to replace files. You can try WinZIP or the Windows extractor but the updates may not work correctly resulting in error messages in s4pe.

Edit 5/5/15: Updated for the 5/4/15 patch which again changed the CASP format:
- Addition of the "HideOccultTypes" flags field. Setting Human or Alien to true in this field will prevent the part from showing for that type in CAS. Will only work with CASPs of version 0x1F or later.
- The classification parameter for "Occult" now only controls whether the part is allowed to be random for the specified occult type. I've renamed the parameter to "OccultAllowedForRandom" for clarification.
Includes a couple of functionality tweaks.

Edit 5/31/15:
Minor changes to the CASP wrapper: Added missing BodyType entries.

Addition of Export to DDS/Import from DDS for RLES specular images. RLES speculars will export as a DDS file which can be edited and imported back into the RLES format. See below for notes about editing speculars.

Addition of Import from PNG for thumbnails in the EA format with transparent backgrounds.

Notes on editing speculars:

Export the specular as a DDS file. Here's the information we got from SimGuruMeatball on the format of TS4 sim speculars:
  • Red = cube map blur (blurriness of reflections?)
  • Green = cube map strength (brightness of reflections?)
  • Blue = specular falloff (focus, or size of highlights)
  • Alpha = specular strength (shininess - lighter/more opaque is shinier, darker/more transparent is less shiny)
In addition, there's a fifth channel with a mask that controls where this specular is applied on the sim's body/clothing. The import and conversion function constructs that mask from the alpha channel of the image. Therefore, it's VERY important that any areas of the alpha outside of the actual texture of the clothing or whatever you're working on is completely black/transparent!!! Unless you want your sim to put on a disco top and become shiny all over, that is.

Also, I'm not sure what happens with an area of an alpha that's pure white/opaque. It might not convert into a mask correctly but I haven't tested. So far all I've done is lighten the alpha (general shine) and put white spots on the RGB (a sort of sequin effect). I'm relying on creators more experienced in texturing to experiment and put some advice together on how to achieve various effects.

Edit 6/13/15:
Updated CASP wrapper: Support for new CASP format in 6/11/15 patch, plus correction of CompositionMethod and Overrides types.

Edit 6/20/15:
Updated RegionMap wrapper: This is resource type 0xAC16FBEC, currently identified as 'UNKN' in s4pe, which identifies the region of each mesh part. This information was provided by SimGuruModSquad:

"This resource defines how a particular CAS Part interacts with other CAS Parts on the Sim. For example, how boots and pants interact: Should the boot appear on top of the pant (if pants are tight) or under the pant (if the pants are loose). Another common case it defining how hairs and hats interact.

The game considers the region and sorting information for all the CAS Parts on the sim to determine what geometry pieces should be used to render each part. This region, sorting and geometry information is all defined in this resource."

The updated wrapper makes this information easy to read and modify in s4pe.

The RegionMap update is included in the CASP wrapper - download and install the 6/20/15 version of s4pi.CASPartResource. I also provided an update of s4pi.Extensions - this changes the tag of the RegionMap to RMAP and the default file extension to .regionmap, and is entirely cosmetic and optional. For both, extract the .dll file into your s4pe folder and replace the existing file.

8/25/2015:
s4pi.CASPartResource now includes the fully decoded TONE resource, so in all it updates CASP, RegionMap (RMAP), TONE, and has the latest set of CASP/TONE property flags and values.

Added s4pi.RCOLChunks.dll, which includes fixes to the RSLT and to the MTST which is used in MODL and MLOD. (I did these for @plasticbox so she'd be able to answer questions about the functions better than I can.) The changes to MTST are an incorporation of updates @Inge Jones did; she gets the updating credit and I put them in since the MTST is in the same dll as the RSLT and otherwise it won't work for both resources.

Again, for each extract the .dll and replace the existing files in your s4pe folder. If you get errors using them, try extracting with 7-zip.

8/29/2015:
s4pi.RCOLChunks.dll now includes a working wrapper for the FTPT (footprint) resource. Install as above, replacing the previous version.

12/5/2015
s4pi.CASPartResource.dll is updated for changes in the CASP and TONE that came in the 12/4/15 patch. Install as above.

12/6/2015
Tweaks to s4pi.CASPartResource.dll. Install as above.

12/14/2015
More tweaks to s4pi.CASPartResource.dll for better handling of CASP and TONE version and packID modification: changes can be made with some restrictions; category flags will not be lost. Install as above.
Attached files:
File Type: zip  s4pe-ImageResource-and-Helpers-Update-5-31-15.zip (22.9 KB, 377 downloads) - View custom content
Description: Files to update s4pe
File Type: zip  s4pe-ImageResource-and-Helpers-SourceCode-5-31-15.zip (58.1 KB, 119 downloads) - View custom content
Description: Source code
File Type: zip  s4pi.ExtensionsUpdate-6-20-15.zip (7.1 KB, 210 downloads) - View custom content
Description: File to update s4pe
File Type: zip  ExtensionsUpdate-Source-6-20-15.zip (2.5 KB, 90 downloads) - View custom content
Description: Source code
File Type: zip  s4pi.RCOLChunksUpdate-8-29-15.zip (38.7 KB, 159 downloads) - View custom content
Description: File to update RSLT and MTST in s4pe
File Type: zip  s4piRCOLChunksUpdate-Sourcecode-8-29-15.zip (14.1 KB, 82 downloads) - View custom content
Description: Source code
File Type: zip  s4pi.CASPartResourceUpdate-12-14-15.zip (51.0 KB, 216 downloads) - View custom content
Description: File to update CASP, RegionMap, and TONE in s4pe
File Type: zip  CASPartResourceUpdate-Sourcecode-12-14-15.zip (28.1 KB, 114 downloads) - View custom content
Description: Source code

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Advertisement
Test Subject
#2 Old 7th Apr 2015 at 1:36 PM
Dont know if you have this but you can send a pull request on here https://github.com/Kuree/Sims4Tools/tree/master/s4pe

More info here https://github.com/Kuree/Sims4Tools

or just download the source here https://github.com/Kuree/Sims4Tools/releases

Hope that helps as Id like to see this tool upto date with GTW
Ms. Byte (Deceased)
Original Poster
#3 Old 7th Apr 2015 at 1:57 PM
I either don't have an account or have forgotten the username and password. Maybe when I have time to fiddle with it. Thanks!

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Test Subject
#4 Old 9th Apr 2015 at 3:30 AM
I tested it with a cloned hair, tried to modify it but the "grid" option is unable now, so I can't modify CASPs :S
Ms. Byte (Deceased)
Original Poster
#5 Old 9th Apr 2015 at 8:39 AM
Did you extract it with 7Zip, same as you have to do with s4pe? Does the preview pane work?

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Test Subject
#6 Old 9th Apr 2015 at 6:15 PM
Oh, I used rar, that was my mistake. Thanks!
Test Subject
#7 Old 17th Apr 2015 at 7:35 PM
Cmar where do i place the other two files that come with your download. The grid is greyed out for me even though I extracted it with 7zip
Test Subject
#8 Old 17th Apr 2015 at 7:41 PM
Think I figured it out but I wanted to check your input on the matter. I like to do gender conversions ALOT pretty much for every piece of clothing. In the past couple of days i've found a few things that I would like to convert and when I convert them and load up the sims and try to find it in either the converted gender or regular gender the game crashes. Is this just bad CC or is it an issue with the expansion and S4PE
Ms. Byte (Deceased)
Original Poster
#9 Old 17th Apr 2015 at 9:03 PM
The other two files are source code and of interest mainly to programmers. You don't need to extract them.

If you extracted the dll with 7-zip and put it in your s4pe folder, the grid button should not be grayed out when you click on the CASP. I can only suggest you download and extract s4pe with 7-zip again, and then extract the CASPartResource.dll with 7-zip again and replace the one that came with s4pe. When I ran into weird problems that fixed it for me.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Ms. Byte (Deceased)
Original Poster
#10 Old 5th May 2015 at 3:40 PM
Updated for the 5/4 patch.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Pettifogging Legalist!
retired moderator
#11 Old 5th May 2015 at 3:53 PM
Thank you! =)

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Mad Poster
#12 Old 5th May 2015 at 4:33 PM
Thank you for the quick update!
Test Subject
#13 Old 17th May 2015 at 5:52 PM
I don't know if you added the dropdown to the BodyType line, but 04 (Face) and 10-15 (Right & Left Lip, Nose & Brow Rings) are missing. The rings appear in Head Accessories above Earrings, when used. Obviously, they can still be entered manually, but perhaps you could include them in the next update of the wrapper. Some creators are using them for piercings as intended, and I borrow some for Accessory Undies (for layered clothing), so it would be helpful.
Ms. Byte (Deceased)
Original Poster
#14 Old 17th May 2015 at 8:39 PM
Thanks for the info! I put that list together manually some time ago - is there a tuning file somewhere with the complete list or did you get those values from new game CASPs?

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Test Subject
#15 Old 18th May 2015 at 6:58 AM
It's been the ExcludePartFlags dropdown list ever since it was added to the Grid, where few people think of looking for it. I was thinking of suggesting Kuree repeated the code for the BodyType line in the next version if you hadn't done it. Those are some of the slots EA didn't give us examples and therefore proper default thumbnails for - Tattoo_TorsoFrontLower (35) is another - so many creators don't realise they exist and borrow other slots for things that should have used these, then make things worse by putting their textures in the locations reserved for items that actually are the type they've borrowed, so making textures clashes inevitable. I routinely change illogical borrowed types for my own game so my Sims can get as close as possible to how things work in life, but can't do anything about texture clashes that require a relocation and re-mesh. If you like, I could PM you a version of the list showing the alternative items that I know of, so maybe we could get some order into the chaos that's resulted from EA ignoring the complete list of needed slots I sent them ages before TS4 was released, predicting this situation if they did.
Ms. Byte (Deceased)
Original Poster
#16 Old 18th May 2015 at 2:13 PM Last edited by CmarNYC : 18th May 2015 at 2:54 PM.
It's the same list of parts as for ExcludePartFlags but different values, and I need the values. If you'd PM me your list that would be helpful. I'm going to take another look at the tuning and see if there's a list in there like for the parameter flags and values.

Edit: I see where you're getting this - the index of the ExcludePartFlags corresponds to the value of the BodyParts. It seems reliable enough to add the missing BodyPart values.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Ms. Byte (Deceased)
Original Poster
#17 Old 31st May 2015 at 6:55 PM
Updated the CASP wrapper with the changes above, and added an updated ImageResource wrapper and associated helper stuff to allow export of RLES to DDS, import of DDS to RLES, and import of PNG to thumbnails. See notes in the OP.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Pettifogging Legalist!
retired moderator
#18 Old 31st May 2015 at 6:56 PM
Awesome =) Thank you so much!

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Ms. Byte (Deceased)
Original Poster
#19 Old 31st May 2015 at 6:59 PM
Anything for the creative community! :D

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Ms. Byte (Deceased)
Original Poster
#20 Old 13th Jun 2015 at 9:00 PM
CASP wrapper updated for 6/11/15 patch changes.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Test Subject
#21 Old 14th Jun 2015 at 6:48 PM
It's not working for me
Pettifogging Legalist!
retired moderator
#22 Old 14th Jun 2015 at 7:15 PM
Please elaborate on what you mean by "not working" .. ?

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Test Subject
#23 Old 14th Jun 2015 at 9:54 PM
Quote: Originally posted by plasticbox
Please elaborate on what you mean by "not working" .. ?


Ok, I can't gender change my hair. I added the s4pi.CASPartResource.dll just like last time before the update, but this time its not working. I don't know if I have to add something else or not.
Pettifogging Legalist!
retired moderator
#24 Old 15th Jun 2015 at 1:15 AM
It might be helpful if you’d post a screenshot to illustrate what you mean by “can't gender change my hair". Does something not show up? Not save? Not want to be edited? Not work in CAS? Not work in game? Or what do you mean by “can’t”?

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Ms. Byte (Deceased)
Original Poster
#25 Old 15th Jun 2015 at 2:59 AM
If you mean you get error messages on the right side of s4pe when you select the CASP and the Grid button is grayed out, you need to extract s4pi.CASPartResource.dll using 7-zip instead of the Windows zip extractor.

If you mean something else, please explain as pbox requested.

Please do not PM me with mod, tutorial, or general modding questions or problems; post them in the thread for the mod or tutorial or post them in the appropriate forum.

Visit my blogs for other Sims content:
Online Sims - general mods for Sims 3
Offline Sims - adult mods for Sims 3 and Sims 4
Locked thread | Locked by: CmarNYC Reason: Content is now obsolete
Page 1 of 3
Back to top