Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

sitting on worn items

Pedlar Decosta
Registered User
Join date: 7 May 2007
Posts: 12
03-05-2008 02:01
I have some items that you wear and that trigger a sitting animation when worn. The problem is if you use the arrow keys the avatar gets up and walks or turns around. Is there a way to force the avatar to stay sitting ?... and a bonus would be to be able to use the arrow keys as the camera controls as you would if you were sitting on a chair instead of wearing it. I have been trying all sorts of alternatives and putting them in different places in the script, but I just don't know enough. It's fairly complicated this LSL...anyone else noticed lol ? Any help would be appreciated.
Sho Iuga
Registered User
Join date: 6 Jun 2007
Posts: 35
03-05-2008 04:21
There is a way: you take controls (with the llTakeControls function) and dont pass them on to SL, instead you use the input for controling the camera.

There is a script in the scripts library, that uses keys to controll the camera:
/15/8f/96534/1.html

It is not exactly what you need though, but you may be able to change it to your needs.


If you dont want to control the camers it becomes a lot simpler. You add something like the following to your script:

attached(key av)
{
llRequestPermissions(av, PERMISSION_TAKE_CONTROLS);
}

run_time_permissions(integer perms)
{
integer desired_controls =
CONTROL_FWD |
CONTROL_BACK |
CONTROL_LEFT |
CONTROL_RIGHT |
CONTROL_ROT_LEFT |
CONTROL_ROT_RIGHT |
CONTROL_UP |
CONTROL_DOWN;
if (perms & PERMISSION_TAKE_CONTROLS) {
llTakeControls(desired_controls, TRUE, FALSE);
}

control(key name, integer held, integer change)
{
}
Pedlar Decosta
Registered User
Join date: 7 May 2007
Posts: 12
thanks :)
03-06-2008 19:27
I was hoping to post a more positive outcome. But so far I am still trying to integrate it into one of a couple of scripts I could use (I found one on here). I'll keep at it though, so thank you very much :)