Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Switch based navigation for motor impaired users

Eelke Forder
Registered User
Join date: 17 Apr 2007
Posts: 2
01-02-2010 22:54
Hello,

I'm trying to make Second life more accessible. I was hoping an experienced LSL scripter could help me out. I'm trying to create a navigation mechanism that allows someone who can only use single switch access http://en.wikipedia.org/wiki/Switch_access to navigate their avatar.

The mechanism is supposed to be an avatar attachment or a HUD attachment in the form of a translucent arrow that hovers at the avatars feet and which has three states that the user cycles through by pressing the forward/switch key:

1) Rotate: the arrow rotates 180 degrees from left to right. When the user presses the up key the direction of the arrow becomes fixed and goes to state 2.
2) Extend: the arrow grows in length until it reaches a certain maximum (10m) and then shrinks again until a certain minimum. If the user presses the UP key again the arrow becomes fixed and goes to state 3.
3) Move: the avatar moves towards the top of the arrow while the arrow shrinks again. If the user has arrived at its destination, the mechanism goes back to state 1.

I was able to create the arrow, the three states, and my avatar to move see the code below, but I'm having a really hard time with attaching the arrow prim to my avatar, my arrow keeps getting disoriented.

I have a few questions:
1) is there a way to set the rotation of my arrow to the direction my avatar is facing?
2) How can I make sure my arrow does not move into the ground?
3) Is there a way to attach my arrow as such that it moves with my avatar but that it doesn't move with the body part ? E.g. I would like my arrow to just hover under my avatar.

Here's a screenshot of the switchnav mechanism.



Any help would be appreciated.

Below my code (note the moving part does not work yet). If your drop this into a triangle with z height =0 and attach it to the pelvis it should work.

Hmm this forum doesn't allow for displaying code.
If you want to take a look at my code you can download it at:
http://www.eelke.com/files/switchnav.lsl
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
01-03-2010 00:30
From: Eelke Forder
I have a few questions:
1) is there a way to set the rotation of my arrow to the direction my avatar is facing?
2) How can I make sure my arrow does not move into the ground?
3) Is there a way to attach my arrow as such that it moves with my avatar but that it doesn't move with the body part ? E.g. I would like my arrow to just hover under my avatar.
What a cool project.

1. What attachment point are you using? If you use the spine, pelvis or stomach and adjust the arrow to point straight ahead while you're on a pose stand, I would think it would always face in the direction the avatar is facing, so long as the avatar is standing. It should also remain fairly flat.

2. If you want the arrow to show under the feet, then the only way I can think of to do this is to make the arrow physical, detect when it hits ground, and raise and lower it accordingly. That's pretty laggy. You can also detect height at explicity specified sim locations, but not only does that involve rather tedious arithmetic, but I've never gotten that to work well, myself. Plus it might be very tricky at sim crossings. Maybe someone else has a better idea *bump*

3. See 1.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
01-03-2010 07:06
From: Eelke Forder
Hmm this forum doesn't allow for displaying code.
If you want to take a look at my code you can download it at:
http://www.eelke.com/files/switchnav.lsl

Welcome to the wonderful world of resident SL forums. Yes, you can post code (and all sorts of other things that appear to be unpostable). You just have to know the magic words. See .
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
01-03-2010 07:47
TBH, my suggestion would be to create a custom viewer that supports the switch as the input method.

Your idea is likely to be more "accepted" though and is somewhat impervious to LL policy hijinks at a later date on 3rd party viewers.

As for your questions...

My answers would be the same as Nika's :)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-03-2010 10:21
as an inword device, I think you'll find it easier to incorporate the concept as a vehicle type script, as attachments can't rotate an avatar currently. unfortunately that has it's own issues in the sense of teleports, rezzing, and even the initial act of getting the av onto the vehicle.....

for complete access it really would need to be incorporated into the viewer at this time.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Paladin Pinion
The other one of 10
Join date: 3 Aug 2007
Posts: 191
01-03-2010 11:24
How about making the arrow something you sit on? Substitute the default sit animation with a standing one. Then you can move the arrow and the avatar will go along with it, including following its rotation, without much extra scripting.
_____________________
Mote Particle Script Generator - easier and faster than any HUD
Also: Paladin's Sunbeam. Up at dawn, gone by dusk, day and night sounds, fully configurable
See more at: www.paladinpinion.com
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
01-03-2010 11:46
From: Void Singer
as attachments can't rotate an avatar currently.
Really? If I attach a physical object and move it, the avatar moves with it. So, if I rotate it (actually set the rotation), would not the avatar rotate as well?

Can't go inworld right now to try it, grr.
.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-03-2010 12:39
as an attacment, no. it will rotate in place at the attachment point. as a vehicle (literal or non-physics) yes.

ETA:
it MAY be possible for an unattached item to rotate an av by nudging the av via collision, but it'd be very unreliable and messy, and still suffer the problems of needing to be rezzed (not available in many locations)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -