Mantis Bug Tracker

View Revisions: Issue #8400 All Revisions ] Back to Issue ]
Summary 0008400: More logical NPC's detection with llGetAgentList and replacing ssp.IsViewerUIGod with ssp.IsGod.
Revision 2018-10-26 16:23 by Mandarinka Tasty
Description Hello.

I've added more logical processing of NPCs' detection accordingly to applied NPC flags. Addtionally I've replaced ScenePresence bool IsViewerUIGod with correct IsGod.

The description of logics I have applied is as follows:

1. If bool AllowSenseAsAvatar = false ( OpenSim.ini , OpenSimDefaults.ini)

then NPC detection is not possible with llGetAgentList

Now we set AllowSenseAsAvatar = true in ini file.

2. If flag AGENT_LIST_EXCLUDENPC is applied as a scope in llGetAgentList

then NPC detection is not possible with llGetAgentList.

3. If NPC is not created with flag OS_NPC_SENSE_AS_AGENT within osNpcCreate

then NPC detection is not possible with llGetAgentList.

Those cases have been introduced by me as logical union = p v q v r,that means if one of them is true, then NPC detection is not possible with llGetAgentList.

To make NPC detection possible with my version of llGetAgentList one needs:

1. set bool AllowSenseAsAvatar = true in ini file.
2. do not use flag AGENT_LIST_EXCLUDENPC
3. create NPC using osNpcCreate with flag: OS_NPC_SENSE_AS_AGENT

I hope my explanations above are appropriately understandable.

In-world script school example:

integer i;
key npc = NULL_KEY;

default
{
    touch_start(integer num)
    {
        if(npc == NULL_KEY)
        {
            osOwnerSaveAppearance("MyClone");
            llSetTimerEvent(2);
        }
        else
        {
            osNpcRemove(npc);
            llRemoveInventory("MyClone");
            llResetScript();
        }
    }
    timer()
    {
        llSetTimerEvent(0);
        if(i == 0)
        {
            npc = osNpcCreate("John","Smith",llGetPos()+<0,0,2>,"MyClone",OS_NPC_SENSE_AS_AGENT);
            i=1;
            llSetTimerEvent(5);
        }
        else
        {
            list agents = llGetAgentList(AGENT_LIST_REGION, []);
            integer j;
            while (j < llGetListLength(agents))
            {
                string bot = "";
                key id = llList2Key(agents,j);
                string name = llKey2Name(id);
                if(npc == id)
                {
                    bot = "\t<--- NPC has been detected!\n"
                }
                llOwnerSay(name + " [ " + (string)id + " ]" + bot);
                ++j;
            }
        }
    }
}
Revision 2018-10-25 14:50 by Mandarinka Tasty
Description Hello.

I've added more logical processing of NPCs' detection accordingly to applied NPC flags. Addtionally I've replaced ScenePresence bool IsViewerUIGod with correct IsGod.

The description of logics I have applied is as follows:

1. If bool AllowSenseAsAvatar = false ( OpenSim.ini , OpenSimDefaults.ini)

then NPC detection is not possible with llGetAgentList

Now we set AllowSenseAsAvatar = true in ini file.

2. If flag AGENT_LIST_EXCLUDENPC is applied as a scope in llGetAgentList

then NPC detection is not possible with llGetAgentList.

3. If NPC is not created with flag OS_NPC_SENSE_AS_AGENT within osNpcCreate

then NPC detection is not possible with llGetAgentList.

Those cases have been introduced by me as logical union = p v q v r,that means if one of them is true, then NPC detection is not possible with llGetAgentList.

To make NPC detection possible with my version of llGetAgentList one needs:

1. set bool AllowSenseAsAvatar = true in ini file.
2. do not use flag AGENT_LIST_EXCLUDENPC
3. create NPC using osNpcCreate with flag: OS_NPC_SENSE_AS_AGENT

I hope my explanations above are appropriately understandable.

In-world script school example:

integer i;
key npc = NULL_KEY;

default
{
    touch_start(integer num)
    {
        if(npc == NULL_KEY)
        {
            osOwnerSaveAppearance("MyClone");
            llSetTimerEvent(2);
        }
        else
        {
            osNpcRemove(npc);
            llRemoveInventory("MyClone");
            llResetScript();
        }
    }
    timer()
    {
        llSetTimerEvent(0);
        if(i == 0)
        {
            npc = osNpcCreate("John","Smith",llGetPos()+<0,0,2>,"MyClone",OS_NPC_SENSE_AS_AGENT);
            i=1;
            llSetTimerEvent(2);
        }
        else
        {
            list agents = llGetAgentList(AGENT_LIST_REGION, []);
            integer j;
            while (j < llGetListLength(agents))
            {
                key id = llList2Key(agents,j);
                string name = llKey2Name(id);
                llOwnerSay(name + " [ " + (string)id + " ]");
                if(npc == id)
                {
                    llOwnerSay("\n\nNPC has been detected!\n");
                }
                ++j;
            }
        }
    }
}
Revision 2018-10-25 14:25 by Mandarinka Tasty
Description Hello.

I've added more logical processing of NPCs' detection accordingly to applied NPC flags. Addtionally I've replaced ScenePresence bool IsViewerUIGod with correct IsGod.

The description of logics I have applied is as follows:

1. If bool AllowSenseAsAvatar = false ( OpenSim.ini , OpenSimDefaults.ini)

then NPC detection is not possible with llGetAgentList

Now we set AllowSenseAsAvatar = true in ini file.

2. If flag AGENT_LIST_EXCLUDENPC is applied as a scope in llGetAgentList

then NPC detection is not possible with llGetAgentList.

3. If NPC is not created with flag OS_NPC_SENSE_AS_AGENT within osNpcCreate

then NPC detection is not possible with llGetAgentList.

Those cases have been introduced by me as logical union = p v q v r,that means if one of them is true, then NPC detection is not possible with llGetAgentList.

To make NPC detection possible with my version of llGetAgentList one needs:

1. set bool AllowSenseAsAvatar = true in ini file.
2. do not use flag AGENT_LIST_EXCLUDENPC
3. create NPC using osNpcCreate with flag: OS_NPC_SENSE_AS_AGENT

I hope my explanations above are appropriately understandable.

In-world script school example:

integer i;
key npc = NULL_KEY;

default
{
    touch_start(integer num)
    {
        if(npc == NULL_KEY)
        {
            osOwnerSaveAppearance("MyClone");
            llSetTimerEvent(2);
        }
        else
        {
            osNpcRemove(npc);
            llRemoveInventory("MyClone");
            llResetScript();
        }
    }
    timer()
    {
        llSetTimerEvent(0);
        if(i == 0)
        {
            npc = osNpcCreate("John","Smith",llGetPos()+<0,0,2>,"MyClone",OS_NPC_SENSE_AS_AGENT);
            i=1;
            llSetTimerEvent(2);
        }
        else
        {
            list agents = llGetAgentList(AGENT_LIST_REGION, []);
            integer j;
            while (j < llGetListLength(agents))
            {
                key id = llList2Key(agents,j);
                string name = llKey2Name(id);
                llOwnerSay(name + " [ " + (string)id + " ]");
                ++j;
            }
        }
    }
}
Revision 2018-10-25 14:25 by Mandarinka Tasty
Description Hello.

I've added more logical processing of NPCs' detection accordingly to applied NPC flags. Addtionally I've replaced ScenePresence bool IsViewerUIGod with correct IsGod.

The description of logics I have applied is as follows:

1. If bool AllowSenseAsAvatar = false ( OpenSim.ini , OpenSimDefaults.ini)

then NPC detection is not possible with llGetAgentList

Now we set AllowSenseAsAvatar = true in ini file.

2. If flag AGENT_LIST_EXCLUDENPC is applied as a scope in llGetAgentList

then NPC detection is not possible with llGetAgentList.

3. If NPC is not created with flag OS_NPC_SENSE_AS_AGENT within osNpcCreate

then NPC detection is not possible with llGetAgentList.

Those cases have been introduced by me as logical union = p v q v r,that means if one of them is true, then NPC detection is not possible with llGetAgentList.

To make NPC detection possible with my version of llGetAgentList one needs:

1. set bool bool AllowSenseAsAvatar = true in ini file.
2. do not use flag AGENT_LIST_EXCLUDENPC
3. create NPC using osNpcCreate with flag: OS_NPC_SENSE_AS_AGENT

I hope my explanations above are appropriately understandable.

In-world script school example:

integer i;
key npc = NULL_KEY;

default
{
    touch_start(integer num)
    {
        if(npc == NULL_KEY)
        {
            osOwnerSaveAppearance("MyClone");
            llSetTimerEvent(2);
        }
        else
        {
            osNpcRemove(npc);
            llRemoveInventory("MyClone");
            llResetScript();
        }
    }
    timer()
    {
        llSetTimerEvent(0);
        if(i == 0)
        {
            npc = osNpcCreate("John","Smith",llGetPos()+<0,0,2>,"MyClone",OS_NPC_SENSE_AS_AGENT);
            i=1;
            llSetTimerEvent(2);
        }
        else
        {
            list agents = llGetAgentList(AGENT_LIST_REGION, []);
            integer j;
            while (j < llGetListLength(agents))
            {
                key id = llList2Key(agents,j);
                string name = llKey2Name(id);
                llOwnerSay(name + " [ " + (string)id + " ]");
                ++j;
            }
        }
    }
}
Revision 2018-10-25 14:24 by Mandarinka Tasty
Description Hello.

I've added more logical processing of NPCs' detection accordingly to applied NPC flags. Addtionally I've replaced ScenePresence bool IsViewerUIGod with correct IsGod.

The description of logics I have applied is as follows:

1. If bool AllowSenseAsAvatar = false ( OpenSim.ini , OpenSimDefaults.ini)

then NPC detection is not possible with llGetAgentList

Now we set AllowSenseAsAvatar = true in ini file.

2. If flag AGENT_LIST_EXCLUDENPC is applied as a scope in llGetAgentList

then NPC detection is not possible with llGetAgentList.

3. If NPC is created with flag OS_NPC_SENSE_AS_AGENT within osNpcCreate

then NPC detection is possible with llGetAgentList.

Those cases have been introduced by me as logical union = p v q v r,that means if one of them is true, then NPC detection is not possible with llGetAgentList.

To make NPC detection possible with my version of llGetAgentList one needs:

1. set bool bool AllowSenseAsAvatar = true in ini file.
2. do not use flag AGENT_LIST_EXCLUDENPC
3. create NPC using osNpcCreate with flag: OS_NPC_SENSE_AS_AGENT

I hope my explanations above are appropriately understandable.

In-world script school example:

integer i;
key npc = NULL_KEY;

default
{
    touch_start(integer num)
    {
        if(npc == NULL_KEY)
        {
            osOwnerSaveAppearance("MyClone");
            llSetTimerEvent(2);
        }
        else
        {
            osNpcRemove(npc);
            llRemoveInventory("MyClone");
            llResetScript();
        }
    }
    timer()
    {
        llSetTimerEvent(0);
        if(i == 0)
        {
            npc = osNpcCreate("John","Smith",llGetPos()+<0,0,2>,"MyClone",OS_NPC_SENSE_AS_AGENT);
            i=1;
            llSetTimerEvent(2);
        }
        else
        {
            list agents = llGetAgentList(AGENT_LIST_REGION, []);
            integer j;
            while (j < llGetListLength(agents))
            {
                key id = llList2Key(agents,j);
                string name = llKey2Name(id);
                llOwnerSay(name + " [ " + (string)id + " ]");
                ++j;
            }
        }
    }
}
Revision 2018-10-25 14:23 by Mandarinka Tasty
Description Hello.

I've added more logical processing of NPCs' detection accordingly to applied NPC flags. Addtionally I've replaced ScenePresence bool IsViewerUIGod with correct IsGod.

The description of logics I have applied is as follows:

1. If bool AllowSenseAsAvatar = false ( OpenSim.ini , OpenSimDefaults.ini)

then NPC detection is not possible with llGetAgentList

Now we set AllowSenseAsAvatar = true in ini file.

2. If flag AGENT_LIST_EXCLUDENPC is applied as a scope in llGetAgentList

then NPC detection is not possible with llGetAgentList.

3. If NPC is created with flag OS_NPC_SENSE_AS_AGENT within osNpcCreate

then NPC detection is not possible with llGetAgentList.

Those cases have been introduced by me as logical union = p v q v r,that means if one of them is true, then NPC detection is not possible with llGetAgentList.

To make NPC detection possible with my version of llGetAgentList one needs:

1. set bool bool AllowSenseAsAvatar = true in ini file.
2. do not use flag AGENT_LIST_EXCLUDENPC
3. create NPC using osNpcCreate with flag: OS_NPC_SENSE_AS_AGENT

I hope my explanations above are appropriately understandable.

In-world script school example:

integer i;
key npc = NULL_KEY;

default
{
    touch_start(integer num)
    {
        if(npc == NULL_KEY)
        {
            osOwnerSaveAppearance("MyClone");
            llSetTimerEvent(2);
        }
        else
        {
            osNpcRemove(npc);
            llRemoveInventory("MyClone");
            llResetScript();
        }
    }
    timer()
    {
        llSetTimerEvent(0);
        if(i == 0)
        {
            npc = osNpcCreate("John","Smith",llGetPos()+<0,0,2>,"MyClone",OS_NPC_SENSE_AS_AGENT);
            i=1;
            llSetTimerEvent(2);
        }
        else
        {
            list agents = llGetAgentList(AGENT_LIST_REGION, []);
            integer j;
            while (j < llGetListLength(agents))
            {
                key id = llList2Key(agents,j);
                string name = llKey2Name(id);
                llOwnerSay(name + " [ " + (string)id + " ]");
                ++j;
            }
        }
    }
}


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker