Thank you. I will implement this and then work on a better way down the road.
I plan to do this once every half hour of game time for about 20 npcs. and possibly once per npc when the npc is actively looking for a job/home at the beginning of the game. npcs take turns doing this kind of searching. do you foresee a noticeable fps drop?
Regarding the use of arrays as you mentioned before, how would you dynamically add all new beds made to the array to make them available for use? for instance, I build new homes, and homeless npcs then go "oh, a new bed is available" and fill that bed?
thanks for your help so far!