It isn't working, there's some syntax in the console log
Loading Add-On: Vehicle_Microbus (CRC:2042821337)
Add-Ons/Vehicle_Microbus/Vehicle_Microbus.cs Line: 289 - Syntax error.
>>> Some error context, with ## on sides of error halt:
//^^^%this.setNodeColor("doortrim",%stripe);
//^^}
//^}
//};
//activatePackage(Vehicle_Microbus);
package VehicleHorn
{
function Armor::onTrigger(%this, %player, %slot, %val)
{
if (isObject(%sound = %player.getObjectMount().getDatablock().hornSound) && %slot == 0 && %val))##
##
{
serverPlay3D(%sound, %player.getObjectMount().getPosition());
}
return parent::onTrigger(%this, %player, %slot, %val);
}
};
activatePackage(VehicleHorn);
>>> Error report complete.
ADD-ON "Vehicle_Microbus" CONTAINS SYNTAX ERRORS
And here is the entire paste of the Microbus CS file I'm using to test this out
datablock AudioProfile(Microbus_HornSound)
{
filename = "./carHorn1.wav";
description = AudioClose3d;
preload = true;
};
datablock TSShapeConstructor(MicrobusDts)
{
baseShape = "./microbusupdate2.dts";
sequence0 = "./root.dsq root";
sequence1 = "./t_open.dsq open";
sequence2 = "./t_close.dsq close";
sequence3 = "./l_open.dsq lopen";
sequence4 = "./l_close.dsq lclose";
sequence5 = "./r_open.dsq ropen";
sequence6 = "./r_close.dsq rclose";
sequence7 = "./s_open.dsq sopen";
sequence8 = "./s_close.dsq sclose";
};
datablock WheeledVehicleData(MicrobusVehicle)
{
category = "Vehicles";
displayName = " ";
shapeFile = "./microbusupdate2.dts";
emap = true;
minMountDist = 3;
numMountPoints = 9;
mountThread[0] = "sit";
mountThread[1] = "sit";
mountThread[2] = "sit";
mountThread[3] = "sit";
mountThread[4] = "sit";
mountThread[5] = "sit";
mountThread[6] = "sit";
mountThread[7] = "sit";
mountThread[8] = "sit";
maxDamage = 300.00;
destroyedLevel = 300.00;
energyPerDamagePoint = 160;
speedDamageScale = 1.04;
collDamageThresholdVel = 20.0;
collDamageMultiplier = 0.02;
massCenter = "0 0.38 0.4";
//massBox = "3 3 3";
maxSteeringAngle = 0.9785; // Maximum steering angle, should match animation
integration = 4; // Force integration time: TickSec/Rate
tireEmitter = VehicleTireEmitter; // All the tires use the same dust emitter
// 3rd person camera settings
cameraRoll = false; // Roll the camera with the vehicle
cameraMaxDist = 10; // Far distance from vehicle
cameraOffset = 4.9; // Vertical offset from camera mount point
cameraLag = 0.0; // Velocity lag of camera
cameraDecay = 0.75; // Decay per sec. rate of velocity lag
cameraTilt = 0.3;
collisionTol = 0.1; // Collision distance tolerance
contactTol = 0.1;
useEyePoint = false;
defaultTire = MicroBusWheelTire;
defaultSpring = jeepSpring;
//flatTire = jeepFlatTire;
//flatSpring = jeepFlatSpring;
numWheels = 4;
// Rigid Body
mass = 370;
density = 5.0;
drag = 1.6;
bodyFriction = 0.6;
bodyRestitution = 0.6;
minImpactSpeed = 10; // Impacts over this invoke the script callback
softImpactSpeed = 10; // Play SoftImpact Sound
hardImpactSpeed = 15; // Play HardImpact Sound
groundImpactMinSpeed = 10.0;
// Engine
engineTorque = 3500; //2500; // Engine power
engineBrake = 500; // Braking when throttle is 0
brakeTorque = 4000; // When brakes are applied
maxWheelSpeed = 30; // Engine scale by current speed / max speed
rollForce = 100;
yawForce = 100;
pitchForce = 100;
rotationalDrag = 0.2;
// Advanced Steering
steeringAutoReturn = true;
steeringAutoReturnRate = 0.9;
steeringAutoReturnMaxSpeed = 10;
steeringUseStrafeSteering = true;
steeringStrafeSteeringRate = 0.1;
// Energy
maxEnergy = 100;
jetForce = 3000;
minJetEnergy = 30;
jetEnergyDrain = 2;
splash = vehicleSplash;
splashVelocity = 4.0;
splashAngle = 67.0;
splashFreqMod = 300.0;
splashVelEpsilon = 0.60;
bubbleEmitTime = 1.4;
splashEmitter[0] = vehicleFoamDropletsEmitter;
splashEmitter[1] = vehicleFoamEmitter;
splashEmitter[2] = vehicleBubbleEmitter;
mediumSplashSoundVelocity = 10.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 5.0;
//mediumSplashSound = "";
//hardSplashSound = "";
//exitSplashSound = "";
// Sounds
// jetSound = ScoutThrustSound;
//engineSound = idleSound;
//squealSound = skidSound;
softImpactSound = slowImpactSound;
hardImpactSound = fastImpactSound;
//wheelImpactSound = slowImpactSound;
hornSound = Microbus_HornSound;
// explosion = VehicleExplosion;
justcollided = 0;
uiName = "RAF 2203 Latvija";
rideable = true;
lookUpLimit = 0.65;
lookDownLimit = 0.45;
paintable = true;
damageEmitter[0] = vehicleBurnEmitter;
damageEmitterOffset[0] = "0.0 0.0 0.0 ";
damageLevelTolerance[0] = 0.99;
damageEmitter[1] = vehicleBurnEmitter;
damageEmitterOffset[1] = "0.0 0.0 0.0 ";
damageLevelTolerance[1] = 1.0;
numDmgEmitterAreas = 1;
initialExplosionProjectile = microbuloveplosionProjectile;
initialExplosionOffset = 0; //offset only uses a z value for now
burnTime = 4000;
finalExplosionProjectile = microbusFinalExplosionProjectile;
finalExplosionOffset = 0.5; //offset only uses a z value for now
minRunOverSpeed = 2; //how fast you need to be going to run someone over (do damage)
runOverDamageScale = 5; //when you run over someone, speed * runoverdamagescale = damage amt
runOverPushScale = 1.2; //how hard a person you're running over gets pushed
isInteractive = true;
iNumZones = 4;
iZone[0] = "-5 1.9 0.6 -1.8 4.1 3.3";
iZoneScript[0] = "onLeftDoor";
iZone[1] = "1.8 1.9 0.6 5 4.1 3.3";
iZoneScript[1] = "onRightDoor";
iZone[2] = "1.72 -0.1 0.3 5 1.8 3.3";
iZoneScript[2] = "onSideDoor";
iZone[3] = "-1.6 -5.2 0.3 1.6 -3.04 3.2";
iZoneScript[3] = "onRear";
};
function MicrobusVehicle::onAdd(%this,%obj)
{
parent::onadd(%this,%obj);
VehicleSpeedCheck(%obj);
%obj.setWheelTire(0, MicrobusTire);
%obj.setWheelTire(1, MicrobusTire);
%obj.setWheelTire(2, MicrobusTire);
%obj.setWheelTire(3, MicrobusTire);
%obj.setWheelSpring(0, jeepspring);
%obj.setWheelSpring(1, jeepspring);
%obj.setWheelSpring(2, jeepspring);
%obj.setWheelSpring(3, jeepspring);
%obj.setWheelSteering(0,1);
%obj.setWheelSteering(1,1);
%obj.setWheelSteering(2,0);
%obj.setWheelSteering(3,0);
%obj.mountable = true;
%obj.playthread(0, root);
}
function MicrobusVehicle::onLeftDoor(%this, %obj, %client, %offset, %position, %vector)
{
%time = getSimTime();
if((%time - %obj.leftDoorTime) > 1300)
{
%obj.leftDoorTime = %time;
%obj.leftDoor = !%obj.leftDoor;
%obj.playThread(0, %obj.leftDoor ? lopen : lclose);
}
return 1;
}
function MicrobusVehicle::onRightDoor(%this, %obj, %client, %offset, %position, %vector)
{
%time = getSimTime();
if((%time - %obj.rightDoorTime) > 1300)
{
%obj.rightDoorTime = %time;
%obj.rightDoor = !%obj.rightDoor;
%obj.playThread(1, %obj.rightDoor ? ropen : rclose);
}
return 1;
}
function MicrobusVehicle::onSideDoor(%this, %obj, %client, %offset, %position, %vector)
{
%time = getSimTime();
if((%time - %obj.sideDoorTime) > 1300)
{
%obj.sideDoorTime = %time;
%obj.sideDoor = !%obj.sideDoor;
%obj.playThread(2, %obj.sideDoor ? sopen : sclose);
}
return 1;
}
function MicrobusVehicle::onRear(%this, %obj, %client, %offset, %position, %vector)
{
%time = getSimTime();
if((%time - %obj.rearTime) > 1300)
{
%obj.rearTime = %time;
%obj.rear = !%obj.rear;
%obj.playThread(3, %obj.rear ? open : close);
}
return 1;
}
//package Vehicle_Microbus
//{
// function Vehicle::setNodeColor(%this,%node,%color)
// {
// parent::setNodeColor(%this,%node,%color);
// if(%this.getDatablock() == MicrobusVehicle.getID() && %node $= "ALL")
// {
// %r = getWord(%color,0);
// %g = getWord(%color,1);
// %b = getWord(%color,2);
// %lowest = 1;
// for(%a = 0; %a < 3; %a++)
// {
// %val = getWord(%color,%a);
// if(%val > %highest)
// %highest = %val;
// if(%val < %lowest)
// %lowest = %val;
// }
// %average = atof(%r) + atof(%g) + atof(%b);
// %average /= 3;
// %sat = %highest - %lowest;
// if(%sat < 0.1 && %average > 0.25)
// %stripe = "0.55 0.58 1 1.0";
// else
// %stripe = "0.9 0.9 0.9 1.0";
// %this.setNodeColor("stripa",%stripe);
// %this.setNodeColor("stripea",%stripe);
// %this.setNodeColor("stripb",%stripe);
// %this.setNodeColor("strips",%stripe);
// %this.setNodeColor("doortrim",%stripe);
// }
// }
//};
//activatePackage(Vehicle_Microbus);
package VehicleHorn
{
function Armor::onTrigger(%this, %player, %slot, %val)
{
if (isObject(%sound = %player.getObjectMount().getDatablock().hornSound) && %slot == 0 && %val))
{
serverPlay3D(%sound, %player.getObjectMount().getPosition());
}
return parent::onTrigger(%this, %player, %slot, %val);
}
};
activatePackage(VehicleHorn);