Page 1 of 2

osNpcSay not working?

Posted: Fri Jan 28, 2022 4:37 pm
by John Mela
I've been trying to use the osNpcSay() function, and it seems to fail silently. There's an example on that linked page to test it, which I've pasted at the end of this message.

The same applies to osNpcWhisper() and osNpcShout(). I'm in my own world, and other NPC functions such as osNpcCreate(), osNpcMoveToTarget(), etc work fine. It also works fine on a vanilla OS 0.9 grid.

Is this a Kitely issue? Thanks in advance!

Testing example:

Code: Select all

key npc;
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch to see osNpcSay (without channel) usage.");
    }
 
    touch_start(integer number)
    {
        key toucher = llDetectedKey(0);
        vector npcPos = llGetPos() + <-1.0, 0.0, 1.0>;
        osAgentSaveAppearance(toucher, "appearance");
        npc = osNpcCreate("ImYour", "Clone", npcPos, "appearance");
        state hasNPC;
    }
}
 
state hasNPC
{
    state_entry()
    {
        llSetTimerEvent(5.0);
    }
 
    timer()
    {
        llSetTimerEvent(0.0);
        osNpcSay(npc, "Hello world!");
        osNpcSay(npc, "I Love OpenSimulator!");
        osNpcSay(npc, "The Open Source Metaverse!");
    }
 
    touch_start(integer number)
    {
        osNpcSay(npc, "Goodbye!");
        llSetTimerEvent(0.0);
        osNpcRemove(npc);
        npc = NULL_KEY;
        state default;
    }
}

Re: osNpcSay not working?

Posted: Fri Jan 28, 2022 4:57 pm
by Ilan Tochner
Hi John,

This likely relates to OSSL permissions of your avatar on the world you're in. See: https://www.kitely.com/virtual-world-ne ... functions/

Re: osNpcSay not working?

Posted: Fri Jan 28, 2022 5:22 pm
by John Mela
Thanks Ilan.

But I'm in my own world, and other NPC functions work fine.

The page you linked says that the following functions are "Allowed for the World Manager and Estate Managers", and this is my own world. And other functions in this list work fine:

Code: Select all

osNpcCreate
osNpcGetOwner
osNpcGetPos
osNpcGetRot
osNpcLoadAppearance
osNpcMoveTo
osNpcMoveToTarget
osNpcPlayAnimation
osNpcRemove
osNpcSaveAppearance
osNpcSay
osNpcSayTo
osNpcSetProfileAbout
osNpcSetProfileImage
osNpcSetRot
osNpcShout
osNpcSit
osNpcStand
osNpcStopAnimation
osNpcStopMoveToTarget
osNpcTouch
osNpcWhisper
For example, I'm using osNpcCreate, osNpcMoveToTarget, osNpcStopMoveToTarget, osNpcSit, osNpcStand, osNpcTouch, osNpcPlayAnimation and osNpcStopAnimation, all from the same list.

The functions that don't work are osNpcSay, osNpcShout and osNpcWhisper.

Could you look into this please? Thanks.

Re: osNpcSay not working?

Posted: Fri Jan 28, 2022 7:20 pm
by Ilan Tochner
Is your avatar the one that created the NPCs that you're trying to use these functions on?

Re: osNpcSay not working?

Posted: Fri Jan 28, 2022 7:56 pm
by John Mela
Yes, the script that creates the NPCs is in an object owned by me (the world owner). The design of the system we're developing depends on the objects being owned by the region owner or administrator, so that's a reasonable requirement.

Re: osNpcSay not working?

Posted: Sat Jan 29, 2022 12:20 am
by Ilan Tochner
Hi John,

I tested the script you posted by rezzing a cube in Kitely Merchants Sandbox adding that script to it then pressing the cube. The script works and the NPC messages appear in local chat. In other words, I can't reproduce the problem you reported.

Re: osNpcSay not working?

Posted: Sat Jan 29, 2022 1:30 pm
by John Mela
Thanks, Ilan, that's surprising and very helpful. I'll look into this some more and report back.

Re: osNpcSay not working?

Posted: Sat Jan 29, 2022 1:54 pm
by Graham Mills
I have very vague recollections of something like this happening once. I wonder if the chat is emitted in the wrong place, perhaps where the npc rezzed rather than its current location. You might need some sort of relay.

Re: osNpcSay not working?

Posted: Sun Jan 30, 2022 11:49 pm
by John Mela
Thanks, Graham. In this case, though, both the rezzing objects and the NPCs were very close to me, certainly within the 20m limit for chat (not to mention the shout distance!).

Re: osNpcSay not working?

Posted: Tue Feb 01, 2022 7:47 pm
by John Mela
OK, I've managed to find out why it was working on some regions and not others. It's the "Anyone can visit" checkbox on the Access tab of About Land.

Ilan, could you try disabling that option, and run the test again?

I find that if I disable that option, osNpcSay chat on channel 0 doesn't get propagated (including scripted listeners), but works OK on non-public channels. If I enable the option, everything works. I normally have that option disabled on my land, which is why it wasn't working for me.

Presumably, this isn't intended behaviour!