Jump to content
Sunbleached

Airplane does not fall / Script

Recommended Posts

Posted (edited)

Hello! how to make the plane begin to fall in accordance with the throttle (or speed)? the lower the gear, the faster the plane begins to fall, but with a certain gear, for example, a 50% fall stops. I tried due to gravity, but I did not see any aircraft with gravity greater than 1. and is it possible to set gravity using a script?

I don’t know how such a mechanism works in modern airplane scripts, and scripts I have come across such an effect is missing. and the plane in zero throttle just freezes in the air and even flies backwards when reversed!

Also, the plane takes off right even in first gear. how to make it take off at a certain speed and also fall at a certain speed, should it be the same action or two different?

Edited by Sunbleached

Share this post


Link to post
Share on other sites
Posted (edited)
3 hours ago, Sunbleached said:

is it possible to set gravity using a script?

Yes, with llSetPhysicsMaterial, but that's not what you want to do with a vehicle.  I'd suggest varying VEHICLE_BUOYANCY in llSetVehicleFloatParam, perhaps.  Actually, I'd suggest sticking with one sort of project long enough to get a decent feel for how to write scripts that all relate to a theme (vehicles, teleporters, color changers, .... )  You've been bouncing around daily from one project to another and not writing many of your own scripts.  It's an inefficient way to learn LSL.

Edited by Rolig Loon
typos, of course
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)
3 hours ago, Rolig Loon said:

Actually, I'd suggest sticking with one sort of project long enough to get a decent feel for how to write scripts that all relate to a theme (vehicles, teleporters, color changers, .... )  You've been bouncing around daily from one project to another and not writing many of your own scripts.  It's an inefficient way to learn LSL.

haha well, it only seems that way, I am multitasking, I can do several projects at once.

for example i work on this airplane since '18

And thank you for answer!

Edited by Sunbleached

Share this post


Link to post
Share on other sites

The airplane's descent will be a function of it's weight, it's drag, and the lift from the wings, provided it is above the stall speed, but there is also the elevator inputs. If you point the nose down it will start to descend, and increase airspeed unless the throttle is reduced, if you point the nose up it will reduce the descent rate but tend to stall unless throttle input is increased. If your script does not handle elevator controls, ie your climb or descent rate is purely a function of the up and down arrow keys adjusting the throttle, then Rolig's suggestion is the one I'd tend to use, but in my own experience, buoyancy can be very sensitive. You're best way to experiment with it is probably to make a balloon with a script where you vary the buoyancy according to the up and down arrows. Once you've got that working, you can then try adding it to the plane.

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

@Rolig Loon @Profaitchikenz Haiku Thank you for your answers! Well i played with buoyancy, but no effect, no matter what i set it - from 0 to 1, 0.1, 0.01, 0.5 whatever absolutely no effect... it still flies like in a piece of jelly.

here my parameters, please advise?

    llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_TIMESCALE, 1.50);
    llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 10.0);
    llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, 1.20);
    llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.60);
    llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 1.00);
    llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 0.50);
    llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 1.00);
    llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 1.00);
    llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.20);
    llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 2.70);
    llSetVehicleFloatParam(VEHICLE_BANKING_MIX, 0.70);
    llSetVehicleFloatParam(VEHICLE_BANKING_EFFICIENCY, 1.00);
    llSetVehicleFloatParam(VEHICLE_BANKING_TIMESCALE, 2.00);
    llSetVehicleFloatParam(VEHICLE_HOVER_HEIGHT, 0.00);
    llSetVehicleFloatParam(VEHICLE_HOVER_EFFICIENCY, 0.50);
    llSetVehicleFloatParam(VEHICLE_HOVER_TIMESCALE, 1000.0);
    llSetVehicleFloatParam(VEHICLE_BUOYANCY, 1.00); // <<< tried from zero to hero - no effect!!
    llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, <10.0, 10.0, 10.0>);
    llSetVehicleVectorParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, <20.0, 20.0, 20.0>);
    llRemoveVehicleFlags(-1);
    llSetVehicleFlags(VEHICLE_FLAG_LIMIT_ROLL_ONLY);

edit: It seems the matter is in the script itself. This is a special script for the seaplane and it is not quite ordinary. 4 different states on it.
on water, above water, on ground, above ground... will continue digging

Edited by Sunbleached

Share this post


Link to post
Share on other sites

Try with a balloon and experiment with both +ve and -ve buoyancy values. The reason for not trying with your existing script is to reduce the number of variables to simply 1 and thereby gain a better understanding of the parameter you are experimenting with.

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)
34 minutes ago, Profaitchikenz Haiku said:

Try with a balloon and experiment with both +ve and -ve buoyancy values. The reason for not trying with your existing script is to reduce the number of variables to simply 1 and thereby gain a better understanding of the parameter you are experimenting with.

Thank you! i found the reason, this lines affected buoyancy

    if(throttle)
    {
         llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <fwd*(throttle/100.0),0,0>);
         llSetVehicleFloatParam(VEHICLE_BUOYANCY, 1.0 );
    }
    else llSetVehicleFloatParam(VEHICLE_BUOYANCY, 0.8 );

it remains to understand what they are doing?

EDIT: it seems on 0 throttle buoyancy was 0.8 and at any other throttle it always was 1.

Edited by Sunbleached

Share this post


Link to post
Share on other sites

if anyone is interested. made just such a system and now you can set the value of buoyancy for each throttle separately. It works nicely!

if (throttle==0) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 0.00 );
if (throttle==10) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 0.25 );
if (throttle==20) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 0.45 );
if (throttle==30) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 0.65 );
if (throttle==40) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 0.75 );
if (throttle==50) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 0.85 );
if (throttle==60) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 0.95 );
if (throttle==70) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 1.00 );
if (throttle==80) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 1.00 );
if (throttle==90) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 1.00 );
if (throttle==100) llSetVehicleFloatParam(VEHICLE_BUOYANCY, 1.00 );

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...