@SimmerFrustrated I know this is not what you have in mind, so please forgive the shortcomings of my answer. I almost always use fencing and door locking to deal with my pets, as I never want to lose one... which I never have done.
Kinder and gentler options...
- You can put a fence around just the back yard or just one section of the back yard that you want your pet to be able to enjoy. Then lock all doors to the cat except the one that goes to that area.
- Go with no fencing and just lock all doors to the cat. The litter box is inside, and that is where the cat goes potty anyway.
- You could lock a large area of the home to all but household members so the cat can get away from the friend if it wants to, yet still be indoors.
- You can make sure your cat doesn't have any traits that lead it to want to wander. If the cat has any traits that make it potentially want to wander, you can use cheats (or a Mod, if you were on PC/Mac) to re-trait the cat.
- You can check the roommate's friend and make sure he/she doesn't have any traits that lead him/her to want to be mean to the cat. If the friend has any traits that make it potentially want to wander, you can use cheats (or a Mod, if you were on PC/Mac) to re-trait the friend.
- You can hunt down the roommate's friend in households and check them out in CAS. Make sure he/she doesn't have any traits that lead him/her to want to be mean to the cat. If the friend has any traits that make it potentially want to wander, you can use cheats(or a Mod, if you were on PC/Mac) to re-trait the friend.
- You can use cheats or a Mod to make the cat and friend have 100% friendship and see if that helps.
You can take off the gloves. In my book, when a Sim I have no commitment to is being mean or going too far, all bets are off and I'm open to stepping in...
- You can hunt down the roommate's friend in households and delete the friend.
- You can get rid of the roommate and make sure the friend knows they are unwelcome in the home. Lock the door to them.
- You could try kicking the friend out each time the come, but that is not likely to do much for your relationship with the roommate, and the roommate will likely continue to invite them and let them in. I assume if you lock the doors to the friend the roommate could still let them in, but you could try.
- If you cannot find the friend in households in order to delete them, they may be an NPC. If this is the case you could have your Sim befriend them and get the relationship high and ask them to move in (or just join them to the household via cheat). Once they are in the household, go to households and move the friend into their own household, then delete the household.