|
Lennia Lindley
Registered User
Join date: 29 May 2006
Posts: 2
|
06-07-2006 16:25
Hi, I have a question that I wasn't able to find the answer to on the LSL Wiki. I have 2 objects which I want scripted such that it will start with the avatar holding one of them, and when it is touched it will be replaced by holding the other, and when it's touched again go back to the first (etc., etc.) but I am unsure of how to go about this. I've tried llRezObject the new object and in the script for the new object made I tried putting llAttachToAvatar right in the beginning as it's created but it's not working. Any help would be greatly appreciated, thank you.
|
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
06-07-2006 17:35
Hmm... it sounds like you need llSetAlpha. Lets say the object is a pair of nunchucks. When you're not fighting, you want them attached to your hip, when you are, you want them in your hand. To do this, make two copies of the object, one for your hip attachment point, and one for your hand. Make the hand copy invisible using llSetLinkAlpha(LINK_SET, 0, ALL_SIDES) and have it listen for "fight" on channel 1920. When the hip copy is touched, whisper "fight" on 1920 and call llSetLinkAlpha(LINK_SET, 0, ALL_SIDES). When the hand copy hears "fight", it should set itself visible using llSetLinkAlpha(LINK_SET, 1, ALL_SIDES). With the proper animations, this looks like a smooth transition from hip to hand. Hope this helped  ==Chris
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
06-07-2006 19:07
If you are trying to get them both to attach to the same point, then I'm pretty sure you're out of luck. Otherwise, you should be able to rez an object that is immediately attached at a different point. I did this with another script, but don't remember the details and don't have the code in front of me. Problem is that you cannot make the object unattach and die. If you unattach, it goes into inventory. So if you go back and forth, you're going to have an inventory full!
Holler if you need more help than this. Baron
|
|
Lennia Lindley
Registered User
Join date: 29 May 2006
Posts: 2
|
06-07-2006 19:52
thanks, I got it working as best as possible with that little restriction that they can't both be attach to the same place. Yay! 
|