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
Virtual gardener
staff: administrator
Original Poster
#1 Old 27th Mar 2021 at 6:36 PM
Default SOLVED: Game isn't fully extracting info from CASP
Heya!

This is a pretty advanced question, so I'm not too sure if anyone would be around to help... but it's worth a try

Currently, I have a bunch of (Correct keys btw, I triple-checked this) CASP resource, resource keys that I parse into SimOutfit, like so:

Code:
mPatternInfoInit.mSimOutfit = new SimOutfit(mPatternInfoInit.resKeyPattern)
Now I noticed that the game will basically make this 'empty thing' of a CASpart. It knows the mesh and the RIG, but stuff that is defined in the CASP like which category you can find it, which age, species and gender it's meant for is just not there. Which I do actually need in order to make proper thumbnails for said CASparts.

Do I need to manually set these again? Or am I missing something?

 also noticed that these SimOutfits also don't have 'parts' in them (even the CASparts I got from EA that the originals do have parts of...) I know Cmar has done this approach as well, where creating SimOutfits was done by just the reskey and in her code I'm seeing that the CASparts inside the SimOutfits do actually return data... so I'm super confused 

Thanks in advance!
Advertisement
Forum Resident
#2 Old 27th Mar 2021 at 10:41 PM
new SimOutfit expects a reskey that refers to a SIMO resource, not a CASP resource I believe?

Have you tried generating a new CASPart object from a reskey and then make a thumbnail of that?

Find my Mods: Here at MTS, over at Simlogical
Virtual gardener
staff: administrator
Original Poster
#3 Old 28th Mar 2021 at 11:57 AM
Quote: Originally posted by Consort
new SimOutfit expects a reskey that refers to a SIMO resource, not a CASP resource I believe?

Have you tried generating a new CASPart object from a reskey and then make a thumbnail of that?
That... actually makes a lot of sense lol! Not sure why I didn't think of that

I think I tried the CASpart stuff before but that was before I understood what I was doing :p So let me try that approach, since I think the way it's doing it right now is that it can find the RIG and Model resources (as expected, because like you said, that's basically what a SimOUtfit resource does and has) and CASpart must pretty much be the whole thing.

I'll reply another time to let you know if that did the trick!
Virtual gardener
staff: administrator
Original Poster
#4 Old 28th Mar 2021 at 2:10 PM
Allright, i changed the code to create the thumbnails from the CASpart class (And also from the CASP resource key ) but it's still returning null when I print the age, gender and species as well as bodytype. 

I'm honestly not sure why, since I'd assume the engine should have the ability to pick all this up and turn it into useful information. But i'll check around i the source code a bit more, see if I can see how EA adds casparts to the game (or even the Clothing Thumbnails for that matter)

Thanks again Consort!
Virtual gardener
staff: administrator
Original Poster
#5 Old 28th Mar 2021 at 3:31 PM Last edited by Lyralei : 28th Mar 2021 at 4:16 PM.
Okay so, I really pulled a dumb error here :p

So I got this debug option for the sewing table that grants me every pattern a sim can collect. Problem however is, is that, once made and then saved, the patterns will hold old information despite changing the 'extraction' code (or setup code for the patterns rather).

I ended up using Nraas' remove inventory and re-made the patterns and that didn't throw me any null errors... but changing it to CASPart did help. I am however encountering a new issue which is, that the game doesn't seem to be able to grab the age. Which, while printing it, does actually print the age!

Code:
print(item.mPatternInfo.mSimOutfit.Age.ToString());
ThumbnailKey thumb = new ThumbnailKey(item.mPatternInfo.resKeyPattern, 0, (uint)item.mPatternInfo.mSimOutfit.BodyType, (uint)item.mPatternInfo.mSimOutfit.Age, true, ThumbnailSize.ExtraLarge);
UIImage mThumbnail = Sims3.UI.UIManager.GetThumbnailImage(thumb);
Nraas error:

Code:
(In OnPrepareObject)

System.NullReferenceException: A null value was found where an object instance was required.
#0: 0x00003 callvirt   in Sims3.Gameplay.CAS.Sims3.Gameplay.CAS.CASLogic:GetAge () ()
#1: 0x00018 callvirt   in Sims3.Gameplay.Core.Sims3.Gameplay.Core.ThumbnailHelper:SetupForCASThumbnailUsingCASSimbuilder (Sims3.SimIFace.ResourceKey,int,Sims3.SimIFace.CAS.CASAgeGenderFlags,Sims3.SimIFace.ThumbnailSize) ([vt:648C822C] [0] [2] [3] )
#2: 0x0018d call       in NRaas.OverwatchSpace.Helpers.NRaas.OverwatchSpace.Helpers.ThumbnailHelperEx:OnPrepareObject (Sims3.SimIFace.ObjectGuid,Sims3.SimIFace.ObjectGuid,int,uint,uint,Sims3.SimIFace.ThumbnailSize,uint,uint) ([vt:648C81A4] [vt:648C81AC] [0] [2] [1] [3] [1] [0] )
#3: 0x00000            in Sims3.SimIFace.Sims3.SimIFace.PrepareThumbnailObject:Invoke (Sims3.SimIFace.ObjectGuid,Sims3.SimIFace.ObjectGuid,int,uint,uint,Sims3.SimIFace.ThumbnailSize,uint,uint) (44DBADE8 [vt:648C806C] [vt:648C8074] [0] [2] [1] [3] [1] [0] )
#4: 0x00033 callvirt   in ScriptCore.ThumbnailManager+PrepareTask:Simulate () ()
EDIT:

Nevermind! Got it fixed! For in-game, never use the one that has you choose Live update (and if you do, set this to false!) else, the game will use the CAS version of the thumnbnail setup and since we're in game and not in CAS, that's a problem :p
Back to top