Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Boat From Hell.....

Grace Loudon
Registered Know-it-All
Join date: 16 Dec 2005
Posts: 99
01-08-2008 22:43
Please help me before I take out a small town.

I made a boat...it is 24 prims total. The boat itself is sculptie (a leaf) but the parent prim is a regular box with the boat script inside. There is an additional poseball on the leaf and a particle effect. I will post the script I used. It worked for a whole minute exactly as it should have. I got on the boat, it worked. My partner got on the boat, it worked. I got on the boat again, it was dead in the water. I reset the script, I took the boat apart and relinked it, I removed the script and put in a new one, I reset, I recompiled, I rebuilt the parent prim completely. No luck.

I took the boat apart again and got on only the prim with the boat script in it and it worked fine. Tried to link it again - making the prim with the boat script the last to be linked, and it won't work! I'm going insane!!!! I'm a scripting novice...what the heck is wrong *runs crying and flailing her arms*

default
{
state_entry()
{
llSetSitText("Ride";);
llSitTarget(<0.3, 0.0, 0.60>, ZERO_ROTATION);
llSetCameraEyeOffset(<-5.0, 0.0, 2.0>;);
llSetCameraAtOffset(<3.0, 0.0, 2.0>;);
llSetVehicleType(VEHICLE_TYPE_BOAT);
llSetVehicleFlags(VEHICLE_FLAG_NO_DEFLECTION_UP | VEHICLE_FLAG_HOVER_UP_ONLY | VEHICLE_FLAG_HOVER_WATER_ONLY);
// remove these flags
llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_TERRAIN_ONLY
| VEHICLE_FLAG_LIMIT_ROLL_ONLY
| VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT);

// least for forward-back, most friction for up-down
llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <2, 3, 2> );

// uniform angular friction (setting it as a scalar rather than a vector)
llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 5 );

// linear motor wins after about five seconds, decays after about a minute

llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 5 );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 );

// agular motor wins after four seconds, decays in same amount of time

llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 4 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 4 );

// hover
llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0.10);
llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY,.5 );
llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 2.0 );
llSetVehicleFloatParam( VEHICLE_BUOYANCY, 1 );

// halfway linear deflection with timescale of 3 seconds
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.2 );
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 1 );

// angular deflection
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0.2 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 1 );

// somewhat bounscy vertical attractor
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.2 );
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 1 );

// weak negative damped banking
llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 3 );
llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.8 );
llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, .75 );

// default rotation of local frame
llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> );


}

changed(integer change)
{
if (change & CHANGED_LINK)
{
key agent = llAvatarOnSitTarget();
if (agent)
{

if (agent)
{
//You sit and are owner so get controls
llSetStatus(STATUS_PHYSICS, TRUE);
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);
llRequestPermissions(agent, PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS);
}
}
else
{
llSetStatus(STATUS_PHYSICS, FALSE);
llReleaseControls();
llStopAnimation("Sit";);
}
}

}

run_time_permissions(integer perm)
{
if (perm)
{
llStartAnimation("Sit";);
llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT, TRUE, FALSE);
}
}
control(key id, integer level, integer edge)
{
vector angular_motor;

if(level & CONTROL_FWD)
{
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <20,0,0>;);
}
if(level & CONTROL_BACK)
{
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <-10,0,0>;);
}
if(level & (CONTROL_RIGHT|CONTROL_ROT_RIGHT))
{
angular_motor.x += 10;
angular_motor.z -= 10;
}
if(level & (CONTROL_LEFT|CONTROL_ROT_LEFT))
{
angular_motor.x -= 10;
angular_motor.z += 10;
}
if(level & (CONTROL_UP))
{
angular_motor.y -= 50;
}

llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, angular_motor);
}

}
Taeas Stirling
Registered User
Join date: 4 Sep 2004
Posts: 74
01-09-2008 07:21
Hmmm, I wonder if one of your 24 prims is set to flexie, say a flag or sail?
Flexible is'nt allowed on physical vehicles, shuts them down every time.
Pity to, flapping sails and wings would be great.
Grace Loudon
Registered Know-it-All
Join date: 16 Dec 2005
Posts: 99
01-09-2008 07:29
Nope - nothing is flexi. Nothing is phantom, nothing has physical checked. It seems to have stopped working when we switched operators. Is it possible I am missing some line of code? I want the boat to be able to be operated by anyone.
Taeas Stirling
Registered User
Join date: 4 Sep 2004
Posts: 74
01-09-2008 08:46
Your script looks ok, and you say it works with a bare root prim. So lets assume its one of the other prims causing the issue. I know if your sculptie is animated by changing the sculp texture it will shut down physics and toss the riders. If this isnt the case I would use edit linked and pull prims off the boat one at a time till it starts working again. Could be one of your prims has become corrupted in some new exotic way :(
Grace Loudon
Registered Know-it-All
Join date: 16 Dec 2005
Posts: 99
01-09-2008 12:20
Some new exotic....?!?! But I don't wanna be new and exotic!! lol - I hate this boat with all that is within me. I'll do as you suggested - thanks much!
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-09-2008 12:52
Whenever I build an object meant for a scripted build that is more than a couple simple prims, I complete the build and take a pristene copy into my inventory. That pristene copy NEVER gets a single script added to it. EVER. Then I rez it, rename it so I never confuse the two, and start adding the scripts. There's just too much that you can change on a prim or object with a script that isn't obvious and is persistent, even after you delete all scripts. It can make things treacherous.

So I'd agree with trying the above suggestion. And I know it doesn't help in this case, but in the future you might consider the pristene copy method. Good luck!
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
01-09-2008 19:15
is the script set to not running? some times when saving it will do that,
does the poseball or particles scripts turn off physics?
_____________________
L$ is the root of all evil
videos work! thanks SL :)
Grace Loudon
Registered Know-it-All
Join date: 16 Dec 2005
Posts: 99
01-10-2008 13:52
The good news is, I haven't killed anyone. Taeas has contacted me in world and now has my boat in his hands...I'm praying. Please join me. hehe
Synthia Gynoid
PRIMAL DREAMS
Join date: 10 Jul 2007
Posts: 52
02-23-2008 09:30
From: Taeas Stirling
Hmmm, I wonder if one of your 24 prims is set to flexie, say a flag or sail?
Flexible is'nt allowed on physical vehicles, shuts them down every time.
Pity to, flapping sails and wings would be great.



I don't think this is accurate... a while back I made a sort of crab-bug thing, which I scripted as a vehicle that sort of randomly scoots around by generating its own impulse every so often. The bug included a sculpty object and about ten or twelve flexis as limbs and antennas. It works just fine as a physical vehicle... it runs around and bumps into me and looks sufficiently creepy, lol. :)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-23-2008 18:51
never tried it, but it's possible that engine physics react differently to flexis than apply impulse does...
_____________________
|
| . "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...
| -
Taeas Stirling
Registered User
Join date: 4 Sep 2004
Posts: 74
02-24-2008 00:22
Turns out grace's boat had an ornamental lamp hung overhead with 4 small barely noticable hangies that were set to flexie. Turning flexie off allowed the script to set the boat physical, and off it went. I have seen this several times with boats and flexie flags.
Its a shame to, I would love to build boats with billowing sails.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
02-24-2008 03:31


From: Flexible
Flexible prims ("flex prims";) are a client-side effect and are automatically made phantom and non-physical. However, flex prims can be linked to a solid, physical root prim and will, thus, take on those properties as well (though it's buggy).
I have certainly made physical, non-phantom, objects that include flexi bits! The advice above is important - the already flexi component needs to be added to the main linkset. Messing with the flexi properties after linking can break the physics.

I've never made any sort of actual vehicle so other gotchas may apply. :p