Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Detatching objects to ground

raven Blair
Registered User
Join date: 2 Feb 2004
Posts: 39
11-15-2008 19:49
I dont know if this has been posted be for but I'm working on a script to attach a item to me with dialog commands and it works but I want to detach the item back to the ground but so far I can only get it to detach and go back into my invy, Any one know how I could get the prim to Drop off your body with some code the same way you can right click on a prim that is attached and hit drop and it will drop it on the ground next to you?
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
11-15-2008 20:10
You can't do it with LSL. It must be done from the client, either manually in the normal viewer or via some special logic in a custom viewer.
raven Blair
Registered User
Join date: 2 Feb 2004
Posts: 39
11-15-2008 20:12
so my best bet is to just have it rez a new one befor it detaches?



From: Hewee Zetkin
You can't do it with LSL. It must be done from the client, either manually in the normal viewer or via some special logic in a custom viewer.
raven Blair
Registered User
Join date: 2 Feb 2004
Posts: 39
11-15-2008 20:32
Ok I made it so that when detached it will rez another one but after a few attaches and detaches it no longer ask for perms to attach :( I will post my code.

I would love to have it request perms on rez but i was haven problems with that


CODE

integer CHAN;

default
{
state_entry()
{
CHAN = (integer)llFrand(1000000.0);
llListen(CHAN,"","","");
}
touch_start(integer total_number)
{
llRequestPermissions(llDetectedKey(0), PERMISSION_ATTACH);
llDialog(llDetectedKey(0),"Epic Hover Board", ["Attach","Detach"],CHAN);
}
listen(integer channel, string name, key id, string message)
{
if (message == "Attach")
{
llAttachToAvatar(ATTACH_BACK);
}

if (message == "Detach")
{
string object_to_rez = llGetInventoryName(INVENTORY_OBJECT,0);
llRezObject("Object", llGetPos() + (<1.0, 1.0, 1.0> * llGetRot()),<1,0,0>, llGetRot(), 0);
llDetachFromAvatar();
}
}
}
raven Blair
Registered User
Join date: 2 Feb 2004
Posts: 39
11-17-2008 00:11
ok made it ask perms on rez but for some reason after i attach and detach it a few times it will at some point rez a box that dose not have another box in it, I dont know what thats about. but it really sucks that there is no function to just drop the item :( cause now my invy is getting spammed with the object.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-17-2008 02:32
temp on rez will reduce inventory spam, or at least contain it in one place.

the problem with rezzing a copy is the new copy doesn't have a copy in it's inventory to rez when it goes away.... get around this by having the original give the copy a copy for it's inventory.... you'll want to look at start parameters and give inventory
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -