Author Topic: My First weapon. Up for grabs.  (Read 2294 times)

Yeah, It's heavily wip, but it's all i can do.

It's a fully functioning rifle. 75 Damage, 1 second reload.

No Animations :/

Download.



Hmm, it is another shotgun. ;D

Anyhow, it also plays the fire animation and fire sound when there is smoke and i see it is not supposed to do that...

I guess you want it to hold fire when it is cooling down?

Hmm, it is another shotgun. ;D

Anyhow, it also plays the fire animation and fire sound when there is smoke and i see it is not supposed to do that...

I guess you want it to hold fire when it is cooling down?
You scared me, for a moment I though that was a picture of

Totally not advertising your weapon. ;D
Joking, if you look quickly i understand why you are scared.

Anyhow, get someone to look at the script and fix what i mentioned.

Also, i forgot to tell you, This was originally going to be a shotgun, but as i can't use my MS3D anymore, because my key is f*cked, i can only make 1 model. :/ Also, can anyone give me the script to make it fire multiple bullets? Thanks.

I believe this is the best script for that:
Code: [Select]
function liberatorImage::onFire(%this,%obj,%slot)
{
if(%obj.getDamagePercent() < 1.0)
{
%obj.playThread(2, plant);
}
%projectile = %this.projectile; //Leave this as it is, it will automatically take the right projectile
%spread = 0.0028; //Spread
%shellcount = 9; //amount of shells that will be shot

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);
}
}

Ah. Thank you. Where about should i put that in the script?

Your weapon is basically a edit of the Gun.

Your weapon is basically a edit of the Gun.

Arn't most weapons an edit of the gun? Hurp derp.

Ah. Thank you. Where about should i put that in the script?
You should put that where your current OnFire function is situated.
Replace your current OnFire Function with mine and it should be good to go.

Thanks. I will do that in half an hour.

Arn't most weapons an edit of the gun? Hurp derp.
Not the good ones.

Don't forget, this is my first addon.

Not the good ones that are made by uber scripters will tons of time on their hands.

fix'd