Is there a way to make a NPC CROWD System?

1585739235668.png


I wanted to event a NPC crowd system in which events are spawned from a certain location and they follow a certain path till they exit the map through another path. Knowing that we have the final destination value of the event how would one event such a system.

This system is exactly as Pokemon Black and White Castelia City and Join Avenue.
1585739425786.png
you can event that.

In pure eventing, you'll need an area of the map that is not visible to the player to "store" the events pretending to be NPCs. Then you have one controlling event that decides when to teleport that event to the player area and assign it an move route, and take care to teleport it back after the move route is finished.

If you add a plugin to clone events then you can make it somewhat easier, cloning the event when appropiate and having it erase itself after its move route.

It's just a lot of work because you have to take care of all move routes, but nothing really difficult in itself.
I figured something out of Yanfly Event Spawner, Self Variable and Shaz Smart Pathfinding. It works as follows :-

1) Check which event to spawn from the Test Map (To make sure no two events are the same.)
2) Spawn the Event from the Map at a specific Region.
3) Allocate the Self Variable of the final randomly generated destination of the event where it moves to.
4) SmartPath to that location, with a parallel process on that generated event.
5) Wait a certain amount of time before repeating the process.

The entire event is set to Parallel Process.

It works just fine but the only way I can control the amount of NPC's spawned is by the wait function. If there was a way to check "How many events are present in this Map" then I wound make the Spawner stop spawning if it reaches a high number.
Screenshot_1.jpg
Screenshot_2.jpg

Also due to Shaz Pathfinding sometimes events dont stop and talk to the player but continue to move in their pathfinding direction. I have implemented a event sensor which switches when the player is close enough so that it stops pathfinding and talks to the player. But sometimes it doesnt work.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-make-a-npc-crowd-system.119692/