This is what I have, I'm trying to get ::onTrigger to fire a different projectile upon trigger 4, but the projectile only goes to the right place when %obj has velocity for some reason: (it's in a package already)
function Armor::onTrigger(%this, %obj, %slot, %val)
{
parent::onTrigger(%this, %obj, %slot, %val);
if((%tool = %obj.tool[%obj.currTool]) == nameToID(jakkHammerItem) && %slot == 4 && %val)
{
if(getSimTime() < (%obj.client.lastJakkHammerTime + %tool.image.minShotTime))
return;
%obj.client.lastJakkHammerTime = getSimTime();
%proj = nameToID(jakkHammerRangedProjectile);
%vec = %obj.getMuzzleVector(%obj.currTool);
%mastervel = VectorScale(%vec, %proj.muzzleVelocity);
%a = new Projectile()
{
client = %obj.client;
datablock = %proj;
initialPosition = %obj.getMuzzlePoint(%obj.currTool);
initialVelocity = %mastervel;
sourceObject = %obj;
sourceSlot = %obj.currTool;
};
missionCleanup.add(%a);
}
}
I think it's a velocity problem