Re: Prevent Sim Generation
The game will assign townies to be in NPC roles because they're not "playable careers." For example, librarian or paparazzi or Realm of Magic Sage or Restaurant Chef/Waitress. If you play the NPC, they'll lose their NPC role and become unemployed.
On the other hand, maybe you really want a Sim you created to be the librarian or a Realm of Magic Sage. That's doable, but you have to mark them unplayed and can never play them (unless there's a mod for that specific NPC role). The following threads might help:
And for what does and doesn't break NPCs:
https://answers.ea.com/t5/General-Discussion-Feedback/Protecting-NPCs-from-losing-their-jobs/m-p/10700620#M55725
There's a whole slew of hidden traits in this thread: https://forums.thesims.com/en_US/discussion/900951/hidden-traits/ I have NOT tried ANY of them.
I've done some things with NPCs like I got Sara Scott pregnant with MCCC so I could fulfill her wish of having kids without "breaking" her, and also have a Sim married to Simeon Silversweater and have never played him, he's our "roommate." Simeon has 3 kids and I used MCCC to check his parenting skill level (he's level 6 from kids asking for help with homework, etc.). So you can marry NPCs (as long as they don't join your household), have children with them, move them in as roommates, etc., but once they're NPCs you can't play them, ever, without breaking them, and some NPCs are fine in houses and others break if MCCC puts them in houses (mail carrier, I hear). You can shift-click to add the Grim Reaper to your household, and an identical one will spawn to do the actual reaping because that's an NPC role. And yes, another one of my Sims married Morgyn Ember and he retired on his wedding day because I moved him in and played him.
I'm not sure whether that helps or not, but I think that's what you're asking... I hope it does.