Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Killing an attached object...

Jodah Xavier
Second Life Resident
Join date: 5 Nov 2004
Posts: 5
11-18-2004 05:49
Hey all.
I'm looking for a little scripting help...I'm making a holsterable gun out of one object (the holster). My method is thus: the holster object contains a touch_start script, a HeldGun object (gun in hand) and a strip-down BeltGun model (gun in holster). When the holster is touched, first it kills the belt gun, then it rezzes the HeldGun. Everything works fine so far, except for one detail...when I holster the gun from drawn, it won't kill the HeldGun. So far, I've attempted every implementation of the llDie() command I can, from embedding it into timers to adding to its own state to embedding it into other functions, but alas, every time I use the holster command, it releases gun controls/mouselook, and keeps the gun in my hand when I walk. I don't want to detach every time, and have a bunch of copies of my gun in the avatar's inventory, and I don't know how to delete them there anyway. Anyone have any suggestions? I'd be happy to IM in game, or post,a copy of the script if necessary, but I jsut feel like I'm missing some minor detail. Many thanks to all :).
Al Bravo
Retired
Join date: 29 Jun 2004
Posts: 373
11-18-2004 06:08
One possible solution - keep the gun in your hand, just make it transparent (transprent texture that is) when you holster it - reverse the solution for the holstered gun. You do have to get a bit tricky and link message all the prims and have them each go transparent, but it does work.
Ace Cassidy
Resident Bohemian
Join date: 5 Apr 2004
Posts: 1,228
11-18-2004 06:15
I'm with Al on this... Rezzing and llDie()'ing objects is overkill.

Use llSetAlpha() to blink guns in and out.

- Ace
_____________________
"Free your mind, and your ass will follow" - George Clinton
Pedro Pendragon
Registered User
Join date: 15 Jan 2004
Posts: 77
11-18-2004 07:21
You should be able to detach it automatically with llDetachFromAvatar().

http://www.tyrellcorporation.org/disabled/llDetachFromAvatar

It'll leave it in your inventory, though.

To delete something from your inventory, just click it so it's hilighted and hit the 'delete' key on your keyboard. That will move it to your Trash (down at the bottom of your inventory list.) Once it's there, right-click the Trash and select "Empty Trash" and it will be gone forever.
Marker Dinova
I eat yellow paperclips.
Join date: 13 Sep 2004
Posts: 608
11-18-2004 08:52
From: Jodah Xavier
... and I don't know how to delete them there anyway.



OMG... you've never deleted anything from your inventory???
_____________________
The difference between you and me = me - you.
The difference between me and you = you - me.

add them up and we have

2The 2difference 2between 2me 2and 2you = 0

2(The difference between me and you) = 0

The difference between me and you = 0/2

The difference between me and you = 0

I never thought we were so similar :eek:
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
11-18-2004 12:37
I hope he meant that he did not know how to empty his deleted items folder...

If that's true look at the trash folder, and Rclick on it to see the purge items menu (or something like that)... when you see it you will know.
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
Jodah Xavier
Second Life Resident
Join date: 5 Nov 2004
Posts: 5
11-18-2004 17:48
Thanks all for the help!
BTW...I know how to delete from my inventory manually, lol. I meant I didn't know how to do it from a script :).
Water Rogers
Registered User
Join date: 1 May 2003
Posts: 286
11-18-2004 17:58
Aww guys, give them a little break... they did just join this month. Welcome to SL btw :)

Jodah - llDie() does not work for attachments, and you cannont delete things in your personal inventory with a script (would be nice though!).

You could try hiding and showing the object using llSetTexture() and a transparent key like was previously suggested. linked messaging works on attached objects, so you could communicate with the belt and gun that way if you want- or using a listen event. After that it's just a matter of a few If-else calls and you should be good to go.

--Water
_____________________
From: Philip Linden

For the more technically minded - the problem is actually NOT the asset server (or 'asshat' as you prefer to affectionately call it herein).
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
11-19-2004 17:59
Or better yet use llSetLinkAlpha(x,0.0,ALL_SIDES); in a loop for each prim in the item, as that goes all the way now via script :)

L8r,
UU
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
11-20-2004 00:05
Or even better

integer on=FALSE;//true or false
llSetLinkAlpha(LINK_SET,on,ALL_SIDES);
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
11-21-2004 08:53
ah, thanks Strife... I was thinking LINK_SET didn't work there for some reason. But then last time I tried might have been in a preview a few versions back :)

L8r,
UU