Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Another llSitTarget victim

Nemo Soyer
Registered User
Join date: 28 Mar 2006
Posts: 7
05-28-2006 16:13
Heya,

I'm having a hell of a time trying to get a chair to work with a couples pose. I found a free script and animation poseball set which I ripped apart and worked into a chair.

The male uses the back cushion to sit on, the female uses the bottom cushion, and it works great, they cuddle :)

But when I make a copy of the chair, both poses are rotated about 180 degrees, heads touching the seats.

This is the script from the female seat, the male seat is the same but with different ROTATION values.

From: someone


vector POSITION=<0.5,0,-0.4>;
vector ROTATION=<90,0,-30>;

string HOVERTEXT="Female Seat";

string SIT_TEXT="Sit down";

string HOVER_RGB="255,255,255";

set_text()
{
if (llStringLength(HOVERTEXT)>0)
{
rgb=llCSV2List(HOVER_RGB);
llSetText(HOVERTEXT,<llList2Float(rgb,0)*0.003921568627450980392156862745098,llList2Float(rgb,1)*0.003921568627450980392156862745098,llList2Float(rgb,2)*0.003921568627450980392156862745098>,1.0);

}
else
llSetText("",<0,0,0>,0.0);
}

list rgb;
string animation;

default
{
state_entry()
{
if (llStringLength(SIT_TEXT)>0)
llSetSitText(SIT_TEXT);

rotation rotate = llEuler2Rot(DEG_TO_RAD * ROTATION) * llGetRot();
llSitTarget(POSITION,rotate);

set_text();
}

changed(integer change)
{
if (change & CHANGED_LINK)
{

if (llAvatarOnSitTarget() != NULL_KEY)
{
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
}
else
{
integer perm=llGetPermissions();
if ((perm & PERMISSION_TRIGGER_ANIMATION) && llStringLength(animation)>0)
llStopAnimation(animation);
llSetAlpha(1.0, ALL_SIDES);
set_text();
animation="";
}
}
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION)
{
llStopAnimation("sit";);
animation=llGetInventoryName(INVENTORY_ANIMATION,0);
llStartAnimation(animation);
llSetText("",<0,0,0>,0.0);
}
}
}


The script that came with the original poseballs is called Nyterave, which also caused the problem. I ended up with the above script, a combination of Nyterave and bits and pieces from the message board. It's cleaner and easy to edit, but still doesn't solve the copy problem :(

I'd really appreciate help in fixing this, or maybe even a whole new script that does let me make a chair for couples with using pose balls.

Thanks in advance.....and feel free to contact me for more info or if you need to see the chair in SL itself.
Nemo Soyer
Registered User
Join date: 28 Mar 2006
Posts: 7
05-29-2006 07:47
Oh go on......anyone? :)
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
05-29-2006 08:57
I think part of the problem is that there's so much bad code in there that everyone's afraid to dive into it. I know I am.

I *would* recommend adding an on_rez(integer p) { llResetScript(); } to it just in case some of those horrid redundant calculations you're doing need to be done over more often than you think.

Maybe even add a reset on moving_end as well.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
05-29-2006 08:59
Can I be the first to say
CODE
llSetText(HOVERTEXT,<llList2Float(rgb,0)*0.0039215686274509803921568627
45098,llList2Float(rgb,1)*0.0039215686274509803921
56862745098,llList2Float(rgb,2)*0.0039215686274509
80392156862745098>,1.0);

w... t... f...

edit: yes, I know what it's trying to do, but still, w... t... f...
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
05-29-2006 10:13
The problem you have is that the rotations you're applying to the SitTarget are off and while they work for a while, if you rotate the chair and duplicate it (or reset the script some other way) the rotations get fucked up.
I had this problem, and I don't think I ever managed to fix it.
Nytemyst Grace
Registered User
Join date: 3 May 2004
Posts: 161
....
05-29-2006 11:47
Try checking the balls themselves.. When you create a ball its at a 90 degree Y axis..try making them 0, 0, 0 and see what happens.
_____________________
Te audire no possum. Musa sapientum fixa est in aure.

Have you RAVED today? NYTERAVE @ Nyterave Island (48, 89)

SL-Forums.com
Sitting Lightcloud
Registered User
Join date: 13 May 2004
Posts: 109
05-29-2006 13:27
This is NOT a script from nyterave, posting that it is are against TOS
_____________________

Nemo Soyer
Registered User
Join date: 28 Mar 2006
Posts: 7
05-29-2006 14:00
Thanks for some of that info guys :)

As I said - PART of the above is Nyterave. I'm not sure why saying that is against TOS, I was saying it in the vague hope that it would remind someone of similar problems with that script.

Nyterave is different in that it has llSitTarget with a ZERO_ROTATION value. I changed it around when I found some other code in a thread by Draco18s, actually. The advantage of that was, as you see in my code, I had a ROTATION attribute I could easily edit, but maybe I should stay away from llSitTarget entirely.

The long code Ordinal went WTF over is most definitely copied straight from a Nyterave script, as I have no idea what it does :) I just copy/paste and try to make things work.

As for the poseballs - I do not use them. I wanted to make an extremely low prim chair, so I put the scripts into the cushions and deleted the balls. This means I cannot rotate the balls but had to do the whole circus act I've by now typed too much about ;)

I'll try that on_rez thing next time I'm online and hope it works.

I suppose a constructive turn to this discussion, if we're still having it, would be asking "how do I rotate and position a sitting avatar without rotating/position a prim and without editing values in llSitTarget".

If all else fails, I'll go back to using poseballs but I think they're ugly (yes I know about /hide) and a waste of prims. I wanted to do something new :)
Sitting Lightcloud
Registered User
Join date: 13 May 2004
Posts: 109
05-29-2006 14:51
To be honest we haven't had any problems with that script if used in THE poseball. Posting with names of groups or even scripts without the authors permission are against the TOS and common courtesy, why I wonder why the post is still here. Comments like some of which are mentioned by the above authors are just ridiculous without knowing what he/she is talking about and without helping with the question at hand. Nyterave produce a lot of good items for creators to be able to succeed and sell their furniture with poses. It's an excellent script for a poseball to be attached to a furniture with only a few easy modifications at the top of the script that even a non scripter can do. If you put the script in a new item with a rotation it will not work. People who buy items from Nyterave can always contact us directly for help. The original poster of this thread has been contacted and helped accordingly to resolve his issue. The script in question had been modified from the original script, hence some of the garbled coding.
_____________________

Nemo Soyer
Registered User
Join date: 28 Mar 2006
Posts: 7
05-29-2006 17:29
It was never my intention to turn this discussion into anything negative towards Nyterave. We've talked in game and cleared some things up.

I got my hands on the Nyterave stuff as a gift from a friend. Apparently some third parties are giving out Nyterave stuff as freebies and I got caught in the middle. It would also explain any script oddites like that really long float stuff pointed out above. All I did was delete a whole bunch of stuff from the "original" Nyterave and replace their zero_rotation bit with code of my own. It works until you copy it.

I'm going to keep trying to make a script that works without the poseballs and is copyable. And I'd love for this thread to get back onto that topic, but I doubt that'll happen after this. Oh well, live and learn :)

Oh, and for future reference, the on_rez bit didn't clear anything up either :(
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
05-30-2006 08:27
I'm really surprised that everyone doesn't just use the generic open source poseball script that's been around as long as I've been in SL. Even professional stores like Bits & Bobs use it. It's notecard configured, AND open source. I added some code to it to unsit after a delay so that you can use it with "moving" animations like Bits & Bobs' "Dive" anims without having to unsit at the end, simply because it's simple, free, commonly available, and has been well debugged by now.

I'm surprised it's not in the script library yet.
Nemo Soyer
Registered User
Join date: 28 Mar 2006
Posts: 7
05-30-2006 13:07
Are you referring to this one? Found it a few pages into the library message board section.

/54/7b/27543/1.html

That thing looks good, but still lacks rotation code which you need if you don't want to use poseballs. That notecard idea is clever though :)