When you say player vehicle do you mean just a vehicle, or a player with the vehicle datablock?
If you don't already have the weapon image:
//projectile
datablock ProjectileData(YourWeaponProjectile)
{
projectileShapeName = "~/data/shapes/laser.dts";
directDamage = 10;
radiusDamage = 10;
damageRadius = 0.5;
explosion = YourWeaponExplosion;
muzzleVelocity = 200;
velInheritFactor = 0;
armingDelay = 0;
lifetime = 80000;
fadeDelay = 75000;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = true;
gravityMod = 0;
hasLight = true;
lightRadius = 3.0;
lightColor = "0.9 0 0";
};
datablock ShapeBaseImageData(YourWeaponImage) {
shapeFile = "~/data/shapes/blank.dts";
emap = true;
offset = "3.21 2.8 -0.27";
correctMuzzleVector = false;
className = "WeaponImage";
mountPoint = 0;
ammo = " ";
projectile = YourWeaponProjectile;
projectileType = Projectile;
// Initial start up state
stateName[0] = "Activate";
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "Ready";
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Fire";
stateAllowImageChange[1] = true;
stateName[2] = "Fire";
stateTransitionOnTimeout[2] = "Reload";
stateTimeoutValue[2] = 0.05;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateWaitForTimeout[2] = true;
stateSound[2] = YourWeaponFireSound;
stateName[3] = "Reload";
stateSequence[3] = "Reload";
stateAllowImageChange[3] = false;
stateTimeoutValue[3] = 0.1;
stateWaitForTimeout[3] = true;
stateTransitionOnTimeout[3] = "Check";
stateName[4] = "Check";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "Fire";
stateName[5] = "StopFire";
stateTransitionOnTimeout[5] = "Ready";
stateTimeoutValue[5] = 0.2;
stateAllowImageChange[5] = false;
stateWaitForTimeout[5] = true;
stateScript[5] = "onStopFire";
};
I your vehicle already has an on add function, scroll down to it and add the following code:
%obj.mountImage(YourWeaponImage,MountPointNumber);
If you don't already have an on add function add this at the bottom of your code:
function YourVehicle::onAdd(%data, %obj)
{
%obj.mountImage(YourWeaponImage,0);
}
Edit:
Boat much? I'm not sure how to make it work but it would involve mounting an weapon image to a mount point, now if you're trying to make cannons on a boat which I'm pretty sure you are, your gonna keep running into more problems making it shoot sideways.
Yeah if you are talking about cannons on your Galleon or whatevah ship it was, I suggest not, mounting the weapons straight would be easy, just the amount of lagg caused from firing once would be very, very painful.