Is there any way to tell the avatar to sit lower in the 2nd animation (or higher the first animation)...
...without changing anything from the animation file? (the animation files are no mod so i can't change).
These forums are CLOSED. Please visit the new forums HERE
Discussion: Easy Sit Target Positioner |
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
03-05-2007 01:32
Is there any way to tell the avatar to sit lower in the 2nd animation (or higher the first animation)... ...without changing anything from the animation file? (the animation files are no mod so i can't change). |
Venusvelvet Cazalet
Registered User
Join date: 22 Feb 2007
Posts: 16
|
03-05-2007 15:54
mmm... so i guess i should choose to stick with animations that are having similar sitting positions... thanks Deanna.
|
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
03-05-2007 17:24
Another option is to record the sit target values and use a script that selects the proper sit target for the animation chosen. OH -- Deanna is probably correct that unsitting may be necessary.
However, placing the sit target in a prim and moving that prim is not difficult. Ideally, it would be an invisible prim that floats just above the actual seat when nobody is sitting. Make sure the invisible prim is NOT the root prim, so that when the script sets the object position, it changes the relative position of the prim within the object, rather than moving the object. This isn't quite as complicated as it sounds. |
Venusvelvet Cazalet
Registered User
Join date: 22 Feb 2007
Posts: 16
|
03-05-2007 17:39
yeah, that's sound good Learjeff. i'll make an invisible prim and try. i'm still new to scriting and haven't got into those relative positions within linked prims yet. But i'll do some research on those, wish me luck!
![]() |
Taffy Allandale
Registered User
Join date: 22 Oct 2006
Posts: 3
|
I'm Confused
03-17-2007 17:00
OK - Created a prim to house "Sit-Target Helper" and added my pose to it -- Dropped "Sit-Target Setter" into the pillow I want to use on my chair along with the same pose. SO far, so good.
Then I sat on the "Helper" and moved said prim into position (Yay!) Great! Then I clicked on the "Setter" and promptly received an error message: Red Throw Pillow: Searching for Sit Target Helper... Red Throw Pillow: Sit Target Helper not found. No sit target set. So . . . . what's wrong? Did I miss something? Wrong script in wrong prim? I thought I followed the instructions on the notecard to the letter - ummm, where'd I go wrong? hmmm - also should all be linked together? Please help me? Taffy |
Zen Zeddmore
3dprinter Enthusiast
![]() Join date: 31 Jul 2006
Posts: 604
|
03-18-2007 01:16
a supplimental test, i can create my own sit animations with qvanimator and investigate height variance effects and artifacts if any, i'll get back after my results.
|
Anti Antonelli
Deranged Toymaker
![]() Join date: 25 Apr 2006
Posts: 1,091
|
03-18-2007 03:59
Taffy - no, don't link them together, but the prim you made to put the Sit Target Helper script in MUST also be named Sit Target Helper.
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
03-18-2007 08:39
Taffy - no, don't link them together, but the prim you made to put the Sit Target Helper script in MUST also be named Sit Target Helper. More specifically, remove the dash in your object's name, Taffy. |
Annie Liberty
Registered User
Join date: 22 Nov 2005
Posts: 20
|
03-19-2007 19:36
Ok, I am completely lame when it comes to scripts. I am trying to eliminate pose balls in my furniture. So I got the Sit Target scripts. Placed the helper script in a prim labeled 'sit target helper', placed the target script in the seat cushion for my sofa. Placed identical poses in each as well. Sat on the helper prim and moved myself into the proper position. Clicked on the seat cushion and got the proper response. So, I take away the helper prim and sit myself back down on the cushion, all is well.
Problem number one, when i remove the target script from my sofa cushion( as instructions tell you to), the sit pose no longer works. Is there another script of some kind that i need to have in the cushion? Something like what is in the pose balls? I have some scripts like that but unfortunately they all disappear when you sit on them. Problem number 2, I want to have 2 poses for the sofa. So I have set the sofa up so that there are 2 cushions, one for each avatar, each with their own sit pose. When i link all of it together, the second sit pose in the second cushion does not work. No matter where you click on the sofa, you end up sitting on the first cushion in the first sit pose. Help? |
Ace Albion
Registered User
![]() Join date: 21 Oct 2005
Posts: 866
|
03-20-2007 01:47
You have to put an actual sit script in the sofa cushion, and paste in the line that the helper gives you for the sit target into that script.
I use Strife Onizuka's simple sit script, though there are more flexible ones also. _____________________
Ace's Spaces! at Deco (147, 148, 24)
ace.5pointstudio.com |
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
03-20-2007 06:09
Yes, this is a trivial script. Next time I'm ingame I'll grab the code and post it, unless someone beats me to it. I should be able to do it from memory, but I'd rather not embarrass myself by goofing it up after calling it trivial.
![]() |
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
03-20-2007 06:11
For your second question, look at the old Wiki's description for llSitTarget(), which explains the priority rules for sit targets in a multi-prim linked object. It is possible to do what you want, though I haven't done it myself.
|
Annie Liberty
Registered User
Join date: 22 Nov 2005
Posts: 20
|
03-20-2007 16:57
Thank you for the advise, I have tried 2 sit scripts, and stillnot working. Boy I feel blonde, and I am not! lol Here is the first script i tried:
vector offset = <0,0,0>; rotation rot = <0,0,0,0>; default { state_entry() { llSitTarget(offset,rot); } } I entered the vector and rotation numbers that the Helper gave me.saved the script, and then reset and recompiled for shits and giggles. No go. I sit in the right place, but not with the anim that is in the cushion. So I figured I have to put the name of the anim in the script? So i removed the text 'default' and put in the name of the anim. Nope. Next I tried this one: // SilverDay Poser 1.0 // (c)2005 SilverDay Productions (released as OpenSource 2/2005) vector position = <0, 0, 1>; // Adjust position here string animation; default { on_rez(integer start) { llResetScript(); } state_entry() { llSay(0, "**** SilverDay Poser 1.0 ****" ![]() llSitTarget(position, ZERO_ROTATION); animation = llGetInventoryName(INVENTORY_ANIMATION, 0); llSay(0, "Active animation: " + animation); } changed(integer change) { if(change == CHANGED_LINK) { key avatar = llAvatarOnSitTarget(); if(avatar != NULL_KEY) { llRequestPermissions(avatar,PERMISSION_TRIGGER_ANI MATION); // llStopAnimation("sit" ![]() // llStartAnimation(animation); } else if (llGetPermissionsKey() != NULL_KEY) { llStopAnimation(animation); } } } run_time_permissions(integer perm) { if(perm == PERMISSION_TRIGGER_ANIMATION) { llStopAnimation("sit" ![]() llStartAnimation(animation); } } } Notice that this one does not ask for the rotation numbers. I entered the vector numbers, and sit all wrong. The rotation numbers make a diff. I dropped my computer programming class in college, and I imagine you can see why now ![]() Help? |
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
03-20-2007 17:44
This should work. It was modified from a working script that worked for attachments, so I may have gotten the sit/unsit logic wrong.
CODE
I welcome any critiques on this script from the old hands. Newgate? ![]() Edit, March 21: now handles the case where there is no animation. Also, added comment for where to add easy-sit-target-positioner's sit target, though I feel it's best to leave that out. Legals: You are free to use this code for any purpose whatsoever, other than griefing. (Like that'll stop a griefer!) |
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
03-21-2007 09:10
Looks good, Learjeff, and I'm glad someone stepped up and provided a script like that. Perhaps you should note in state_entry() where the llSitTarget() line from the helper should be pasted?
One interesting thing that could be done would be to modify my scripts to actually output that entire code chunk you just posted, with the correct llSitTarget inserted. Alternatively, someone could take my sit target setter script and modify it to have two modes accessible by the owner of the script: one for setting the sit target using the helper, and one for standard operation as a poseball. I chose not to do this for two reasons: first, I'm lazy and/or I didn't want to support a complex script like that, and second, I didn't like the idea of only storing the sit target information in a variable. Since we don't have llGetSitTarget(), it might be prudent to store the sit position/rotation in the object's description. Anyway, if anyone wants to step up to the plate and implement one of those, you'll get fame and fortune forever! As this is not GPL-licensed code, it would be legit for you to even turn this into a sellable product. While you wouldn't be required to give me royalties, a tip or two would be nice ![]() |
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
03-21-2007 10:15
Lex, the llSitTarget line doesn't need to be pasted. I think it's better to let the object hold the sit target property, having been set using the sit target positioner. Then, if you want to change it later, just use the sit target positioner again. Why bake it in code?
IMHO, the reason to embed sit positions in code is when you want the script to be able to choose from multiple positions, such as menu based (or different positions for different anims). Or am I missing something? Interesting idea to allow the helper to remain resident and handle any anim. The disadvantage is there's code and listens that are rarely used once the object is created. But who knows -- perhaps it would enable furniture that's easier for end users to adjust to suit their avatars and animations. Next time I fiddle with sit targets, I'll give that some thought. Thanks Jeff |
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
03-21-2007 10:40
BTW, I edited the code above so it works with or without an anim present, and added the comment on a good place to put the llSitTarget() call.
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
03-22-2007 08:05
Lex, the llSitTarget line doesn't need to be pasted. I think it's better to let the object hold the sit target property, having been set using the sit target positioner. Then, if you want to change it later, just use the sit target positioner again. Why bake it in code? One big reason: shift-dragging. If you shift-drag an object with a sit target set, it's blown away in the copy process (this doesn't happen if you take/rez a copy). |
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
03-22-2007 08:30
Thanks, Lex. Has this bug been reported?
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
03-23-2007 08:08
Yup, I reported it ages ago.
|
Annie Liberty
Registered User
Join date: 22 Nov 2005
Posts: 20
|
03-23-2007 09:26
Thank you Learjeff, I have used your script, and I am sitting on the seat in the proper spot, when I put the vector info from the sit target helper in the proper place. However, the animation in the prim is not working when I sit. I sit in the default pose. Do I need to put the name of the animation in the script somewhere?
|
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
03-23-2007 09:32
Hmm, must be a bug, sorry. You don't need to put the anim name in the script; it uses the first anim it finds in the prim's inventory. You need to make sure the script and the anim are in the same prim in the object. If they are, then I have a bug. I'll look into it.
|
Annie Liberty
Registered User
Join date: 22 Nov 2005
Posts: 20
|
03-23-2007 09:55
Thanks, and yes they are in the same prim.
|
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
03-23-2007 10:44
Aha, as it turns out, llAvatarOnSitTarget() returns NULL_KEY if the sit target is the default sit target!
If one script sets the sit target and is deleted, and another script is placed in the same object, it works. So it's not necessary for the running script to have set the sit target. Just necessary that it's not the default sit target, or so it seems from my testing. I've modified the script above, accordingly. Annie, if you use the easy-sit target positioner first, then the script should work without the llSitTarget() call. I made some other minor changes that wouldn't affect normal operation. |
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
03-23-2007 10:52
After a little more shakedown, I'll re-post my script in the script library.
It does have some minor flaws. If the server is bogging, a person could sit and get up before the permissions event. In this case, they'd be doing something else and go into the anim temporarily. If they happened to teleport just after going into the anim, they could get stuck in it, though the window for that particular problem is probably small, and stopping all animations should fix it. |