Well, I've decided that in order to balance my TDM efficiently, I need to edit the damage, spray & accuracy, and some other things about the weapons I'm using in it. I need to know if I got this all right.
I think I know how to change the damage. You have directDamage, which presumably is how much damage is applied when the projectile hits a player. You have radiusDamage, also self-explanatory, and damageRadius, which is how far out the damage reaches from the explosion.
Then, if I wanted to edit the deviance in the direction of the projectiles coming out of the weapon, I presume the code is this (just using the mac10 as an example):
function mac10Image::onFire(%this,%obj,%slot)
{
%projectile = %this.projectile;
%spread = 0.0012;
%shellcount = 1;
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) * 5 * 3.1415926 * %spread;
%y = (getRandom() - 0.5) * 5 * 3.1415926 * %spread;
%z = (getRandom() - 0.5) * 5 * 3.1415926 * %spread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%velocity = MatrixMulVector(%mat, %velocity);
For a second, while looking through the code, I thought that the bullet spread would be like the deviance coordinates from the shell casing ejecting. But I knew it just had to be more complicated than that.
So how would I increase the spread here? Would I just increase the percentage on %spread?
On weapons like the M9, where you can fire a couple shots, then reload, then fire again, how would I change how many shots you get in each "clip"?
stateName[13] = "Ammo6";
stateTransitionOnTimeout[13] = "Ammo6Ready";
stateTimeoutValue[13] = 0.54;
stateFire[13] = true;
stateAllowImageChange[13] = false;
stateSequence[13] = "Fire";
stateScript[13] = "onFire";
stateWaitForTimeout[13] = true;
stateEmitter[13] = gunFlashEmitter;
stateEmitterTime[13] = 0.02;
stateEmitterNode[13] = "muzzleNode";
stateSound[13] = M9ShotSound;
stateName[14] = "Ammo6Ready";
stateTransitionOnTriggerDown[14] = "Ammo7";
stateAllowImageChange[14] = true;
stateSequence[14] = "Ready";
Would I just be able to copy this piece of code which repeats in sequential numbers, and then when I get to how many bullets I want in each clip, I would set the TransitionOnTimeout to Reload? I would then have this code repeated for x amount of times, each time increasing like "Ammo 3, Ammo 4, etc.: Then, if I wanted 9 bullets, I would set the TransitionOnTimeout to Reload on the 9th repetition, and remove the "Ammo X Ready" state.
If any of the above are incorrect, please tell me.
Thanks for the help, guys.