Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 15th Apr 2025 at 8:54 PM
Default I need help to finish my apartment neighbors mod
Hi everyone!

I'm developing a mod that deals with apartment neighbors. I began by expanding the awesome mod made by midgethetree, because I’m addicted to complexity.

My goal is to expand the mod by creating four distinct lists of NPCs instead of just one: low-class NPCs, middle-class NPCs, high-class NPCs, and uni NPCs. I want every one of the game's (safe) NPCs to have a chance of getting an apartment.

I have also increased the number of family instances that the game considers. Now, all lot classes should be able to choose from four family instances, using townies only as a last resort when none of the other instances have available Sims.

The problem I'm facing is that during testing, apartments are frequently assigned to townies, while service NPCs rarely get one. I want townies to be the final option, but I'm not sure what is still missing in the code.

I'll attach some screenshots, and I hope some of you can help me fix the issue!

Thanks in advance!

The only good moth is a dead moth ?
Test Subject
Original Poster
#2 Old 16th Apr 2025 at 11:13 PM
For future reference, I've eventually solved the issue.
I've added a local variable (local 0x01) that counts what "attempt" the BHAV is actually at.
This way, it will cycle between the four family instances for each lot class.
If the BHAV can't find a suitable sim in the first family instance (param 0), it raises the counter by one and gives to param 0 the value of temp [local 0x01] (pseudocode), and the cycle repeats.
If local 0x01 reaches 4, then the param 0 is set to the townies value.

The only good moth is a dead moth ?
Back to top