Welcome to
Mod The Sims
Online: 1124
News:
Have an account? Sign in:
pass:
If you don't have an account, why not sign up now? It's free!
Other sites: SimsWiki
Reply  Replies: 7 (Who?), Viewed: 1883 times.
Search this Thread
Old 28th Sep 2017, 4:16 PM DefaultHow are NPCs linked to their uniforms? #1
Qahne
Original Poster

Scholar

Join Date: Jun 2009
Posts: 1,014
Thanks: 2221 in 15 Posts
17 Achievements


I'm creating a set of default NPCs and townies, but certain NPC types are linked to specific hairstyles and outfits that I don't want them to wear; I also don't want to create a simple default replacement package, as some of the items (in this instance, butler hair) are used by non-NPCs too. I would like to unlink the NPC from the CAS item, but I can't find any resource that could link the two. Any pointers?

Quote:
Originally Posted by jje1000
If this succeeds, then we will have driven a stake through the metaphorical heart of pudding.

♥ Receptacle Refugee ♥
Now also on Tumblr !
Old 28th Sep 2017, 4:26 PM #2
Nysha
Née whiterider



Join Date: Jul 2005
Posts: 19,685
Thanks: 42617 in 92 Posts
36 Achievements

View My Journal


Some NPCs are linked via the NPC spawning routine - the "Make New NPC" BHAV accepts arguments which include references to a specific outfit or hairstyle the NPC should wear. I don't think this is how it works for all NPCs, though, since those arguments don't appear to have been used in the basegame.

What I lack in decorum, I make up for with an absence of tact.
Old 28th Sep 2017, 8:18 PM #3
Qahne
Original Poster

Scholar

Join Date: Jun 2009
Posts: 1,014
Thanks: 2221 in 15 Posts
17 Achievements


My current method is to spawn the NPCs using the NPC and townie maker in the game and replace them with Bodyshop sims via Alt Sim Surgery; when teleported to a lot, they spawn in and wear the everyday Bodyshop outfits fine, but when spawned by the game in the course of their duties as service NPCs, they have their uniforms (and uniform hair) on. It might be possible to override by editing their hidden work outfit category, but I get the feeling they'd just spawn in default items when next they are called to a lot.

Quote:
Originally Posted by jje1000
If this succeeds, then we will have driven a stake through the metaphorical heart of pudding.

♥ Receptacle Refugee ♥
Now also on Tumblr !
Old 16th Oct 2017, 4:08 PM #4
Lamare
just a girl

Join Date: Jan 2014
Posts: 650
Thanks: 3351 in 26 Posts
16 Achievements


I've seen objects such as "NPC - Template - RepoMan". They seem to control some things about NPCs. There are Init and main functions and stuff.
This globals are used there:
[global 0x01B8] NPC - Put NPC Outfit On Me
[global 0x0137] NPC - Get Outfit GUID for Type in T[0,1] - this one calls Lua script, which is a bummer, unless you know how to read it, but maybe there's a way around it. For example, you could replace certain NPCs functions with custom ones and stick there GUIDs for your desired outfits.
I didn't know outfits could be objects and had GUIDs, but apparently you can find objects like "Outfit_NPC_Clerk Outfit - Template". This one mostly has a bunch of 3D ID referencing files. Presumably they point to real outfits' property sets. Might be your pointers.

Assorted mods: Moving out and job options
Apartment rent agreement mod - fresh update
Testers wellcome on Electrical box & Fertile land
Functional sofa bed is ready to be tested as well
Old 16th Oct 2017, 11:03 PM #5
Qahne
Original Poster

Scholar

Join Date: Jun 2009
Posts: 1,014
Thanks: 2221 in 15 Posts
17 Achievements


Quote:
Originally Posted by Lamare
I've seen objects such as "NPC - Template - RepoMan". They seem to control some things about NPCs. There are Init and main functions and stuff.
This globals are used there:
[global 0x01B8] NPC - Put NPC Outfit On Me
[global 0x0137] NPC - Get Outfit GUID for Type in T[0,1] - this one calls Lua script, which is a bummer, unless you know how to read it, but maybe there's a way around it. For example, you could replace certain NPCs functions with custom ones and stick there GUIDs for your desired outfits.
I didn't know outfits could be objects and had GUIDs, but apparently you can find objects like "Outfit_NPC_Clerk Outfit - Template". This one mostly has a bunch of 3D ID referencing files. Presumably they point to real outfits' property sets. Might be your pointers.


I have seen those template objects, but figured they were holdovers like the Big Boss NPC in the same collection. I'll clone one and see what I can tinker with, thanks a ton!

EDIT: Yep, those outfit templates are where they're stored! It's a simple 3IDR, and I traced them to the default hair and outfits, just like you said. There is also an AGED there that controls age/gender/species/skin color for spawning - could be very useful. Just have to test it out when I have time. Interesting side note: there are files for an NPC paramedic that I've never seen before, would have been a nice feature to have.

Quote:
Originally Posted by jje1000
If this succeeds, then we will have driven a stake through the metaphorical heart of pudding.

♥ Receptacle Refugee ♥
Now also on Tumblr !
Last edited by Qahne : 17th Oct 2017 at 6:06 AM.
Old 17th Oct 2017, 8:55 AM #6
Lamare
just a girl

Join Date: Jan 2014
Posts: 650
Thanks: 3351 in 26 Posts
16 Achievements


Yeah, I've heard something about there being ambulances with features that didn't make it to the light.

Assorted mods: Moving out and job options
Apartment rent agreement mod - fresh update
Testers wellcome on Electrical box & Fertile land
Functional sofa bed is ready to be tested as well
Old 17th Oct 2017, 3:42 PM #7
Chris Hatch
Lab Assistant

Join Date: Dec 2005
Posts: 201


When the game creates an NPC it tests for an outfit GUID being available for that NPC, if so then that GUID is used when the sim is created and that outfit is that sim's everyday outfit. For most NPCs their NPC outfit is also applied every time they are 'called' so they can be made to 'hang out' in regular clothes but still dress for work when 'on the job'.
The Age Data in the NPC outfit templates determines which 3IDR instance to use for the age and gender of the sim. The age/gender for creating NPCs is determined by the global 'NPC - Get Template Age/Gender/Skin in T[0,1,2]'.
Old 18th Oct 2017, 7:11 AM #8
Qahne
Original Poster

Scholar

Join Date: Jun 2009
Posts: 1,014
Thanks: 2221 in 15 Posts
17 Achievements


Interesting stuff, thanks for the input! Had a hunch it wouldn't be that easy to alter spawning rules. Editing those 3IDRs to point to different instances works fine, but I assumed deleting them would just allow the game to select any old item instead - not so. Must be a global that tells the game what it needs from the 3IDR (hair / outfit, some have only one, others have several variants). I have a feeling I can point it to invalid parts and it'll skip over them, like when you force the game to create an NPC that is not the expected age or gender.

Edit: No dice, all that does is make them spawn with the null parts.

Edit 2: Did it! Just have to replace instance number with 0x00000000 and the game will pull parts from the NPC's everyday outfit.

Edit 3: Doesn't work for elder females, gives them a Seasons outfit instead.

Edit 4: Ok, turns out that zeroing the reference only works for hair, not bodies. Zeroing for bodies results in them changing to the outfits sims default to when a mesh is missing. Deleting the references in the GZPS entirely gives the same result. I poked in the BHAVs you mentioned Lamare, they appear to be global for all NPCs, no references to individual classes I could see, so I don't think the answer lies there. Sidenote, in the BHAVs it checks if the game is in Thai when dressing a streaker - if it is, it dresses them in underwear rather than nude. Made me laugh quite a bit

Quote:
Originally Posted by jje1000
If this succeeds, then we will have driven a stake through the metaphorical heart of pudding.

♥ Receptacle Refugee ♥
Now also on Tumblr !
Last edited by Qahne : 21st Oct 2017 at 7:26 AM.
Reply


Section jump:


Powered by MariaDB Some icons by http://dryicons.com.