Jump to content

Resetting seats is not working in my script


VirtualKitten
 Share

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

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

Recommended Posts

1 hour ago, VirtualKitten said:

Thanks arton Rotaru

Your welcome!

I would like to know why it is so important that this has to be done in a linkset? It would be soooo much easier to make a rope climber with a rezzer and separate prims.
10 years ago I made a ladder climber for a friend. It uses a transparent prim (with click action sit) at the top and one at the bottom. Which covers a portion of the ladder at each end.

So when the cursor is on the lower end of the ladder, click and sit on that prim. The top prim will delete itself, so nobody can climb down.
The prim then plays a climb anim, and moves to the top with KeyFramedMotion. Nice and smooth.
while climbing up, a second prim will be rezzed at the bottom.
When nobody is climbing anymore, it rezzes a prim at the top again. And vice versa.

If this is restriced to 5 climbers, it requires 6 prims at most. 5 climbers plus the rezzer.
3 prims will be permanently rezzed. 2 seats + rezzer. So it requires only 3 more free prims available if really 5 people are climbing this at once.
 

Edited by arton Rotaru
Link to comment
Share on other sites

then how do 1 prim seats work please note this 

My script still does not create extra seat .

if(llAvatarOnLinkSitTarget(bottom_seat)== agent) {
                  seat ="bottom";
                  SEATS_data = llJsonSetValue(SEATS_data,["seat"+(string) i,"loc"],seat);
                  // PRIM_SIT_TARGET returns  a list. [integer status, vector pos, rotation rot].
                  quaternion v = (quaternion)llList2String( llGetLinkPrimitiveParams(j, [PRIM_SIT_TARGET,j, PRIM_SIT_TARGET]),1);
                  SEATS_data = llJsonSetValue(SEATS_data,["seat"+(string) i,"vloc"],(string)v);
                  quaternion  current_seat =(quaternion) llList2String( llGetLinkPrimitiveParams(bottom_seat, [PRIM_SIT_TARGET,j, PRIM_SIT_TARGET]),1);
                  //llOwnerSay("current_seat:"+(string)current_seat);
                  llSetLinkPrimitiveParamsFast(bottom_seat,[ PRIM_SIT_TARGET, TRUE,_getFreeSeat(seats_pos_bottom,agent),(quaternion)current_seat ]);
               
                  if(find_anyone_up_or_down( agent,"top") == NULL_KEY) {
                     llUnSit(agent);
                     llSay(0, "There are other forest folk comming down the rope please wait for them before climbing the rope , then please try again.");
                     return;
                  }
              }

Hugs D

Link to comment
Share on other sites

7 hours ago, VirtualKitten said:

i now have this

in your script, you have a set of linked prims and a set of linked agents. Where each prim is associated with a respective agent

with a single script multi-climber rope. we don't need both. We only need to manipulate/move the set of linked agents

Link to comment
Share on other sites

I tried

 default
{
    state_entry()
    {     
       integer num_seats = 3;


       list seats_pos_bottom = [<-0.20,0.0,0.01>,"key",<-0.20,0.0,0.05>,"key",<-0.20,0.0,0.09>,"key",<-0.20,0.0,0.13>,"key",<0.00,0.0,0.05>,"key"];
       list seats_pos_top= [<-0.20,0.0,0.01>,"key",<-0.20,0.0,0.05>,"key",<-0.20,0.0,0.09>,"key",<-0.20,0.0,0.13>,"key",<-0.20,0.0,0.05>,"key"]; 
       integer ic = num_seats;
        for(;ic--;) {
            llLinkSitTarget(bottom_seat,llList2Vector(seats_pos_bottom,(num_seats-ic)),ZERO_ROTATION);
        }
        ic = num_seats;
        for(;ic--;) {
            llLinkSitTarget(top_seat,llList2Vector(seats_pos_top,(num_seats-ic)),ZERO_ROTATION);
        }

But got the usual crappy SL statement "No room to sit here, Try another spot" Sighs this doesn't even allow it to have one sit 

 

Hugs D

Edited by VirtualKitten
Link to comment
Share on other sites

6 minutes ago, VirtualKitten said:

I tried

Every linked 'object' (prim or mesh) can have one sit target, and they're relative to the location of that object, not the root prim. Prims can be weird in that multiple people can ~sometimes sit on them if they have no sittarget defined, but that's inconsistent and can be frustrating for users.

Link to comment
Share on other sites

3 minutes ago, VirtualKitten said:

eight extra prims one for each seat which is really wasteful .

you can use the prims already in the seat, or add a big invisible box around your thing with no sit targets defined anywhere and try to mess around with SL being weird and buggy.

Link to comment
Share on other sites

1 hour ago, VirtualKitten said:

Arton see reply here

 

Hehe, I also posted in that ancient thread. 😇

While it's possible to sit more than one AV on a prim, it's still trying to "mess around with SL being weird and buggy", as Tessa put it.

That's why I would do it with single, unlinked prims, as I have described above.

Edited by arton Rotaru
  • Like 1
Link to comment
Share on other sites

Quintess I am using 

list seats_pos_bottom = [<-0.20,0.0,0.01>,"key",<-0.20,0.0,0.5>,"key",<-0.20,0.0,1.0>,"key",<-0.20,0.0,1.5>,"key",<0.00,0.0,0.05>,"key"];
list seats_pos_top= [<-0.20,0.0,0.01>,"key",<-0.20,0.0,0.5>,"key",<-0.20,0.0,1.0>,"key",<-0.20,0.0,1.5>,"key",<-0.20,0.0,0.05>,"key"];

Got the same crappy message as before

Link to comment
Share on other sites

FWIW, I did a few expiraments. If you want to break SL into allowing as many sitters on a single prim as possible with the least amount of weirdness, you might want to try a cylinder turned on its side, making sure it has no sit target set.

  • Like 1
Link to comment
Share on other sites

54 minutes ago, Quistess Alpha said:

FWIW, I did a few expiraments. If you want to break SL into allowing as many sitters on a single prim as possible with the least amount of weirdness, you might want to try a cylinder turned on its side, making sure it has no sit target set.

cylinder works good as a rope

Link to comment
Share on other sites

It's always worth looking at the bounding boxes display and the physics display in these sorts of puzzles. When I was helping somebody who was struggling to get through a doorway we looked at the bounding box of her RuthToo mesh body and saw that in addition to the tall cube enclosing the torso and legs, there was an extra bounding box across the body from side to side that enclosed where the arms would be if the body was in a T-pose animation, well over double the width of the torso bounding box.

If you are trying to sit an additional avatar on a single multi-seat prim and the spot that they are clicking on or the intended seat offset is within the bounding box of an already seated avatar, you might get the "no room to sit" message. Similarly, if the physics shape of a nearby object falls partially across the seating area, you may also get a failure to sit.

Wulfie gave a very detailed explanation of why you can and can't sit on things ages ago, when I believe a piano stool was giving problems. From my own observations, the issue there was that the physics shape of a skybox garden occluded part of the piano seat.

Regarding adding 8 individual prims for seats, why not do so but set them to convex hull? You might then only incur a 4LI overhead?

 

Edited by Profaitchikenz Haiku
a g became an h, it gappens sometimes
Link to comment
Share on other sites

Why is this only registering six seats please?

rope = 1;
       llSetLinkPrimitiveParamsFast(rope,[ PRIM_SIT_TARGET, FALSE, ZERO_VECTOR,ZERO_ROTATION ]);
       integer ih= 6;
       for(;ih--;) {
          // llOwnerSay("line:"+(string)"top_seat#"+(string)(6-ih-1));
             new_seats = new_seats + check_for_prim("bottom_seat#"+(string)(6-ih-1)); 
             new_seats_key =   new_seats_key + llName2Key("bottom_seat#"+(string)(6-ih-1)); 
             llLinkSitTarget(_llObtainLinkFromName("bottom_seat#"+(string)(6-ih-1)),llList2Vector(seats_pos_bottom,(num_seats-ih)),ZERO_ROTATION);
       }
       ih= 6;
       for(;ih--;) {
          // llOwnerSay("line:"+(string)"top_seat#"+(string)(6-ih-1));
             new_seats = new_seats + check_for_prim("top_seat#"+(string)(6-ih-1)); 
             new_seats_key =   new_seats_key + llName2Key("bottom_seat#"+(string)(6-ih-1));
              llLinkSitTarget(_llObtainLinkFromName("top_seat#"+(string)(6-ih-1)),llList2Vector(seats_pos_top,(num_seats-ih)),ZERO_ROTATION);  
       } 

When I use the second script on the first posts i get by clicking it  i only get six seats any ideas please?

[07:39] VK seats: LData:0|<0.000000, 0.000000, 0.000000>|<0.000000, 0.000000, 0.000000, 1.000000>|0|<0.000000, 0.000000, 0.000000>|<0.000000, 0.000000, 0.000000, 1.000000>|1|<-0.200000, 0.000000, 0.010000>|<0.000000, 0.000000, 0.000000, 1.000000>|0|<0.000000, 0.000000, 0.000000>|<0.000000, 0.000000, 0.000000, 1.000000>|1|<-0.200000, 0.000000, 0.050000>|<0.000000, 0.000000, 0.000000, 1.000000>|1|<0.000000, 0.000000, 0.050000>|<0.000000, 0.000000, 0.000000, 1.000000>|0|<0.000000, 0.000000, 0.000000>|<0.000000, 0.000000, 0.000000, 1.000000>|0|<0.000000, 0.000000, 0.000000>|<0.000000, 0.000000, 0.000000, 1.000000>|1|<-0.200000, 0.000000, 0.010000>|<0.000000, 0.000000, 0.000000, 1.000000>|1|<-0.200000, 0.000000, 0.050000>|<0.000000, 0.000000, 0.000000, 1.000000>|1|<-0.200000, 0.000000, 0.050000>|<0.000000, 0.000000, 0.000000, 1.000000>|0|<0.000000, 0.000000, 0.000000>|<0.000000, 0.000000, 0.000000, 1.000000>|0|<0.000000, 0.000000, 0.000000>|<0.000000, 0.000000, 0.000000, 1.000000>|0|<0.000000, 0.000000, 0.000000>|<0.000000, 0.00000
[07:39] VK seats: Hello, !3|5|6|9|10|11

Link to comment
Share on other sites

8 hours ago, Profaitchikenz Haiku said:

Regarding adding 8 individual prims for seats, why not do so but set them to convex hull? You might then only incur a 4LI overhead?

Yes they are all Convext hull  mesh as below seats 

[07:47] VK seats: Resetting
[07:47] VK seats: line:top_seat#0
[07:47] VK seats: line:top_seat#1
[07:47] VK seats: line:top_seat#2
[07:47] VK seats: line:top_seat#3
[07:47] VK seats: line:top_seat#4
[07:47] VK seats: line:top_seat#5
[07:47] VK seats: line:top_seat#0
[07:47] VK seats: line:top_seat#1
[07:47] VK seats: line:top_seat#2
[07:47] VK seats: line:top_seat#3
[07:47] VK seats: line:top_seat#4
[07:47] VK seats: line:top_seat#5

 

Link to comment
Share on other sites

1 hour ago, VirtualKitten said:

Yes they are all Convext hull  mesh as below seats 

[07:47] VK seats: Resetting
[07:47] VK seats: line:top_seat#0
[07:47] VK seats: line:top_seat#1
[07:47] VK seats: line:top_seat#2
[07:47] VK seats: line:top_seat#3
[07:47] VK seats: line:top_seat#4
[07:47] VK seats: line:top_seat#5
[07:47] VK seats: line:top_seat#0
[07:47] VK seats: line:top_seat#1
[07:47] VK seats: line:top_seat#2
[07:47] VK seats: line:top_seat#3
[07:47] VK seats: line:top_seat#4
[07:47] VK seats: line:top_seat#5

 

These are only named "top_seat". Do you by any chance forgot to name 6 of those "bottom_seat"?

Link to comment
Share on other sites

HI according to LSL there was a control character in the initial seat lower 4 however now have them all now, however I am using 

 list p_new_seat=[];
               integer ig=llGetNumberOfPrims();
               integer to=ig;
               for(;ig--;) {
                   llOwnerSay("Seat:"+(string)(to-ig));
                 p_new_seat + llAvatarOnLinkSitTarget(llList2Integer(new_seats,(to-ig)));
               }

To determine if  seat is used it provides no entries can anyone explain why this is not working please?

 

I also registering all 

      rope = 1;
       llSetLinkPrimitiveParamsFast(rope,[ PRIM_SIT_TARGET, FALSE, ZERO_VECTOR,ZERO_ROTATION ]);
      
       integer ih= 6;
       for(;ih--;) {
             new_seats = new_seats + check_for_prim("bottom_seat#"+(string)(6-ih-1)); 
             llLinkSitTarget(_llObtainLinkFromName("bottom_seat#"+(string)(6-ih-1)),llList2Vector(seats_pos_bottom,(6-ih-1)),ZERO_ROTATION);
       } 
       ih= 6;
       for(;ih--;) {
             new_seats = new_seats + check_for_prim("top_seat#"+(string)(6-ih-1)); 
             llLinkSitTarget(_llObtainLinkFromName("top_seat#"+(string)(6-ih-1)),llList2Vector(seats_pos_top,(6-ih-1)),ZERO_ROTATION);  
       } 
       llOwnerSay("Seats:"+llDumpList2String(new_seats,","));

As you can see from output,

[09:52] VK  [6 seats]: Resetting
[09:52] VK [6 seats]: Seats:6,8,9,7,5,4,11,13,14,12,10,2

The program 2nd code snippet at post 1 only gives back :

[09:53] VK  [6 seats]: Hello, !3|5|6|9|10|11|14

Why are these different?

 

{Hugs! } D 

Edited by VirtualKitten
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 762 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...