README
Visit our Discord / Homepage / Store !
Requirements / Dependencies
The following resources are required for nss_npc to work:
Changelog
See CHANGELOG.md for more information.
Features
Simple static NPC generator that is optimized for performance to prevent entity overflow (e.g. if too many NPCs are spawned then no more other entities like animals does not spawn anymore).
Creates static NPCs at specific coordinates.
Performance-system to prevent entity overflow.
NPCs spawn on client if player reach a certain distance.
Optional: Multiple animations.
Optional: Multiple time windows (e.g. NPC only spawn between 8am - 12am and 2pm - 8pm).
Optional: Enable weapon.
Configurable Scale
Configurable model and outfit
Configurable spawn radius
Optional: Blip support
Optional: Blip color changes if NPC is visible between time window
NPC definition validator to help you out if you make a mistake in your config.
Open ToDo's
Currently, nothing.
Known issues
If the player idles too long and the game camera changes to idle animation then sometimes the NPC gets a new entity number so the script does not know the real entity anymore. If you now restart the script the NPC will not be removed.
To small NPCs slowly drifting to ground on spawn. Ensure the NPC is placed a little more down on the z-axis.
Setup script
Ensure that the
nss_npcfolder is in yourresourcesfolder.Create your NPCs definitions as files in the
npcsfolder. See jack_the_butcher.demo.lua and jacks_little_brother.demo.lua for examples.Rename config.demo.lua to
config.luaand fill in the values.Add
ensure nss_npcto yourserver.cfg.Restart your server.
NPC definition
Advanced example of all available options
FAQ
Can I combine animations and scenarios?
Yes, but be aware that some animations can stop scenarios and vice versa. So you have to test it out.
Can I combine animations and weapons?
Yes, but be aware that some animations do not work with weapons or result in dropping the weapon. So you have to test it out.
What is the best spawn radius?
It depends on if the NPC is outside or inside. If the NPC is outside then we recommend a radius of 100 meters otherwhise 20 meters.
If your server has really a lot of players and NPCs than you should reduce the radius to 50 meters for outside.
What is the "entity overflow"?
If too many entities are spawned then no more other entities like animals spawn anymore. This is a known issue of REDM / RDR2. This script helps you to avoid this situation if you have a lot of NPCs.
Can I put all my NPCs in one file?
Yes, but we recommend to split them up into multiple files. This makes it easier to maintain your NPCs.
Example for one file with all NPCs directly in the config:
The NPC does not spawn, what can I do?
Check if the NPC z-axis is not below the ground. If so then increase the z-axis value.
Check if you have defined a time window and if the current time is within that time window.
Check if you have defined a spawn radius and if the player is within that radius.
Check if you have not too many entities spawned already.
Check if there are related errors in the client console or server console. Sometimes the config is not valid. It could be possible that a bug in the script causes this. In this case please contact us.
What can I do if the NPC stucks in ground, e.g. if spawned in a building?
You can use prevent_place_on_ground to prevent this. But be aware that the NPC will spawn in the air.
Last updated
Was this helpful?