Right now, my solution is to make an invisiprim with the following contents:
- meatball animation and meatball-on-attach script
- all of the triggerable avatars, each of which contain a script I'll clarify below
- a script that does nothing but watch chat for the triggers
This listen script, when it encounters a trigger, detaches the current avatar (deleting it in the process, theoretically, since a copy is still in the invisiprim's contents anyway), rezes the relevant avatar nearby the agent. Now, each of these avatars has their own script that, on rez, requests attach permissions, then attaches once permission is granted (or just, er, sits there if permission is denied--I'm still working on that
).Now, my problems with this are, uh, manifold:
1) Everytime an avatar requests permissions, the user is prompted (ie. granted permissions are lost between rezes of any one avatar). Therefore, every time the trigger is encountered, the user has to click Yes to attach it. This is, er, lame. Any workaround?
2) While the avatar is being worn, it exists in the user's inventory, nothing I can do about that. If it is detached, it becomes part of the user's inventory. If it's DROPPED, right now the way the script is set up, it dies, removing itself from the user's inventory--which is what I want. The problem here is, as far as I can tell, LSL has no support for dropping attachments--only detaching them. What can I do to make damn sure that, when one of the avatars is detached, it is removed from the user's inventory?
3) It seems like there's a better solution out there for what I want to do, but I don't know what it is. Is there any other general way I could do all this that I haven't thought of?
Here's the scripts as they are right now. This is the listener script in the invisiprim, that does all the management:
CODE
string currentEmoticon = "";
integer listenHandle;
default
{
attach(key id)
{
if (id != NULL_KEY)
{
llOwnerSay("Emoticon Costume Ready! Listening to chat...");
llListenRemove(listenHandle);
listenHandle = llListen(0, "", NULL_KEY, "");
}
}
listen(integer channel, string name, key id, string message)
{
if (llSubStringIndex(message, "D:") != -1)
{
llOwnerSay("Caught Emoticon D:");
if (currentEmoticon != "")
{
// detach and destroy current emoticon
}
llRezObject("D: Face", llGetPos() + <0, 0, 2>, ZERO_VECTOR, ZERO_ROTATION, 42);
}
}
}
And this is the script within each avatar that attempts to attach itself to the avatar on rez, and die on detachment (remember, it doesn't die if it's detached, only if dropped--this is bad):
CODE
default
{
on_rez(integer arg)
{
//llOwnerSay("Hello, Avatar!");
if (llGetPermissions() & PERMISSION_ATTACH)
{
llAttachToAvatar(ATTACH_BELLY);
}
else
{
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
}
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_ATTACH)
{
llAttachToAvatar(ATTACH_BELLY);
}
}
attach(key id)
{
if (id == NULL_KEY) // detached
{
llDie();
}
}
}
My thanks to anyone who can help!


they are in suspended animation when in inventory