OSSL, NPC's and scripts...

Creating scripts
User avatar
JoJo Dreamer
Posts: 11
Joined: Tue Apr 19, 2022 12:22 pm
Has thanked: 11 times
Been thanked: 8 times

Re: OSSL, NPC's and scripts...

Post by JoJo Dreamer »

Graham Mills wrote:
Wed Jun 29, 2022 4:42 pm
Not an expert but I note that Active-NPC has a permissions system. I wonder if that's causing the problem (see under Permissions).

https://github.com/opensimworld/active-npcs
That part sets permissions to limit access to NPCs, and to specific commands to certain users or to all users. Just in case i set all three possible instances to ALLOW. But no difference in this matter.
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: OSSL, NPC's and scripts...

Post by Graham Mills »

OK, so I dug out my (probably venerable) copy of Active-NPC, wore the listener and created and loaded an NPC called Bob. I placed an anim called rock7 in the controller.

I then typed "Bob anim rock7" in local chat and he danced until stopped.

I then rezzed a prim and added a script that chatted "Bob anim rock7" in local when I touched the prim and, again, he danced until stopped.

If I chat the command "Bob say Bob anim rock7", again he dances even though he issued the command himself.

The version I'm using doesn't support an NPC-initiated touch event afaik although you could trigger a collision as an alternative. So if I add a script to a large flattened prim that uses a collision event to trigger the anim, then issue the command "Bob follow me" such that he is forced to walk over the prim, again he dances.
Last edited by Graham Mills on Wed Jun 29, 2022 7:36 pm, edited 1 time in total.
These users thanked the author Graham Mills for the post:
JoJo Dreamer
User avatar
Spax Zorin
Posts: 13
Joined: Sat Nov 19, 2016 7:56 pm
Has thanked: 1 time
Been thanked: 19 times

Re: OSSL, NPC's and scripts...

Post by Spax Zorin »

I decided to create a script which tells it to reset "..Controller" inside Active NPC.

Code: Select all

default
{
    state_entry()
    {
        llListen(70, "", "", "");
    }
    
    listen(integer ch, string name, key id, string msg)
    {
        if (msg == "reboot")
        {
        llResetOtherScript("..Controller");    
        }
    }
}
An Avatar, NPC or Prim (using llRegionSay) can issue the channel command telling the main ..Controller script to restart. The reason this is being done is so that Active NPC can pick up and control any NPC wearing a 'command module' which was not initially rezzed by ActiveNPC itself. The goal here is to have a fully functioning simulation filled with automatons every time an "On Demand" region is started. This workaround should allow active NPC to function as JoJo Dreamer intended.
These users thanked the author Spax Zorin for the post (total 2):
Graham MillsJoJo Dreamer
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: OSSL, NPC's and scripts...

Post by Graham Mills »

I think I misunderstood. Good to have it sorted.
User avatar
JoJo Dreamer
Posts: 11
Joined: Tue Apr 19, 2022 12:22 pm
Has thanked: 11 times
Been thanked: 8 times

Re: OSSL, NPC's and scripts...

Post by JoJo Dreamer »

Spax Zorin wrote:
Wed Jun 29, 2022 7:28 pm
I decided to create a script which tells it to reset "..Controller" inside Active NPC.

Code: Select all

default
{
    state_entry()
    {
        llListen(70, "", "", "");
    }
    
    listen(integer ch, string name, key id, string msg)
    {
        if (msg == "reboot")
        {
        llResetOtherScript("..Controller");    
        }
    }
}
An Avatar, NPC or Prim (using llRegionSay) can issue the channel command telling the main ..Controller script to restart. The reason this is being done is so that Active NPC can pick up and control any NPC wearing a 'command module' which was not initially rezzed by ActiveNPC itself. The goal here is to have a fully functioning simulation filled with automatons every time an "On Demand" region is started. This workaround should allow active NPC to function as JoJo Dreamer intended.
Spax! Yay! That did it! Problem solved and a happy happy Jojo :) Big thank's Ilam and Graham for taking time looking into it, and a HUGE thank you to Spax for solving it!
These users thanked the author JoJo Dreamer for the post (total 3):
Ilan TochnerSpax ZorinGraham Mills
User avatar
Spax Zorin
Posts: 13
Joined: Sat Nov 19, 2016 7:56 pm
Has thanked: 1 time
Been thanked: 19 times

Re: OSSL, NPC's and scripts...

Post by Spax Zorin »

FURTHER CLARIFICATION: ActiveNPC framework is the best utility for powering a region full of NPCs however it does have some flaws. Sometimes NPCs will not reposition themselves properly nor correctly execute a list of initialization commands, this can be attributed to the number of mysql calls and other back-end processes using resources at startup. Anyone with experience using NPCs will know that Rezzing them is the laggiest part of the process, especially when you have 10+ bots rezzing at the same time.

The ideal way to operate ActiveNPC is to have it running continuously. On Kitely, this is not possible. The only workaround is to REZ one NPC who will then go through the process of rezzing additional NPCs (one by one with a short delay) from their pose prims AFTER the region has started. Once the automatons are inworld, resetting the ActiveNPC controller is necessary to be able to "Activate" the bots so they can accept commands.

Years ago I was in a situation where I had to run my regions on a netbook (that's right and Atom processor with 2 gigs of ram) and I used the aforementioned method to get my NPCs loaded in their simulated roles.

In helping JoJo, I discovered other ways of making ActiveNPC startup more efficiently. I am pleased you have everything working to your satisfaction!
These users thanked the author Spax Zorin for the post (total 4):
Ilan TochnerJoJo DreamerGraham MillsSelby Evans
Post Reply