Jump to content

Recommended Posts

Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Posted (edited)
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

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...