Author Topic: NPC spawning  (Read 352 times)

Legacy_littlerogue

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
NPC spawning
« on: February 17, 2015, 07:35:05 pm »


               

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!



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
NPC spawning
« Reply #1 on: February 17, 2015, 08:10:53 pm »


               

A lot will depend on the type of module you are creating. The method you've described should be fine if its a single player module or even if used as a small PW. In the end, how many total areas, scripts, custom palette entries will dictate how to get the best performance out of the module and it is possible that despawning NPCs in unoccupied areas would help. I think more details on the design and usage and size of the module are in order before most of us can really give useful input here.



               
               

               
            

Legacy_littlerogue

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
NPC spawning
« Reply #2 on: February 17, 2015, 09:18:50 pm »


               

Thanks. I'm glad at least that my method isn't crazy lol. The module is a single player module that will consist of many different areas both in city, and in rural areas. I don't have the full project scoped out yet as I am still thinking about plot lines and writing all of that good stuff out, as well as still doing some world creation stuff on paper. I am shooting for about 8 hours of content including side quests and exploring everything.