Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008400opensim[REGION] Script Functionspublic2018-10-25 14:222018-10-26 19:23
ReporterMandarinka Tasty 
Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Statuspatch includedResolutionopen 
PlatformOSOS Version
Product Version0.9.0.1 
Target VersionFixed in Version 
Summary0008400: More logical NPC's detection with llGetAgentList and replacing ssp.IsViewerUIGod with ssp.IsGod.
DescriptionHello.

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;
            }
        }
    }
}
TagsNo tags attached.
Git Revision or version number
Run ModeStandalone (1 Region) , Standalone (Multiple Regions) , Grid (1 Region per Sim) , Grid (Multiple Regions per Sim)
Physics EngineBasicPhysics, ODE, BulletSim, ubODE
EnvironmentMono / Linux32, Mono / Linux64, Mono / Windows, Mono / OSX, .NET / Windows32, .NET / Windows64
Mono Version5.x
Viewer
Attached Filespatch file icon 0001-More-logical-NPC-s-detection-with-llGetAgentList-and.patch [^] (3,402 bytes) 2018-10-25 14:22 [Show Content]

- Relationships

-  Notes
(0033269)
BillBlight (developer)
2018-10-26 18:18
edited on: 2018-10-26 18:19

Not that I mind this, but just an observation ..

SL does not have NPC, so should we be adopting ll functions to fit us, and be outside of ll spec or just use our own functions such as the existing osGetNPCList() ?


Just not sure it is a good habit to get into ..

(0033270)
Mandarinka Tasty (reporter)
2018-10-26 19:06

@watcher )
First at all, SL does not care what we do or not do with functions that have been designed by LL. All our efforts are meaningless for them , if we repeat those functions with 1-1 precision, or we modify them due to our needs.
It is impossible to make ideal clone of SL, and also mighty majority of people do not want that.
Hence, as you notice, reading my words, I opt for adopting LL functions and modyfing them into our environment accordingly to our needs, wishes etc.
I also consider that reaching LL spec is useless in OpenSim, because it's not possible in 100%. We can try to "stand on our heads" and we will not repeat it as they did. So for what to keep those functions exactly the same?
Additionally, code is opensourced, so anyone is free to set it as he/she wants.

Our osGetNPCList() is very nice tool to detect and list only NPCs.
That is why I have decided to limit using llGetAgentList with NPC and only allow if they are sensed as avatars = agents and not excluded from detection. That is more logical in my opinion. Personally i would even eliminate scanning NPCs with llGetAgentList, but let us do some consensus.
What do you think about my thoughts?
(0033271)
BillBlight (developer)
2018-10-26 19:08

Yeah was not trying to start a debate, I just see a lot of people scream "We need to be exactly like LL" and then at the same time they scream the opposite when it does not do exactly what they want ...


I'll just keep my opinions to myself in the future ..
(0033272)
Mandarinka Tasty (reporter)
2018-10-26 19:23

@watcher )
Please always share your opinions, because it gives us/me possibility to observe problems and concepts from other perspective. Thanks in advance.
What I've been personally observing for the very long time is: people rather want to look exactly here, as their SL avatars. And many of them also would like LL scripted functions to be improved.

- Issue History
Date Modified Username Field Change
2018-10-25 14:22 Mandarinka Tasty New Issue
2018-10-25 14:22 Mandarinka Tasty File Added: 0001-More-logical-NPC-s-detection-with-llGetAgentList-and.patch
2018-10-25 14:23 Mandarinka Tasty Status new => patch included
2018-10-25 14:24 Mandarinka Tasty Description Updated View Revisions
2018-10-25 14:25 Mandarinka Tasty Description Updated View Revisions
2018-10-25 14:25 Mandarinka Tasty Description Updated View Revisions
2018-10-25 14:50 Mandarinka Tasty Description Updated View Revisions
2018-10-26 16:23 Mandarinka Tasty Description Updated View Revisions
2018-10-26 18:18 BillBlight Note Added: 0033269
2018-10-26 18:19 BillBlight Note Edited: 0033269 View Revisions
2018-10-26 19:06 Mandarinka Tasty Note Added: 0033270
2018-10-26 19:08 BillBlight Note Added: 0033271
2018-10-26 19:23 Mandarinka Tasty Note Added: 0033272


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker