I've been messing around with Nekram's weapon pack again. There are only two issues I've got with it so far. One, it forces the player to change their data block based on the weapon. Everyone hates that. Secondly, although the weapons raycast and have legitimate hit detection that may work in slayer, the raycast only fire from the muzzle. That means you literally cannot hurt anyone thats in your face or close enough where the weapon clips into their body. The bullet will fire behind them, making a lot of stuff awkward and annoying when things get close and personal. I noticed that the UTE raycast weapons pack does not have this issue, but it also doesn't have the best hit detection and does not adhere to friendly fire in slayer. Gravity Cat's raycasting pack has good hit detection, but it also suffers from not being able to hit things that are up close.
I've got this add-on that causes a noise and hitmarker to pop up whenever hit detection works properly, and any weapon that this doesn't work with will not work in slayer. Nekram's does and the models for the weapons are slick, so I was hoping to get some help polishing it up for a good game. There's a CS file in the pack named NewMuzzleVelocity and i'm not sure what it does exactly. I've seen it in the Warfare pack, and the bullets don't seem to move any faster than normal. I keep hearing talk of people increasing the speed of bullets but I've yet to see proof of it. Also, when I look in the cs files for the weapons, I don't see anything for raycasting. Instead, I see this:
for(%shell=0; %shell<%shellcount; %shell++)
{
%vector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%x = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%y = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%z = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%velocity = MatrixMulVector(%mat, %velocity);
%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
}
return %p;
}
I have no idea what this is, but I see MuzzleVelocity, Projectile, and Vectors involved so I'm assuming this is how the bullets instantly hit stuff. If so, how do I get the bullets to fire from the back of the weapon so I can hit things that are in my face?