I am working on a new module, currently building out a good sized city and I am trying to figure out the best way to handle NPC spawning. Basically I have a system where NPCs come out during the day, and "go home" (really disappear) at night. Currently I am just running a script for the on Area Load that checks for the time of day. Basically I have all of my NPCs created and placed prior in an area that the PC cannot access. I then populate the area with waypoints. During the day, the script will run and ActionJumpToLocation the NPCs from there holding space to the city proper, and at night it will move them back to the holding place. Does this make sense? I am not at home, so I can't share the exact script.
What I am wonder is, is there a better or more efficient way to do this? Is there a way to maybe, instead of having the NPCs pre placed in an area, and then forcing them to jump to waypoints, can I have aurora just create the NPCs from my palette of custom NPCs and then de-spawn them when they aren't needed? My thought with this would be, I would lose any local variables set on that specific NPC wouldn't I?
I don't hate the system I have in place now - it seems to work ok. I am just not sure if it is the best way. Thanks!