Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Multi-pose menu-driven objects?

Casey Benton
Registered User
Join date: 27 Jul 2005
Posts: 39
08-01-2005 09:08
Hey all..

I had an idea for reducing prims that I want to try out, but I'm not sure where to start. I've been looking through the forums and wiki, but can't find anything similar, so if you've seen this idea before (or know why it wouldn't work), please point me in the right direction.

Anyway, I have a loveseat. I have a bunch of poseballs for different ways to lounge, sit, hug, etc. If each poseball is a prim, that's 8-10 prims just for those. What I'd like is a script that I can use to click on the couch, have a menu pop down, and give me a number of animations to choose from. I've seen similar things on wearable objects and multifunction doors, so I know that part is doable.

The question is, assuming I click on the couch and chose 'sit crosslegged', I need to be able to have an offset or something so I can position the animation correctly.

Is this doable? Has it been done? Can it be done? Are there modifiable code snippets somewhere that I could use to put this together? Is this too much to bite off for my first scripting project? :)
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
08-01-2005 09:58
What you're after is basically do-able. Howver, the one sticking point is, once an av is attached to an object, you can't move it. That attachment point can change, but won't effect the av untill the user unsits it and re-sits on the object. All your animations will have to have hip offsets of thier own.

If you're not aware of it already, let me introduce you to the ever useful Wiki. There you will find useful info for your project such as agent and avatar functions, with details on llStartAnimation(), llStopAnimation(), llSitTarget(), and permissions, in other parts you'll find touch_start(), and llDialog().

All things I see useful to your project :)
_____________________
Toneless Tomba
(Insert Witty Title Here)
Join date: 13 Oct 2004
Posts: 241
08-01-2005 09:59
Yes and No...

It's fairly easy to have mulitple animations for one pose ball in one stationary position and has been done already in some furniture I've seen. The problem really lies in ease of use setting up multiple positions of each animation. Even if a script was designed to be user friendly it still be much harder for the average user to do than setup multiple poseballs. But to answer your question it can be done but it may be bit clunky. :D
Casey Benton
Registered User
Join date: 27 Jul 2005
Posts: 39
Thanks!
08-01-2005 11:33
Okay, I'm glad to hear nobody thinks it's not doable.

I've gone through the wiki and the crash course, and it looks comparable enough to other scripting languages that I kinda-sorta am familiar with, that I think I could probably do it. I have examples (which is how I learn best) of most of what I need (loading a config notecard, doing animations) except for the menu selection part. I'm going to go looking for an example of that now. I think I can figure out how to glue it all together.

I don't suppose there's a place where I can find a mentor or hire a tutor to help me when I start hitting the invariable roadblocks?

Edit> Whoop! There is! I'll be bothering those kind folks, I'm sure of it!

Thanks again!
Casey Benton
Registered User
Join date: 27 Jul 2005
Posts: 39
A couple of questions..
08-01-2005 16:52
Okay, my project is progressing, but I have a couple of questions I hope someone could help me out with.

#1 - Passing information.
What I figure is that I'll have a separate script for doing the animation, which can be fed arguments by the llDialog menu system. The information I would need to pass is:

The message - I figured on using a high channel for this, especially since I can troubleshoot one script at a time.

Start/Stop - Figured I have this by doing llGetSubString to chop up a message picked up by the listener.

Position/Rotation - Here's my sticker. Since llGetSubString uses byte positions, I figured the easiest (least process intensive) way would be to use fixed field lengths (xxx.xxx). Question is, I figure I can get positions <x,y,z> easily enough, but would I do rotation with Eulian or quaternions? I'm Eulian and then convert, just for being able to adjust it in-game more easily.

Second position question: This all seems very absolute. Is there an easy way to make it all relative to the prim this is bound to? I'm thinking a way of loading the prim's positionals in and adding to it for relational rotation, but relational position would need some calculating, I would think? Worse case, it's all absolute, and I make sure the furniture is in place before I set up the animations.

Animation name - Once I have a fixed length for the other information, this would be a llSubString (mesg, 0, length) sort of thing would work.

2 - llSitTarget
So, researching the position/rotation thing, I investigated llSitTarget. It states the sit target is bound to the prim. So, if I have one avatar sitting on one end of the couch, and a second avatar comes along, it seems like I would be passing a new llSitTarget for the second animation. My question is (Before I go and do this), will changing the SitTarget MOVE the first avatar? Or will SitTarget only affect the initial placement during the sit action?

Thanks! Anybody that wants to be bothered with more questions in game can IM me. :)