Jump to content

Boat script // nose lift


Sunbleached
 Share

You are about to reply to a thread that has been inactive for 1773 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello! I have a question about the vehicle (boat) script. This line allows the boat to lift its nose depending on the throttle. but something is wrong. the boat raises its nose at first gear and nothing else changes. lifting is not distributed evenly. on the other version of the boat, the nose lift angle was larger and then the distribution was uniform on all gears. Who can tell what it can be and what to change? I guess its some kind of math error made by me trying to decrease nose lift angle.

setNose(integer ang)
{
    if(ang<0) ang = 0; else if(ang>10) ang = 10; //50
    llSetVehicleRotationParam (VEHICLE_REFERENCE_FRAME, llEuler2Rot( (vehicleRot+<0,ang*0.4,0>) * DEG_TO_RAD));
}

The boat has 10 gears. Top speed is about 20 kts. Nose lift is 10 degrees.

Edited by Sunbleached
Link to comment
Share on other sites

think about what the angle can be for: type of boat,  gear, and the speed in the gear. Different types of boats behave in different ways. Calculate this in the gearbox/engine part of your script then callNose with the calculated angle

  • Thanks 1
Link to comment
Share on other sites

On 6/16/2019 at 10:48 PM, Sunbleached said:

something is wrong. the boat raises its nose at first gear and nothing else changes. lifting is not distributed evenly. on the other version of the boat

The snippet you have supplied only shows how the supplied value is used to try and set the nose angle, where you need to be looking are the points where that function is called, because the supplied parameter angle is somehow undefined, zero or less than zero in any gear other than first. 

 

I suggest do this:

Just inside the function put an llOwnerSay statement to tell you what value has been given to the function.

Just after the line clamping the supplied value to between 0 and 10, put another llOwnerSay line to say what the resultant value is.

At every point where you make a call to SetNose, put an llOwnerSay line to tell you what value is initially being passed to the function.

Also, have an llOwnerSay line that tells you each time the gear is changed what the new value is, because you are looking for what is different between one of them and the rest

Then you go through the four "Rs" - Run, Record, Review, Revise

There is a fifth R, of course, "Repeat", and pray it isn't ad infinitum.

Edited by Profaitchikenz Haiku
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1773 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...