Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Why wont my one prim stools work??

LadyLutha Harlow
Registered User
Join date: 9 Sep 2006
Posts: 18
12-06-2006 03:13
I read the article for newbie builders on Prim efficiency http://secondlife.com/knowledgebase/article.php?id=281 and then went off and made some stools for my friends soon-to-open club. The stools look great and I've incorporated the club logo and everything. BUT they aren't very useful as stools, as they never "seat" in the same direction. In the guide it says at the bottom to use the "sit on object" function from the general tab on the edit tools, which I have done. But this either sits the avitar a good third in to the stool so I had to add a seat base, and/or sits the avi at any random rotation on the stool. It doesn't seem to matter how I rotate the stool, the direction is never the same when it's next sat on.

In order to make my stools do what I want them to, ie always seat the avi in the same direction, do I have to add pose balls, or is there some simple magic script that I need to put somewhere?, and if so, does anyone have a simple "sit the way I want you do and dont you dare move" script that I can use.

I have a load of free to use poses, but I cant quite figure out what to do with these either, or do these have to be named too?

Is this a bug and should I report it, or is there something that should be editable? I've looked all over the knowledge base, got terribly confused in Wiki too. (That's for a later date I think).
_____________________
Remember Your Yesterdays, Dream Your Tomorrows, But Live for Today....
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
12-06-2006 04:07
Hi LadyLutha

One way to fix this is with a little script using the llSitTarget (), explained in:
http://rpgstats.com/wiki/index.php?title=LlSitTarget

Where you sit on a prim is one of its properties. You can alter that position with this script.
CODE

default
{
state_entry()
{
// Avatar will sit slightly above the object's center,
// facing the direction of the forward axis.
llSitTarget(<0,0,.5>, ZERO_ROTATION);
}
}

As this is not a scripting forum, and I assume you have no scripting experience, please allow me to take you through the procedure of running this script.

First you need to copy this script from its window by highlighting and using copy.

Then you edit your stool, click on "More.." button,
then click on the "Content" button,
Then click on the "New Script" Button

You should now see a little script icon followed by the words "New Script", all in white.

You should then double click on that icon and a scripting window should come up.
Assuming the above script is still in your copy buffer (clipboard),
1. click once on the text in the scripting window.
2. press ctl a to select the existing script
3. press ctl c to paste the above script.

If the scripting window now shows the same script as above, press the little red cross at the top right hand corner, and click on "save" in the pop up window.

At the bottom is should say:"Compile successful, saving .." and then the window should close.

Your new script has just set the sit position to a new spot.

The <0,0,.5> bit is the position vector telling the prim where you should be sitting. The three numbers are similar to your position in the sim shown at the top of your sl view, corresponding to west/east, south/north and down/up coordinates. You can alter these to suit.

Please let us know if this made any sense and if it worked.

Ed
LadyLutha Harlow
Registered User
Join date: 9 Sep 2006
Posts: 18
12-06-2006 04:19
Thank you, thats all I need. :-) I know just enough to be dangerous on scripting - and I'll apologise now for anyone that lives next door to to ware Im working on these. If I "sit" and end up in your garden, its not the position Im aiming for!
_____________________
Remember Your Yesterdays, Dream Your Tomorrows, But Live for Today....
LadyLutha Harlow
Registered User
Join date: 9 Sep 2006
Posts: 18
12-06-2006 18:28
Ah - Ed, I tried that is it sits me but at a 90 degree angle to the seat - I think I might need another line of code to rotate me on the other axis.

The Stool is an elongated tube.
_____________________
Remember Your Yesterdays, Dream Your Tomorrows, But Live for Today....
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
12-06-2006 20:39
from http://www.lslwiki.com/lslwiki/wakka.php?wakka=rotation

CODE

vector eul = <0,0,45>; //45 degrees around the z-axis, in Euler form
eul *= DEG_TO_RAD; //convert to radians
rotation quat = llEuler2Rot(eul); //convert to quaternion


Put this code just above the llSittarget line, then replace ZERO_ROTATION with quat.

Play with changing the angles in the first line, they are in degrees for each of the three directions.
LadyLutha Harlow
Registered User
Join date: 9 Sep 2006
Posts: 18
12-08-2006 05:32
Thanks Ed, that worked, well untill I did somethin stoopid. I was still trying to use the rotation tool which I now realise works on the object and not the sit point. (So I'll play again tonight). Im going to take a scripting class. I didnt realise something so simple would casue me so much trouble!!

Hmmm now what happens if I drop this animation in.........

When Im a famous master scripter on SL, I'll credit you :-)
_____________________
Remember Your Yesterdays, Dream Your Tomorrows, But Live for Today....
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
12-11-2006 18:39
I've made one-prim swivel stool. The person who sits on can swivel it by himself. :D
It is just bells and whistles of my product, "U-NO", yeah, it's a card game, you know.
You can get it in my house yard or other chow-chow shops of mine. :)
Of course it is open-sourced.

Sorry for my plugging. ;)
_____________________
:) Seagel Neville :)
Kaimi Kyomoon
Kah-EE-mee
Join date: 30 Nov 2006
Posts: 5,664
12-14-2006 10:26
Thanks very much for this information. I wonder if I understood it correctly. Is this what the whole script should look like?

CODE
default
{
state_entry()
{
// Avatar will sit slightly above the object's center,
// facing the direction of the forward axis.
vector eul = <0,0,45>; //45 degrees around the z-axis, in Euler form
eul *= DEG_TO_RAD; //convert to radians
rotation quat = llEuler2Rot(eul); //convert to quaternion
llSitTarget(<0,0,.5>, quat);
}
}
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
12-14-2006 14:56
Yes, it is the whole script.
If it is 1 prim stool made from a tube, try these value.

eul = <0,-90,0>;
llSitTarget(<-1.0,0,.0>, quat);

And you can also write the same script like bellow.
CODE
default
{
state_entry()
{
llSitTarget(<-1.0, 0, 0>, llEuler2Rot(<0,-90,0> * DEG_TO_RAD));
}
}
_____________________
:) Seagel Neville :)
Kaimi Kyomoon
Kah-EE-mee
Join date: 30 Nov 2006
Posts: 5,664
12-14-2006 16:18
Thank you very much. That will come in handy.
Zebra North
Broadly Offensive
Join date: 7 May 2006
Posts: 48
12-15-2006 01:15
Something to remember! Sit targets are a property of the PRIM not the script, so once your sit target is set correctly, delete the script from the prim. This will make your stools no-lag :D
Kaimi Kyomoon
Kah-EE-mee
Join date: 30 Nov 2006
Posts: 5,664
12-15-2006 11:15
From: Zebra North
Something to remember! Sit targets are a property of the PRIM not the script, so once your sit target is set correctly, delete the script from the prim. This will make your stools no-lag :D


Oh dear. I don't understand what that means. It seems like you are saying that you need to put a script into the prim to set the target but then if you delete the script the target will still be there, without the script? My understanding of how things work is about as fuzzy as it can be.
Kalel Venkman
Citizen
Join date: 10 Mar 2006
Posts: 587
Exactly right!
12-15-2006 11:25
From: Kaimi Kyomoon
Oh dear. I don't understand what that means. It seems like you are saying that you need to put a script into the prim to set the target but then if you delete the script the target will still be there, without the script? My understanding of how things work is about as fuzzy as it can be.


You got it exactly right, Kaimi!

A prim may have any or all of these individual properties, in addition to its shape:
* Color, texture, and emission of light
* A sit target position and rotation
* Particles
* A sound it emits

You can write a script that sets any or all of these properties, but once set, the properties are properties of the prim and stay with the prim even if you remove the script that set them, and even if you then link that prim with one or more other prims!
Kaimi Kyomoon
Kah-EE-mee
Join date: 30 Nov 2006
Posts: 5,664
12-15-2006 11:34
Thank you Kalel. That seems kind of counter-intuitive and is very interesting information. I really appreciate it.
Kaimi Kyomoon
Kah-EE-mee
Join date: 30 Nov 2006
Posts: 5,664
12-15-2006 11:59
I have another question. Is it possible for more than one person to sit on the same thing?
Peekay Semyorka
Registered User
Join date: 18 Nov 2006
Posts: 337
12-15-2006 12:38
Yes, it is possible for more than one person to sit on the same prim, even if their positions will overlap each other.

-peekay
Kaimi Kyomoon
Kah-EE-mee
Join date: 30 Nov 2006
Posts: 5,664
12-15-2006 12:43
So does the script have two targets or does the prim have two scripts?
Kaimi Kyomoon
Kah-EE-mee
Join date: 30 Nov 2006
Posts: 5,664
12-15-2006 14:30
I've been playing around with it. I was thinking this part: llSitTarget(<0,0,.5>, quat); might determine the exact position where the avitar sits, but changing the numbers doesn't seem to change anything...
Ultralite Soleil
Registered User
Join date: 31 Aug 2006
Posts: 108
12-19-2006 08:04
From: LadyLutha Harlow
The Stool is an elongated tube.

Get more fiber.
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
12-19-2006 08:45
From: Kaimi Kyomoon
So does the script have two targets or does the prim have two scripts?
You are supposed to ask this question on the scripting tips forum rather than here. Anyway, see this thread.
_____________________
:) Seagel Neville :)
Kaimi Kyomoon
Kah-EE-mee
Join date: 30 Nov 2006
Posts: 5,664
12-19-2006 11:24
Thanks very much Seagel. There is so much to learn.
Marianne McCann
Feted Inner Child
Join date: 23 Feb 2006
Posts: 7,145
01-03-2007 17:11
Can somethign like this be used to set a position on a prim? Specifically so that no matter what direction a person sits on the prim, they'll always be facing a certain direction relative to the prim, not the avatar?

Mari
_____________________


"There's nothing objectionable nor illegal in having a child-like avatar in itself and we must assume innocence until proof of the contrary." - Lewis PR Linden
"If you find children offensive, you're gonna have trouble in this world :)" - Prospero Linden
Peekay Semyorka
Registered User
Join date: 18 Nov 2006
Posts: 337
01-03-2007 21:10
Yes the llSitTarget function specifies the direction the person will face when sitting.

-peekay