Author Topic: My snowboard script  (Read 1354 times)

Im new to scripting so im trying to edit a script i check it off in the add-ons list as vehicle_snowboard and it wont show up in the vehicle spawn list will someone tell me what to change/add to the script
Code: [Select]
};

datablock WheeledVehicleData(snowvehicle)
{
category = "Vehicles";
displayName = "snowboard";
shapeFile = "./shapes/snowboard.dts";
emap = true;
minMountDist = 3;
   
numMountPoints = 1;
mountThread[0] = "root";


massCenter = "0 0 0";
//massBox = "2 5 1";

maxSteeringAngle = 0.85;
integration = 4;           



cameraRoll = false;         // Roll the camera with the vehicle
cameraMaxDist = 13;         // Far distance from vehicle
cameraOffset = 7.5;        // Vertical offset from camera mount point
cameraLag = 001;           // Velocity lag of camera
cameraDecay = 0.75;        // Decay per sec. rate of velocity lag
cameraTilt = 0.4;
collisionTol = 0.1;        // Collision distance tolerance
contactTol = 0.1;

useEyePoint = false;

mass = 400;
density = 5.0;
drag = 1.6;
bodyFriction = 0.6;
bodyRestitution = 0.6;
minImpactSpeed = 5;        // Impacts over this invoke the script callback
softImpactSpeed = 5;       // Play SoftImpact Sound
hardImpactSpeed = 15;      // Play HardImpact Sound
groundImpactMinSpeed    = 10.0;


engineTorque = 4000; //4000;       // Engine power
engineBrake = 600;         // Braking when throttle is 0
brakeTorque = 8000;        // When brakes are applied
maxWheelSpeed = 30;        // Engine scale by current speed / max speed

rollForce = 900;
yawForce = 600;
pitchForce = 1000;
rotationalDrag = 0.4;


justcollided = 0;

uiName = "snowboard ";
rideable = true;
lookUpLimit = 1.6;
lookDownLimit = 1.6;

paintable = true;


minRunOverSpeed    = 1;   //how fast you need to be going to run someone over (do damage)
runOverDamageScale = 15;   //when you run over someone, speed * runoverdamagescale = damage amt
runOverPushScale   = 15; //how hard a person you're running over gets pushed
};

function StaticShapeData::create(%block)
{
 %obj = new StaticShape()
 {
      dataBlock = %block;
 };
 return(%obj);
}

function ServerCmdOllie(%client)
{
%pmount = %client.player.getObjectMount();
%vec2 = %pmount.getForwardVector();
%vec2 = VectorNormalize(%vec2);
%vec2 = VectorScale(%vec2, 15);
Checkheight(%client, %pmount);
if($Pref::Server::Midollie){
%client.ollie = 1;
}
if(%pmount.getDataBlock().getname() $= "snowvehicle"){
if(!%client.ollie) return;
%vec3 = %pmount.getposition();
%client.ollie = 0;
%vec = VectorAdd(%pmount.getposition(), "0 0" SPC 10);
%vec = VectorAdd(%vec, %vec2);
%vec = VectorSub(%vec, %vec3);
%vec = VectorNormalize(%vec);
%vec = VectorScale(%vec, 30);
%pmount.setVelocity(%vec);
}else{
messageclient(%client,"","You are not on a loving snowboard.");
}
}

function CheckHeight(%client, %obj)
{
%Zspeed = getWord(%obj.getvelocity(), 2);
if(%Zspeed < 0.35 && %Zspeed > -1.5)
{
%client.ollie = 1;
}else{
%client.ollie = 0;
}
}

function ServerCmdNitro(%client)
{
%pmount = %client.player.getObjectMount();
if(%pmount.getDataBlock().GetName() $= "snowvehicle"){
if(%client.nitro){
messageclient(%client,"","You do not have that stuff charged.");
return;
}
%vec = %pmount.getForwardVector();
%vec = VectorAdd(%vec, "0 0" SPC 0.3);
%vec = VectorNormalize(%vec);
%vec = VectorScale(%vec, 65);
%pmount.setVelocity(%vec);
%client.nitro = 1;
schedule(3500,0,"Nitroit",%client);
}else{
messageclient(%client,"","You are not on a loving snowboard.");
}
}

function Nitroit(%client)
{
%client.Nitro = 0;
}

function snowvehicle::OnTrigger(%this, %obj, %triggerNum, %val)
{
   if(%val){
      if(%triggerNum == 2){
      ServerCmdollie(%obj.spawnbrick.client);
  }
   }
}

function ServerCmdToggleMidollie(%client)
{
if(%client.issuperadmin || %client.isadmin)
{
 if($pref::server::Midollie){
  $pref::server::Midollie = 0;
  messageAll('','Midollie is now disabled!');
  }else{
  $pref::server::Midollie = 1;
  messageall('','Midollie now enabled!');
 }
}
}

Does it say anything in the console when it loads?


Did you make a .dts for it...Enable in the add-on list? If those don't work I have no idea.

ya i had a model in dts format and it was checked of as "vehicle_snowboard"

Any syntax error's? Try making a new vehicle script only using the .dts to see if it is corrupt some of my models do this on occasion

so like just remake the whole script? if so im also trying to see what i can do with blender to make a skateboard so ill whip one up and work on that script then post it on this thread k?