Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

airplanes and border crossing

Patty Vieria
Registered User
Join date: 18 Jan 2007
Posts: 12
12-20-2007 08:12
Hello everyone,
I'm building my first plane. After 3 weeks scripting and testing(fulltime), its almost there.
This was my first big LSL portion and i have a few questions.

It looks like something like this is working, sometimes and sometimes not working?
( llGetAnimation(llGetOwner()) != "Falling Down";)


And big problems when i cross a border. I'm using VEHICLE_BUOYANCY.
No problem , if i not cros a border. When i cross a border i start falling down.

The avatar state i use another solution now. But is there something to do about the border
crossing problem?

Thanks!
Patty
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
12-21-2007 01:48
set non physical
move across border
set physical.
Patty Vieria
Registered User
Join date: 18 Jan 2007
Posts: 12
can i change this?
12-21-2007 13:58
This is the timer i use for the vehicle buoyancy.
Is there another way without sim border crossing problems?

CODE

timer()
{

// Calculate speed in knots
speed = (integer)(llVecMag(llGetVel()) * 1.94384449 + 0.5);

// Provide lift - to speed
lift = (speed/cruiseSpeed); //Lift is varied proportionally to the speed
if (lift > liftMax) lift = liftMax;
{
llSetVehicleFloatParam( VEHICLE_BUOYANCY, lift );
}
}
}


Thanks!
Taeas Stirling
Registered User
Join date: 4 Sep 2004
Posts: 74
12-21-2007 14:43
Hi Patty,
It's pretty normal to dive for a bit during a sim crossing, boats and cars do it to.
helps a lot if you cross at right angles to the sim side, angles make it tougher.
Its better if you cross as slow as possible, this gives the sims more time to hand off your stats.
Never cross in a corner, this leaves 4 sims wondering which way your going to go, and almost always crashes you.
I have found that it helps to give a little control input right after the crossing, seems to force the server to update your position.
And for help with your code, you really need to post it all. Trouble with the speed = lift scripts is that they force you to cross at speeds that arnt wise at certain times.
Patty Vieria
Registered User
Join date: 18 Jan 2007
Posts: 12
border problem
12-21-2007 15:30
Thanks for your reply Taeas!

Even i fly at 1 are 2m/s i fall out of the sky as soon i cross the border.
I have 2 borders on my parcel :(
Patty Vieria
Registered User
Join date: 18 Jan 2007
Posts: 12
12-21-2007 16:28
To get the know of the engines settings, i step from a high altitude platform with an object attached with this scripting in it.
CODE

// Lift and speed
float cruiseSpeed = 13.25; //full lift speed
float lift;
float liftMax = 0.977; // Maximum lift
float speed;

float timerFreq = 0.5;

integer fwdLast;
integer sit;
key owner;

integer calculateGroundDistance()
{
vector pos = llGetPos();
float ground = llGround(pos);
float distance = llRound(pos.z-ground);
return (integer)distance;
}

default
{
attach(key id)
{
if(id)
{
state fly;
}
}
}



state fly
{
state_entry()
{
llSetColor(<0,0,1>,ALL_SIDES);
llSetTimerEvent(0.1);

llSetStatus(STATUS_PHYSICS, TRUE);
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);

llSetVehicleType(VEHICLE_TYPE_AIRPLANE) ;


llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0.977 );



llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <11, 21, 21> );


llSetVehicleVectorParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, <1,1,1> );


// linear motor
llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, < 2, 0, 0> );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 1 );
llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 0.2 );

// linear deflection
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.2 );
llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 0.5 );

// angular motor
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION,<1,0,0>);

llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 0 );
llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.4 );

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


// no hover
llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 );
llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0 );
llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 10 );

// vertical attractor
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.1 );
llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 0.2 );

// banking
llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 1 );
llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 1);
llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 0.01 );

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

// remove these flags
llRemoveVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP
| VEHICLE_FLAG_HOVER_WATER_ONLY
| VEHICLE_FLAG_HOVER_TERRAIN_ONLY
| VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT
| VEHICLE_FLAG_HOVER_UP_ONLY
| VEHICLE_FLAG_LIMIT_MOTOR_UP );

// set these flags
llSetVehicleFlags( VEHICLE_FLAG_LIMIT_ROLL_ONLY );

llRequestPermissions(llGetOwner(),PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION);
llTakeControls(CONTROL_UP | CONTROL_DOWN | CONTROL_FWD | CONTROL_BACK | CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT, FALSE, TRUE);

}

//controls
control(key id, integer level, integer edge)
{
// Set control key values



integer yoke_fwd = CONTROL_FWD;
integer yoke_back = CONTROL_BACK;



if (level & CONTROL_FWD)
{
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION,<2.1,0,0>);
}
else
if (level & CONTROL_BACK)
{
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION,<1.9,0,0>);
}

vector angular_motor;

if (level & yoke_fwd)
{
angular_motor.y = 1.0;
}
else if (level & yoke_back)
{
angular_motor.y = 0.0;
}
else
{
angular_motor.y = -2.0;
}


//left-right

if ((level & CONTROL_RIGHT) || (level & CONTROL_ROT_RIGHT))
{
angular_motor.x = TWO_PI;
}
else if ((level & CONTROL_LEFT) || (level & CONTROL_ROT_LEFT))
{
angular_motor.x = -TWO_PI;
}
else
{
angular_motor.x = 0;
}

llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, angular_motor);

}



timer()
{

// Calculate speed in knots
speed = (integer)(llVecMag(llGetVel()) * 1.94384449 + 0.5);

// Provide lift proportionally to speed
lift = (speed/cruiseSpeed); //Lift is varied proportionally to the speed
if (lift > liftMax) lift = liftMax;
{
llSetVehicleFloatParam( VEHICLE_BUOYANCY, lift );
}

}

}


this is flying ok, but any border cross i'm falling down.
Patty Vieria
Registered User
Join date: 18 Jan 2007
Posts: 12
is there s solution?
12-23-2007 09:14
I t looks like there must be something to avoid this? There are planes that not having this problem even on the same parcel, in a corner?
Thanks!
Vivito Volare
meddler
Join date: 10 Nov 2006
Posts: 41
01-05-2008 01:05
This is a common problem. there are actually a couple of issues pertaining to this open in the JIRA. The problem stems from network communication between sims.