Jump to content

numerical order to link prims...


mauselook
 Share

You are about to reply to a thread that has been inactive for 3414 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

 

 

 

 

 

  have a vehicle with 50 prims and chairs should stay in 5 link_number to the script sit work well (single script to 6 people), I am not making this up, a few chairs station getting link_number 45, already tried this example cited by Madelaine McMasters but when I click the vehicle to sit two avatars are sitting in the same position

 

Link to comment
Share on other sites

I m not sure to understand you .

 

Your problem is "when I click the vehicle to sit two avatars are sitting in the same position".

But the numerical orders to link prims won t change anything about this point .

 

If you have several seats , you will need  to have set an appropriate llSitTarget and eventually llSetClickAction .

The scripts to set the sittarget and the clickaction can be deleted after . The infos are kept in the prims .

Link to comment
Share on other sites

The script i am using i found here in this forum.

http://community.secondlife.com/t5/LSL-Scripting/Multiple-Sit-Targets/td-p/1387983

Is already 2 llSitTarget configurate and i  add mor 2  following the numerical llSitTarget

But some  seat i cant t get it as link number 2,3 ,4..

so the avatars are siting on  wrong position,so wong prims number.

i did as Madalene told me  and the avatars are siting  corret child prim(it just do this wen  you sit directly on chil prim ), but 2 avatars together in root prim see ? 2 in same prim... thats now my problem..

Link to comment
Share on other sites

That's because your llLinkSitTarget statements are not pointing at the appropriate child prims.  It makes absolutely no difference what the prim numbers are.  The only thing that counts is that you have the right link numbers referenced when you use them.  So, for example, in your state_entry event you might do something like this...

state_entry(){    integer i;    while (++i <= llGetNumberOfPrims())    {        if (llGetLinkName(0) == "Driver Seat")        {            gDriverLink = i;            llLinkSitTarget( i, <0.0,0.2,0.1>,ZERO_ROTATION);        }        else if (llGetLinkName(i) == "Passenger 1")        {            gPass1Link = i;            llLinkSitTarget( i, <0.0,0.5,0.1>,ZERO_ROTATION);        }        else if (llGetLinkName(i) == "Passenger 2")        {            gPass2Link = i;            llLinkSitTarget( i, <-1.0,0.0,0.1>,ZERO_ROTATION);        }    }}

 Then, when you need to refer to the driver later in your script, s/he is llAvatarOnLinkSitTarget(gDriverLink).  If you want to change the color of the second passenger's seat. you use llSetLinkColor(gPass2Link,<1.0,1.0,0.0>,ALL_SIDES).  And so forth.  Assuming that you have saved those link numbers gDriverLink, gPass1Link, and gPass2Link as global integer variables, you can use them anywhere in your script without getting confused, and you don't even need to know what those numbers are.  Even if you unlink and relink the entire vehicle, all you need to do is reset the script and it will find those links again.

Link to comment
Share on other sites

hello Rolig Loon, thanks for the help, I was trying to do just that, only in a different way, I tried to do as you said and the error continues, the banks are inside the vehicle making it difficult to click on them to sit, then the easiest is click on the outside of the vehicle and when I do that, the first avatar (pilot) goes to its correct position, since the second does not, he sits in the same position of the pilot, this happens only by clicking on the outside of the vehicle, if click on the passenger seat (which is hard to access) but works correctly.

Link to comment
Share on other sites

you have reason Miranda Umino, the avatar this not sitting in the same prim, this rather sitting in different prims but not this in the order, for example. I'm 50 with a prim object, when I click on the outside of the vehicle, the first avatar always goes to the correct position would be the root prim, since the second is always going to link 2, but the chair is not numbered as link2, therefore the avatar goes to another place of the vehicle. this only happens when I click on the outside of the vehicle (this outside is not the root prim)

  I am sure that I am doing exactly as the example of Rolig Loon

 

 

Link to comment
Share on other sites

Hmmm... It seems to me that something broke awhile back... like some years.  Where the prims added to an existing linkset don't get higher numbers like they used to.  So quoting from the answer you point to:

"2. If you select a new prim and then select the linkset, the new prim will always have the highest number.  This is particularly handy if the last "prim" added to a linkset is an avatar, as will be the case if an avatar sits on the linkset.  In LSL terms, llAvatarOnSitTarget() = llGetNumberOfPrims() ."

It's still true that a sitting AV gets the highest link number.  However in my testing the new prim (or prims) added to a link set get link number 2 (or 2 through whatever if multiple  new prims are linked)

For testing I list out all link numbers with the prim name at changed link event.  The new prim named '9:55' gets link number 2.

[06:55:53] 3 prims linked: Changed Link
[06:55:53] 3 prims linked: 1,'3 prims linked'
[06:55:53] 3 prims linked: 2,'Object'
[06:55:53] 3 prims linked: 3,'Object'
[06:56:10] 3 prims linked: Changed Link
[06:56:10] 3 prims linked: 1,'3 prims linked'
[06:56:10] 3 prims linked: 2,'9:55'
[06:56:10] 3 prims linked: 3,'Object'
[06:56:10] 3 prims linked: 4,'Object'

 

Link to comment
Share on other sites

Select the seats and the root prim and unlink them

Select the remaining linkset first.

Select your seats in reverse order. Seat number 6, then seat number 5, 4,3,2,1 and last but not least the root prim.

Link it.

Now you have set the order of which the avatars will take seats, unless they are clicking on the seats directly.

First avatar will get the driver seat. the second avatar will get seat 2 etc. pp.

Note, if your root prim is none of the seats, the first seat will have linknumber 2.

Now set your llLinkSitTargets to the appropiate linknumbers.

If that doesn't work, probably your script isn't set up the right way.

To check linknumbers quickly, just put a little script in the object.

default{    touch_start(integer total_number)    {        llOwnerSay((string)llDetectedLinkNumber(0));    }}

 

Link to comment
Share on other sites


mauselook wrote:

hello
Rolig
Loon
,
thanks for the help
,
I was trying to
do just that
,
only
in a different way
, I tried to
do as
you
said
and
the error
continues
,
the
banks
are inside the
vehicle
making it difficult
to click on them
to sit,
then
the easiest
is click
on the outside
of the vehicle
and
when I do that
,
the first
avatar
(pilot
) goes to
its correct
position
, since
the second
does not
,
he sits
in the same
position of the
pilot,
this happens
only
by clicking
on the outside
of the vehicle
, if
click on the
passenger seat
(which is
hard to
access)
but
works correctly.

I recently came across this problem to,  as I remember even once I got the scripting right I still had the problem until I went back and scrubbed (removed the sit target) from any prim that had ended up with a sit target.  Several prims had ended up with a sit target by accident from linking and unlinking, with out resetting the script.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3414 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...