when i enable mouselook steering - all that happens is I lose my ability to control the boat via keys, mouselook just 'mouselooks' around while i careen into the shore

anyone point me in the right direction? hehe - literally!
thanks!
These forums are CLOSED. Please visit the new forums HERE
stupid vehicle question - mouselook? |
|
|
Trent Hedges
TrentCycle & GRAPHICA
Join date: 4 Sep 2003
Posts: 198
|
04-18-2006 07:50
Hi all - experimenting with a boat and wanted to try the mouselook controls as per the tutorials in the wiki
when i enable mouselook steering - all that happens is I lose my ability to control the boat via keys, mouselook just 'mouselooks' around while i careen into the shore ![]() anyone point me in the right direction? hehe - literally! thanks! _____________________
TrentCycle - Own the Legend. TrentCycle Callisto
TrentVend - Callisto GRAPHICA Magazine - Designer and Editor www.slgraphica.com |
|
AnkhMorpork Salsman
Registered User
Join date: 18 Apr 2006
Posts: 4
|
04-18-2006 11:09
CONTROL_ROT_LEFT - changes into CONTROL_LEFT
and CONTROL_ROT_RIGHT - changes into CONTROL_RIGHT when going into mouselook. Look in the bottom of this page in the wiki for more information. |
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
04-18-2006 15:49
The big secret of mouslook steering:
Turn on the Y and Z axis angular motors. _____________________
|
|
Trent Hedges
TrentCycle & GRAPHICA
Join date: 4 Sep 2003
Posts: 198
|
04-19-2006 08:42
The big secret of mouslook steering: Turn on the Y and Z axis angular motors. ok - sorry to be a pain - but I am still getting same results - how do i turn on those motors? can anyone post a code snip that will work to both turn them on and set the mouselook correctly? _____________________
TrentCycle - Own the Legend. TrentCycle Callisto
TrentVend - Callisto GRAPHICA Magazine - Designer and Editor www.slgraphica.com |
|
Overld Spengler
Registered User
Join date: 26 Mar 2006
Posts: 4
|
Steps to get mouse look working.
04-20-2006 09:00
There are two parts to your question. The first part is how to force mouselook when you ride the vehicle. I have found I had to put the code in two places. It is needed once in the default state, and once again when the object is rezzed in. I found that when I put the object away, it lost the mouse look property.
default { state_entry() { llForceMouselook(TRUE); } on_rez(integer start_param) { llForceMouselook(TRUE); } } Add whatever other code you need in those routines. This will force Mouselook whenever your ride the vehicle. The second part of the question is how do I steer my boat while in mouselook. I have tested it on my boat, and these parameters appeared to work well. When you configure your vehicle, I found these setting work well for a slow boat. //* Turning speed, a small turning speed is best float turnspeed = 1.5; default { state_entry() { // .... Standard vehicle parameters llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, <-turnspeed / 5, 0, turnspeed> ;llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, 0.1); llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.2); // set these flags llSetVehicleFlags(VEHICLE_FLAG_NO_DEFLECTION_UP | VEHICLE_FLAG_HOVER_WATER_ONLY | VEHICLE_FLAG_LIMIT_MOTOR_UP | VEHICLE_FLAG_MOUSELOOK_STEER); } } The following command turns on the angular motors. No need to change these settings since in mouselook they will handle all steering for you. I found that I only needed one input to drive the boat. You can add another one for reverse, but I like bumping into things! Now to move your boat forward, this would work best. run_time_permissions(integer permissions) { // Get user permissions if ((permissions & PERMISSION_TAKE_CONTROLS) == PERMISSION_TAKE_CONTROLS) { llTakeControls(CONTROL_ML_LBUTTON, TRUE, FALSE); } } Your only input to drive the board would be the Left Mouse Button, to go foward. The mouse will steer left and right for you automatically. Don't forget to request permissions from the agent before this code is run. control(key name, integer levels, integer edges) { //* fastspeed value was set at, with higher numbers giving faster performance. float fastspeed = 25.0; float move = 0.0; if (levels & CONTROL_ML_LBUTTON) { move = fastspeed; } if (move == 0) { llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ;} else { llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <move, 0, 0> ;} } This will motor the boat forward. The angular motors will handle the steering for you. Enjoy! Overld Spengler |