So on Cowboy Country I have some NPCs to give the look of the town being inhabited. They are temp and only pop up when someone is walking within a certain distance. Most of them work fine. The kids and teacher are always in the schoolhouse when you walk up, the native americans are in their village when you approach, the two women are always conversing on the walk when you go near the hat shop. Doc is always sitting on his porch when you go near. HOWEVER, some of them will not pop up unless I click the prim ball and make them. Which kind of defeats the purpose for the place to look inhabited when outsiders visit.
Any reason why many work but some will not? It's the exact same script.
Thanks.
NPCs MIA
- Fayre Scribe
- Posts: 63
- Joined: Mon Feb 07, 2022 6:39 pm
- Has thanked: 15 times
- Been thanked: 72 times
- Ilan Tochner
- Posts: 6825
- Joined: Sun Dec 23, 2012 8:44 am
- Has thanked: 5408 times
- Been thanked: 4750 times
- Contact:
Re: NPCs MIA
Hi Fayre,
There isn't a set limit to the number of NPCs you can have active at a time. My guess is that the script may be clashing with some other script you have nearby. Try moving one of the scripts and corresponding NPC that isn't working and placing it in an area where the same script does work with a different NPC. If it doesn't work when you do that then try disabling the other working script/NPC and seeing if that changes anything. Once you verify that this script/NPC isn't working due to its current location you can try searching for other scripts in that area that may be clashing with it.
There isn't a set limit to the number of NPCs you can have active at a time. My guess is that the script may be clashing with some other script you have nearby. Try moving one of the scripts and corresponding NPC that isn't working and placing it in an area where the same script does work with a different NPC. If it doesn't work when you do that then try disabling the other working script/NPC and seeing if that changes anything. Once you verify that this script/NPC isn't working due to its current location you can try searching for other scripts in that area that may be clashing with it.
- Christine Nyn
- Posts: 85
- Joined: Sat Mar 07, 2020 10:20 pm
- Has thanked: 273 times
- Been thanked: 154 times
Re: NPCs MIA
Hi Fayre,
I'm assuming that the NPC scripts that activate when an avatar is within a specified range have to scan fairly constantly to make that work, and have to then maintain the scans so that they can close down gracefully when not required. That would necessitate a a fairly high volume of llSensor events if each NPC is doing that independently and it wouldn't surprise me if the region reached a saturation point where some of the events simply got lost.
If you could move to a system where the sensor script (or scripts perhaps) could be located centrally and the NPCs are activated/deactivated via listens and a message generated by the central script that might be a way to solve your problem.
I'm assuming that the NPC scripts that activate when an avatar is within a specified range have to scan fairly constantly to make that work, and have to then maintain the scans so that they can close down gracefully when not required. That would necessitate a a fairly high volume of llSensor events if each NPC is doing that independently and it wouldn't surprise me if the region reached a saturation point where some of the events simply got lost.
If you could move to a system where the sensor script (or scripts perhaps) could be located centrally and the NPCs are activated/deactivated via listens and a message generated by the central script that might be a way to solve your problem.
- Fayre Scribe
- Posts: 63
- Joined: Mon Feb 07, 2022 6:39 pm
- Has thanked: 15 times
- Been thanked: 72 times
Re: NPCs MIA
Being a nontechy, I don't quite understand your solution. However, what I am taking from this is that a temp NPC script is working just as hard as one that just keeps the npc there all the time. Am I reading that right? Though it may not matter since the sim shuts down when not in use and it would have to pop up regardless.
I thought that having them come up only when someone is close would save resources causing less lag. But if the script is continually scanning, maybe not.
Hi Fayre,
I'm assuming that the NPC scripts that activate when an avatar is within a specified range have to scan fairly constantly to make that work, and have to then maintain the scans so that they can close down gracefully when not required. That would necessitate a a fairly high volume of llSensor events if each NPC is doing that independently and it wouldn't surprise me if the region reached a saturation point where some of the events simply got lost.
If you could move to a system where the sensor script (or scripts perhaps) could be located centrally and the NPCs are activated/deactivated via listens and a message generated by the central script that might be a way to solve your problem.
[/quote]
Hi Fayre,
I'm assuming that the NPC scripts that activate when an avatar is within a specified range have to scan fairly constantly to make that work, and have to then maintain the scans so that they can close down gracefully when not required. That would necessitate a a fairly high volume of llSensor events if each NPC is doing that independently and it wouldn't surprise me if the region reached a saturation point where some of the events simply got lost.
If you could move to a system where the sensor script (or scripts perhaps) could be located centrally and the NPCs are activated/deactivated via listens and a message generated by the central script that might be a way to solve your problem.
[/quote]
Last edited by Fayre Scribe on Sun Jul 06, 2025 1:37 am, edited 2 times in total.
- Fayre Scribe
- Posts: 63
- Joined: Mon Feb 07, 2022 6:39 pm
- Has thanked: 15 times
- Been thanked: 72 times
Re: NPCs MIA
So I moved an npc next to the schoolhouse where all the others pop up when you get near. It didn't work. It still doesn't pop up unless I click on the prim ball. hmmmmmm
Hi Fayre,
There isn't a set limit to the number of NPCs you can have active at a time. My guess is that the script may be clashing with some other script you have nearby. Try moving one of the scripts and corresponding NPC that isn't working and placing it in an area where the same script does work with a different NPC. If it doesn't work when you do that then try disabling the other working script/NPC and seeing if that changes anything. Once you verify that this script/NPC isn't working due to its current location you can try searching for other scripts in that area that may be clashing with it.
[/quote]
Hi Fayre,
There isn't a set limit to the number of NPCs you can have active at a time. My guess is that the script may be clashing with some other script you have nearby. Try moving one of the scripts and corresponding NPC that isn't working and placing it in an area where the same script does work with a different NPC. If it doesn't work when you do that then try disabling the other working script/NPC and seeing if that changes anything. Once you verify that this script/NPC isn't working due to its current location you can try searching for other scripts in that area that may be clashing with it.
[/quote]
- Ilan Tochner
- Posts: 6825
- Joined: Sun Dec 23, 2012 8:44 am
- Has thanked: 5408 times
- Been thanked: 4750 times
- Contact:
Re: NPCs MIA
I think Christine may be right. Please try it without a sensor. Just have a script that verifies the existence of the NPCs when a region starts and if they don't exist adds them. You can check the effect that number of NPCs has on your world using the Active World panel in your world page, see: https://kitely.atlassian.net/wiki/space ... erformance
You want to keep the total CPU usage when it's just you in the world to a low single digit so your world will be able to handle more people without lag.
You want to keep the total CPU usage when it's just you in the world to a low single digit so your world will be able to handle more people without lag.
- Kimm Starr
- Posts: 293
- Joined: Wed Jan 30, 2019 7:59 pm
- Has thanked: 411 times
- Been thanked: 489 times
Re: NPCs MIA
I was a big fan of NPCs when I first came to OpenSim. The idea of having moving characters to give my sim a little more action was thrilling until I saw the resources they take up to run. They're laggy as all get out. It's why I went to animesh. No lag and I have like 100 of them on one my lands
I'm obsessed with Animesh and soon you will be too!


