Jump to content

Need help with a vehicle's script.


lucagrabacr
 Share

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

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

Recommended Posts

There's probably a better way to do this, but here is how I (someone with no experience in vehicle scripting) would do it.

    control(key id, integer level, integer edge)    {        vector angular_motor;        vector linear_motor;        // going forward, or stop going forward        if(level & CONTROL_FWD)        {            linear_motor.x = forward_power;        }         else if(edge & CONTROL_FWD)        {            linear_motor.x = 0;        }                // going back, or stop going back        if(level & CONTROL_BACK)        {            linear_motor.x = reverse_power;        }        else if(edge & CONTROL_BACK)        {            angular_motor.x = 0;        }                        // going up or stop going up        if(level & CONTROL_UP) {            linear_motor.z = VERTICAL_THRUST;        } else if (edge & CONTROL_UP) {            linear_motor.z -= 0;        }                // going down or stop going down        if(level & CONTROL_DOWN) {            linear_motor.z = -VERTICAL_THRUST;        } else if (edge & CONTROL_DOWN) {            linear_motor.z -= 0;        }        // turning        if(level & (CONTROL_RIGHT|CONTROL_ROT_RIGHT))        {            angular_motor.x += 25;        }                if(level & (CONTROL_LEFT|CONTROL_ROT_LEFT))        {            angular_motor.x -= 25;        }                llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, angular_motor);        llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, linear_motor);            } //end control   

 

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3550 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...