Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

click to sit while in mouselook

Breezy Ishtari
Registered User
Join date: 10 Sep 2009
Posts: 5
01-26-2010 09:38
is there any way to script an object so that while the avatar is in mouselook and they left-click the object they sit on that object. I know the normal way of changing the objects properties to "sit when left clicked" but that doesn't seem to work while in mouselook. any suggestions, this has really been giving me problems.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
01-26-2010 09:50
Not that I know of. There is a debug setting (Advanced >> Debug Settings) called mouselookBtnState that doesn't seem to do anything obvious, but its name suggests that it might be intended to give you button activity when set to TRUE. However, you don't have that option so we'll never know. Personally, I avoid mouselook. It saves a lot of hassles and I don't get nauseated watching the world wobble around. :p

ETA: AHA! This is what I get for not using mouselook myself. You CAN get control of your left mouse button while in mouselook. What you need to do is script a control event and activate the CONTROL_ML_LBUTTON flag. Take this example, modified from the LSL wiki at http://wiki.secondlife.com/wiki/LlTakeControls.............

CODE

default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
}
run_time_permissions(integer perm)
{
if(PERMISSION_TAKE_CONTROLS & perm)
{
llTakeControls(CONTROL_ML_LBUTTON | 0, TRUE, TRUE);
}
}
control(key id, integer level, integer edge)
{
integer start = level & edge;
integer end = ~level & edge;
integer held = level & ~edge;
integer untouched = ~(level | edge);
llOwnerSay(llList2CSV([level, edge, start, end, held, untouched]));
}
}


You ought to be able to toss in an if test to see that the button was actually clicked and then use the result to trigger the sit. I haven't done this myself, but sooner or later some wise person in this forum will chime in with the nuances to make it work right.
_____________________
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
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-26-2010 12:26
also if you press and hold alt while in mouselook you can move the cursor freely and right click things... and get get menus, w/o moving your mouselook focus.

not quite what you were looking for but it's helpful

oh, and I'm not sure how to capture Rolig's left click in the target object to force a sit, unless perhaps your were using emerald, and it reported both the cursor target and the click... and the object communicated back to force the sit..
_____________________
|
| . "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...
| -
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
01-26-2010 12:50
From: Void Singer
oh, and I'm not sure how to capture Rolig's left click in the target object to force a sit, unless perhaps your were using emerald, and it reported both the cursor target and the click... and the object communicated back to force the sit..

That's where my mind was headed, but I wasn't sure how to handle that little technical detail....
_____________________
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
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-26-2010 13:28
it'd definitely require an RLV enabled viewer at that level, and Emerald is the only one that I know reports any sort of cursor position reporting (none of the LL viewers do, that's for sure)

the bullet method MIGHT work(left click fires bullet, which triggers the object), but I think it'd still require RLV to force the sit.
_____________________
|
| . "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...
| -