I'm a complete newbie to scripting, so ... er ... if you guys could just tell me the important stuff I would need (like, I know I'd need a *touch* tag in there) -- or point me in the right direction -- that would be fantastic! Thanks

These forums are CLOSED. Please visit the new forums HERE
Touch Script Needed |
|
Lo Jacobs
Awesome Possum
![]() Join date: 28 May 2004
Posts: 2,734
|
05-19-2005 20:08
I have a wind-up key that attaches to my back, like Olympia Rebus's. I would like to have a script so that when people click on it, it rotates a little bit and then stops. How might I go about this?
I'm a complete newbie to scripting, so ... er ... if you guys could just tell me the important stuff I would need (like, I know I'd need a *touch* tag in there) -- or point me in the right direction -- that would be fantastic! Thanks ![]() _____________________
http://churchofluxe.com/Luster
![]() |
Olmy Seraph
Valued Member
![]() Join date: 1 Nov 2004
Posts: 502
|
05-19-2005 23:08
First off, cool ideal. But unfortunately you can't rotate an attachment. The closest you can come is using texture or alpha animation to simulate it, which doesn't sound like it will work well for what you want to do. If articulated attachments were possible, you'd see flapping wings all over the place.
_____________________
Some people are like Slinkies... not really good for anything, but they sure bring a smile to your face when you push them down the stairs.
|
Logan Bauer
Inept Adept
![]() Join date: 13 Jun 2004
Posts: 2,237
|
05-21-2005 15:51
I think it can be done using different frames like Olmy says. I have wings that use an animated texture to flap when you fly, but for something like a wind-up key, having llSetAlpha turn on each prim "frame" would work better than an animated texture, and if you put the right number of frames in it would look cool and I think be just as "passable" as llSetLocalRot and LocalPos, were they possible on attachments. I would even add in a small faint click sound with each "frame".
![]() Here's a similar thread on doing this sort of prim frame-by-frame animation /54/4e/33550/1.html |
Ace Cassidy
Resident Bohemian
![]() Join date: 5 Apr 2004
Posts: 1,228
|
05-21-2005 16:06
Also, you can't touch an attachment.
- Ace _____________________
"Free your mind, and your ass will follow" - George Clinton
|
Talila Liu
Micro Builder
Join date: 29 Jan 2004
Posts: 132
|
05-21-2005 16:10
Also, you can't touch an attachment. - Ace You can't??? When did that change? I know of alot of attachments that react when clicked. In fact, I have made a few. |
Keknehv Psaltery
Hacker
![]() Join date: 11 Apr 2005
Posts: 1,185
|
05-21-2005 16:27
You can touch attachments. End of argument.
|
Ace Cassidy
Resident Bohemian
![]() Join date: 5 Apr 2004
Posts: 1,228
|
05-21-2005 16:32
My bad... Attachments can be touched.
- Ace _____________________
"Free your mind, and your ass will follow" - George Clinton
|
Olmy Seraph
Valued Member
![]() Join date: 1 Nov 2004
Posts: 502
|
05-22-2005 22:22
Looking back I see none of us actually answered your question. So...
You'll need a touch_start() event handler. If you can do the alpha animation like Logan described, put that in the handler. You'll need a global variable that holds what position the key is in, and every touch advance that one, then set the alphas as that variable indicates. Pretty simple, but top-down design always is, heh. Check out the LSL wiki, it has some decent snips of how to do touch_start. Or IM me and I'll give you a hand. _____________________
Some people are like Slinkies... not really good for anything, but they sure bring a smile to your face when you push them down the stairs.
|