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!
Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 27th Nov 2023 at 6:39 PM Last edited by Lycorisimpailer : 27th Jan 2024 at 12:47 AM. Reason: Solved
Default [Solved] How do I make CC Accessory Masks be randomly chosen during Masquerade Parties?
I downloaded the VKG Bioshock accessory masks as custom content and put the package files in my Mods/ Packages folder. I want them to be a mask option when I use the Partius Maximus University Life statue to throw Masquerade parties. The cc masks show up in my game, but I have to use Nraas Mastercontroller in order to change the sims into the cc masks and I want to know if there is an easier way to do this than manually changing everyone's outfits.

I tried using S3PE to open up the [Set] Party Pack.package. I looked at the CASP>Grid for the afAccessoryEP9MaskBeak and the cc mask package and I saw that the clothing categories were different, so I changed the cc clothing category to match that of the university life masks. This didn't work as the masks weren't randomly chosen.

I opened the S3SA file for StoreObjectsPartyStatue in the [Set] Party Pack.package in ILSpy. I saw the word outfit and masquerade close together, so I used SIMO to turn a mask into an outfit by clicking Add CAS parts and adding the cc mask caspart file I exported with s3pe. It looked different from the afAccessoryEP9MaskBeak SIMO when I click on full outfit data. I put the cc mask outfit and other files in the [Set] Party Pack.package and it still didn't work.

Code:
		case AttireType.Masquerade:
 		{
 			string outfitName2 = GeneratePartyOutfitName(simDescription, CurrentAttire);
 			resourceKey = SetupSpecialOutfit(simDescription, outfitName2, OutfitCategories.Formalwear);
 			break;
		}


Code:
	private ResourceKey SetupSpecialOutfit(SimDescription desc, string outfitName, OutfitCategories outfitCategory)
 	{
 		SimOutfit outfit = desc.GetOutfit(outfitCategory, 0);
 		if (outfit != null)
 		{
 			SimOutfit outfit2 = null;
 			ResourceKey key = ResourceKey.CreateOutfitKey(outfitName, 0u);
 			if (OutfitUtils.TryGenerateSimOutfit(key, out outfit2) && OutfitUtils.TryApplyUniformToOutfit(outfit, outfit2, desc, "PartyStatue.Outfit", out var resultOutfit))
 			{
 				foreach (AttireType value in Enum.GetValues(typeof(AttireType)))
 				{
 					if (kOutfitCategories[(int)value] == OutfitCategories.Special)
 					{
 						desc.RemoveSpecialOutfit("PartyStatue" + value);
 					}
 				}
 				desc.AddSpecialOutfit(resultOutfit, "PartyStatue" + CurrentAttire);
 				return resultOutfit.Key;
 			}
 		}
 		return ResourceKey.kInvalidResourceKey;
 	}


Code:
	private string GeneratePartyOutfitName(SimDescription desc, AttireType attire)
 	{
 		return attire switch
 		{
 			AttireType.Toga => (desc.AdultOrBelow ? "a" : "e") + (desc.IsFemale ? "f" : "m") + "PartyStatueToga" + RandomUtil.GetInt(1, 8),
  			AttireType.Masquerade => "a" + (desc.IsFemale ? "f" : "m") + "PartyStatueMasque" + RandomUtil.GetInt(1, 8), 
 			_ => "",
  		};
 	}


Above are parts of the original S3SA that I think are related to the masquerade parties.
Advertisement
Test Subject
#2 Old 27th Nov 2023 at 7:59 PM
I think the important part is the resource key. In GeneratePartyOutfirName it creates a string, which then gets converted to a ResourceKey in SetupSpecialOutfit. So there must be a file in a package with the Hash64 of the outfitName as it's Instance Name.

But I can't find the [Set] Party Pack.package so I cant look if there's one in there. In which folder is that package?
Instructor
#3 Old 28th Nov 2023 at 12:26 AM
This item is limited edition store content, so it's a little difficult for anyone without it to help crack it open. I'm not sure on the grey area of sharing an unmodified store content file for the purposes of turning it into a modified one (which are allowed). Confusing.

I cannot see what lists/reads the SIMO either.
There are NGMP but they are only for the items themselves. I can only think that there might already be a tuning table in GameplayData for it, but one would need to narrow down what it may be named.
There are also two UNKN resources, and it's also possible for there to be SIMO data that S3PE simply doesn't support and so isn't visible to compare or edit. Worst case scenario, the important data is within those.

I can contribute screenshots/export individual resources if anyone with better eyes for the code itself wants me to look for something specific.
Test Subject
#4 Old 28th Nov 2023 at 9:26 PM
I now got the right package (mine has just a number as name) and was able to find the instances. They refer to SIMO files. Since I haven't worked with them yet I can't tell you in detail how to best work with them. But I'd say you have the option to create your own SIMO files and give them the same instance as the original and overwrite them or edit the original ones. As I said I don't know which of these would work better.

If you want to have both the EA masks and your own, you'd need a core mod to create other keys.

To find the right SIMO files you can use the S3PE FNV Hash converter (ctrl+F) to convert the strings afPartyStatueMasque1 up to afPartyStatueMasque8 for the female outfits and amPartyStatueMasque1 up to 8 for the male outfits. You can then use the FNV64 code to search for the right instance.
Test Subject
Original Poster
#5 Old 27th Jan 2024 at 12:36 AM
I figured out how to do it. I all needed was S3PE . If anyone else wants to know.
1. Open the cc mask in s3pe.
2. Right click the file with the CASP tag. Select Copy ResourceKey.
3. Open the original file.
4. Click on Casp. Click on Grid. Unknow1 will be the name of the item such as afAccessoryEP9MaskBeak. The mask files will have "mask" in the name. Or you can look at the preview to the right instead of clicking on Grid. Look at the instance in the fourth column of the casp row.

5. Click on SIMO. Under CASPEntries. It will say glasses in the preview and have the same instance as the in the step above and those will be for the masquerade. The others are for the toga party. Click on Grid once you have the right SIMO

6. Click on TGIBlocks at the bottom and click on the three dots to the right. Scroll down to CASP and click on it. Click paste RK. Click save. Change the age and gender categories if you want. Click commit. Do this for the next simo file and cc mask combination.

That's it. I was way overcomplicating things originally.
Back to top