|
Mandy Marseille
Registered User
Join date: 13 Oct 2006
Posts: 30
|
01-05-2008 11:26
Hi, I have an overweight zeppelin, it weighs. 13.500 Lindograms (llGetMass()) since the balloon parts are made of sculpties that can't have a hole in them. It seems that neither llApplyImpulse nor llMoveToTarget nor llSetBuoyancy | llSetForce can lift it / make it climb up. llGroundRepel and the now (I guess) obsolete llSetHoverHeight's not good. (I disabled the VEHICLE_HOVER_* things, because I want it to be able to fly higher than 100 m.) Setting the linear_motor vector's Z component to the max. 30 m/s doesn't work either. If I replace the sculpt parts with hollow spheres the weigh lessens to as low as 650 Lgs and the thing flies nice. But with that... the design of the zeppelin is lost. I tried to use even extreme values, to no avail.  If anyone has a solution or a workaround... I would be happy to read about it.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
01-05-2008 11:39
I'm not quite with you here - using the vehicle linear motor shouldn't depend on mass, that's one of the reasons it's great. Either you've uncovered a bug or there is sort of parameter issue or the design somehow locks the thing to the ground or.... I would suggest pasting in the vehicle parameter calls that you use.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Mandy Marseille
Registered User
Join date: 13 Oct 2006
Posts: 30
|
01-05-2008 12:00
I highlighted the parts... I //-d the apply impulse that worked fine for lighter object (light a magic carpet). But now, with the linear motor Z parameter even a light prim won't climb.
The vehicle's base is from the wiki balloon.
InitVehicle() { // uniform linear friction llSetVehicleFloatParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, 5 ); // uniform angular friction llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 10 );
// linear motor llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 3 ); llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 );
// angular motor llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 2 ); llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 10 );
// hover llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 4.5 ); llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.8 ); llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 1000 ); llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0. );
// no linear deflection llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0 ); llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 5 );//was 5
// no angular deflection llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0 ); llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 5 ); // no vertical attractor llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1 ); llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 3 );
// no banking llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 0 ); llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.7 ); llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 5 );
// default rotation of local frame llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> );
// remove all flags llRemoveVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP | VEHICLE_FLAG_HOVER_WATER_ONLY | VEHICLE_FLAG_LIMIT_ROLL_ONLY | VEHICLE_FLAG_HOVER_TERRAIN_ONLY | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT | VEHICLE_FLAG_HOVER_UP_ONLY | VEHICLE_FLAG_LIMIT_MOTOR_UP ); llSetBuoyancy(.97); } default { state_entry() { llPassCollisions(TRUE); llSitTarget(<0.6, 0.03, 0.20>, ZERO_ROTATION); llSetVehicleType(VEHICLE_TYPE_BALLOON); InitVehicle(); } changed (integer change) { if (change && CHANGED_LINK) { key ki = llAvatarOnSitTarget(); if (ki) { llSetStatus(STATUS_PHYSICS, TRUE); llRequestPermissions(ki,PERMISSION_TAKE_CONTROLS); } else { llSetStatus(STATUS_PHYSICS,FALSE); llSetRot(ZERO_ROTATION); llReleaseControls(); } } } run_time_permissions(integer perm) { if (perm) { llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_UP | CONTROL_DOWN | CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT, TRUE, FALSE); } } control(key id, integer down, integer new) { integer pressed = down & new; integer held = down & ~new; integer released = ~down & new;
vector angular_motor; vector linear_motor; if (down & CONTROL_FWD) { linear_motor.x=20.; } if (down & CONTROL_BACK) { linear_motor.x=-12.; } if (down & CONTROL_UP) { // llApplyImpulse(<0.,0.,5*llGetMass()>,FALSE); linear_motor.z=20.; } if (down & CONTROL_DOWN) { // llApplyImpulse(<0.,0.,-5*llGetMass()>,FALSE); linear_motor.z=-12.;
} if (down & (CONTROL_RIGHT|CONTROL_ROT_RIGHT)) { angular_motor.z-= PI; } if (down & (CONTROL_LEFT|CONTROL_ROT_LEFT)) { angular_motor.z+= PI;
} //if (pressed & CONTROL_ROT_RIGHT) doRotate(-45); llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, linear_motor); llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION,angular_motor); } }
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
01-05-2008 12:02
This may be a silly question, but how many prims is it?
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Mandy Marseille
Registered User
Join date: 13 Oct 2006
Posts: 30
|
01-05-2008 12:06
the above script wouldn't raise my carpet now (1 prim) That's why I started to use the llApplyImpulse.
The final zeppelin is 14 prims. (10 + 4 poseballs) You can see it inworld, if you have a bit of time.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
01-05-2008 12:12
Well, it won't now, you've set the buoyancy to 0. You might be able to shove it upwards with llApplyImpulse, but that's not a good idea for a vehicle as part of regular behaviour. But didn't you mentioned that you'd tried changing that in the first post?
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Mandy Marseille
Registered User
Join date: 13 Oct 2006
Posts: 30
|
01-05-2008 12:22
I think i found a solution... I don't yet know why.. but changing the BALLOON properties to AIRPLANE ( http://lslwiki.net/lslwiki/wakka.php?wakka=TutorialVehicle) solved the problem, I can use linear_motor vector's Z now. I mean.. the lines if (down & CONTROL_UP) { // llApplyImpulse(<0.,0.,5*llGetMass()>,FALSE); linear_motor.z=25.; // i will increased this to linear_motor.z=.. A LOT  } now work. And no, I couldn't use llApplyImpulse  . Because even with max force (20000 I think) it won't lift the vehicle that weighs 13.500. Thanks for pointing me into the right direction to use linear_motor instead of pushing the thing upward, this hint helped me to find out that the vehicle parameters were wrong (somewhere). But if someone wants a simple balloon/magic carpet script, she can use the one above, just un-// the two llApplyImpulse lines and decrease the angular_motor+/- -s from PI.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
01-05-2008 12:51
You shouldn't need to use llApplyImpulse with a vehicle at all, except for the odd "jump" sort of effect. It relies on energy and vehicle functions don't, and mixing the two can get things confused. For reference, here is a skeleton vehicle script that I use as a starting point quite often. As the date suggests I wrote it a couple of years ago so it may not be entirely up-to-date... but it does work, you can drop it into pretty much anything, which will then fly when you sit on it. // Shell vehicle script // Ordinal Malaprop // 2005-12-18
integer gLinearControls; integer gAngularControls;
float gLinearSpeed = 15.0; float gAngularSpeed = 2.0;
vector gLinearMotor = <0,0,0>; vector gAngularMotor = <0,0,0>;
set_base() { llSetVehicleType(VEHICLE_TYPE_BALLOON); // Any other appropriate vehicle setup commands go here // This turns off the default hover for the balloon, // so we can move up and down manually llSetVehicleFloatParam(VEHICLE_HOVER_TIMESCALE, 1000.0); llSetVehicleFloatParam(VEHICLE_HOVER_EFFICIENCY, 0.0); llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 1.0); llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1.0); llSetVehicleFloatParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, 1.0); llSetVehicleFloatParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, 1.0); }
default { state_entry() { gLinearMotor = <0,0,0>; llOwnerSay("Ready to fly"); set_base(); llSetSitText("Fly"); llCollisionSound("", 0.0); gAngularControls = CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT; gLinearControls = CONTROL_RIGHT | CONTROL_LEFT | CONTROL_BACK | CONTROL_FWD | CONTROL_UP | CONTROL_DOWN; llSetStatus(STATUS_PHYSICS, FALSE); // Sit target and camera llSitTarget(<0.3,0,0.5>, ZERO_ROTATION); llSetCameraEyeOffset(<-5,0,2>); llSetCameraAtOffset(<5,0,0>); }
changed(integer change) { // Check for someone sitting on the thing if (change & CHANGED_LINK) { key agent = llAvatarOnSitTarget(); if (agent != NULL_KEY) { llRequestPermissions(agent, PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS); } else { gLinearMotor = <0,0,0>; gAngularMotor = <0,0,0>; llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, gLinearMotor); llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, gAngularMotor);
llSetVehicleFloatParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, 1.0); llSetVehicleFloatParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, 1.0); llReleaseControls(); llStopAnimation("sit"); llSetStatus(STATUS_PHYSICS, FALSE); } } }
run_time_permissions(integer perm) { if (perm & (PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS)) { llStartAnimation("sit"); llTakeControls(gAngularControls | gLinearControls, TRUE, FALSE); llSetStatus(STATUS_PHYSICS, TRUE); set_base(); gLinearMotor = <0,0,0>; llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, gLinearMotor); gAngularMotor = <0,0,0>; llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, gAngularMotor); } }
control(key id, integer held, integer change) { // Reset the motor so there is only thrust when keys are pressed gLinearMotor = <0,0,0>; if (held & gLinearControls) { if (held & CONTROL_UP) { gLinearMotor += <0,0,gLinearSpeed>; } if (held & CONTROL_DOWN) { gLinearMotor += <0,0,-gLinearSpeed>; } if (held & CONTROL_FWD) { gLinearMotor += <gLinearSpeed,0,0>; } if (held & CONTROL_BACK) { gLinearMotor += <-gLinearSpeed,0,0>; } if (held & CONTROL_LEFT) { gLinearMotor += <0,gLinearSpeed,0>; } if (held & CONTROL_RIGHT) { gLinearMotor += <0,-gLinearSpeed,0>; } } llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, gLinearMotor); gAngularMotor = <0,0,0>; if (held & (gAngularControls)) { if (held & CONTROL_ROT_LEFT) { gAngularMotor += <0,0,gAngularSpeed>; } if (held & CONTROL_ROT_RIGHT) { gAngularMotor += <0,0,-gAngularSpeed>; } } llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, gAngularMotor); } }
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|