Hey everyone! I’ve decided to take some time out of my life to re-write this NPC module for better speed, better flexibility, and just generally, better setup. I’ll be writing a more detailed and informative post below.
What is Ez NPC? Ez NPC is a open-source module created by Mystifine that provides an easy to set up NPC system within minutes! The module was created to handle large quantities of npc’s spreaded across large maps. This module provides a wide variety of options almost suitable for any situation at all! So let’s go over the features that it provides:
Feel free to leave and suggestions on improvements, suggestion on features and etc. Happy grinding!
Developer Note:
There are much much more things that are small but extremely helpful that I haven’t listed. The main purpose of this module is used for dumb NPC’s that need to achieve simple things such as combat. It’s possible to create intelligent NPC’s with more interesting features, however, it’s not recommended on the module.
one more thing to everyone, you can have pre existing NPC’s to manually override their spawn points if you don’t like how the AI randomly spawns near their spawner. The script will find the nearest spawner and assign that npc to that spawner.
Fixed a bug that made the NPC visually lag when rotating towards you, (method is to pre create a BodyGyro to rotate the NPC while enabling to move)
Added a NPC_CAN_JUMP property to Properties, this will allow npcs to jump if there is a obstacle in the way. (Method is to cast a small ray)
Other Minor Changes
Note
Feel free to reply with feature requests or bugs and I will look into it when I have the time. The GitHub has also been updated to the most recent Version.
I like it but i think you need to add pictures and and maybe a tutorial maybe would be nice i like it! it really easy to use but i still think there should be a tutorial.
Version 0.03 Update
Hey everyone. I’ve completed rewritten the module and the post all together for a better module. There are potential new bugs that exist, please let me know if you encounter any. If you need assistance, please take a look at the reference file I’ve provided in the original post, if you still need help or have questions / suggestions, feel free to leave a reply.
Version 0.04 Update
Updated NPC movement behavior, before the npc moved to the exact point on the target, now they move AttackRange away.
Hello. Very cool module you’ve got here. I have two bugs though.
Whenever a few of my NPCs die, or fling away, their model will remain inside the Entities folder, and it will cause the script to give this error
I also others that relate to the actual contents of the Model being empty due to deaths, flings etc.
Whenever the NPCs are moving and colliding a lot, they sometimes may go “inactive” and not move for a couple of minutes, to then all of a sudden start moving at random intervals.
In your example build, which I copied the module and code from, if you test play it you’ll eventually find these glitches.
Thanks for reading!
Hello! Thank you for addressing these issues. I’ve went back to the module and made some adjustments. I’m somewhat confident that the first bug has been patched, not so sure about the second one. If the issue still persists please provide visual representation of the bug. It’s recommended to remove collision between NPC in config file. I’ve updated the reference place as well as the model (To ensure you have the latest version, make sure to restart your studio session to re-insert the model).
Version 0.04 Update:
Improved performance (previously there was a mistake in the code order)
Fixed a bug that caused NPC to not respond after death
After some testing in my own game, I’ve noticed that NPC’s do not respawn after the first respawn. This is due to me forgetting to re-connect death events. I’ve fixed this in the new update. The place file in the original post has also been updated. Please update your modules, you’re MobData and Config files are portable. The only thing that was changed was in the Mob module.
When an NPC dies, it respawns where it was originally spawned. For example, if the NPC followed you and you kill it 50 studs away from the original spawn point, when the NPC dies, it’ll spawn back at the original spawn point (it won’t spawn where you killed it).
Unfortunately, at the moment there isn’t built in way to specifically set a individual npc’s location, however, you can use parts and place them around areas where they will spawn. With that being said, there is a way to work with this (kinda hacky but with the feature to set individual part spawn quantities it’s not that bad), if you were to set the NPC spawn quantity to 1 and made a very small part, it’ll spawn at that small part. So technically, yes there is a specify a mob’s spawn point.
In terms of coding, there are additional customizations that can be done, but an individual should be able to easily follow along and setup the system from the reference file provided.
You’d drag the part (the spawner). I’ve provided a place file in the original post as an example. Consider taking a look in there (on how it’s setup). Feel free to ask me more questions.
Update 0.06
Fixed a bug that made the NPC’s not go to nearest enemy.