Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Maximum range for sit

Leo Mission
Registered User
Join date: 6 Jan 2006
Posts: 189
11-15-2009 07:45
I'm working on some builds at the moment, which because of the exact prims used, need to use a sit-teleporter-door rather than a standard gap/opening door. This works reasonably well.

The only issue I have is people can sit-teleport from right across the sim and this spoils the realism of this method (and it's a roleplaying sim so this is kinda important). Is there any way I could drop an accessory script into the door prim which would prevent sit (i.e. unsit I guess) if the agent was above a certain distance away? (e.g. 10m)

Many thanks for your help in advance.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
11-15-2009 08:49
You could have a 'key' prim linked to the door prim.
The key will only unlock the door when touched by someone within the allowed range.
The key will unlock the door by changing the llSitTarget parameters.
The door will only be unlocked for a few seconds and until used once.
When locked the door has harmless llSitTarget parameters; The llUnSit is always used in a sit teleport.

Maybe you can make the door 'unable to sit' by blocking it with another prim and lock it that way.
_____________________
From Studio Dora
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
11-15-2009 08:52
Once you get the changed event, the avatar is already there, so you will need a test beforehand.

You might require a touch before sit, then you can check if llDetectedPos is withing some reasonable distance.

If touching is too clunky, you could surround the area with a collision pad, or use a sensor, again to see if the avatar hoping to sit is one of the ones who was in the area.

An unsit might not be enough of a response, since the avatar is still right where it wants to be. You might want to follow that with a push, or have the door act as a teleporter that drops them somewhere inconvenient before unsit, so they get the hint.
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
11-15-2009 08:54
From: Dora Gustafson
Maybe you can make the door 'unable to sit' by blocking it with another prim and lock it that way.

This one was always easy to get around with camming, and now that viewers have derender it's even easier.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
11-15-2009 09:31
From: Viktoria Dovgal
This one was always easy to get around with camming, and now that viewers have derender it's even easier.
Some prims just will not allow you to sit on them. It is possible though, that you should 'Clear' the llSitTarget by llSitTarget(ZERO_VECTOR, ZERO_ROTATION), before the default sit will report: 'no room to sit'.

Now tested: It can be done, but the llSitTarget has to be cleared, as I guessed.
Place a big prim(it can be totally clear) where the av's bounding box would be placed by the auto sit function and the av is not seated. You will get a warning:'no room to sit, try another spot'.
_____________________
From Studio Dora