Date: Tue, 30 Apr 2013 17:10:34 -0400
From: Dr Ramesh Ramloll <[email protected]>
To: opensim-users <[email protected]>
Subject: Re: [Opensim-users] NPC not getting removed as expected
Message-ID:
<cahi41xk6v-qph9rcc0+pdunhopcb7uo6voss7qecvrwnfd1...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Hello,
Before I file a mantis report, try wearing an attachment with this trivial
script
default
{
touch_start(integer i){
osNpcRemove(llGetOwner());
}
}
clone youself, then create an NPC using the example script here NPC
Automator script
http://opensimulator.org/wiki/OSSLNPC
Let me know if others are getting the same behavior, the NPC is expected to
delete itself when attachment is clicked.
I filed a Mantis on this behavior when the NPC functions were released.
I cannot find it now, large numbers of reports seem to have been removed.
The call to GetOwner() does not return the correct UUID for the NPC
The workaround is to add code to handle the attached event
attach(key id) {
Initialize(id);
}
The key returned as id in this function is always the key of the avatar/NPC
the item is attached to.
This script should do what you expect.
key NPC = NULL_KEY;
default
{
touch_start(integer i){
osNpcRemove(NPC);
}
attach(key id) {
NPC=id;
}
}
_______________________________________________
Opensim-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/opensim-users