Author Topic: Secondary Action?  (Read 1314 times)

 I've returned!
Ok so I made the weapon from tf2 the demoman's weapon the sticky grenade launcher. So I made the models and did a little scripting like with the particles and stuff thats all I know lol. I was wondering how to make it so you can shoot like 6 grenades then when you right click you blow them up, I think it mabey this

Code: [Select]
%vector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector,(%projectile.muzzleVelocity+getRandom(-30,30)));
%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;
};

but then again I suck at scripting, so any tips or hints?

Oh I see what you did there. You think that if you just rock up asking for code to do something, people will tell you to work it out yourself. But now you're trying to work around this by pasting some 100% completely irrelevant and useless code so that people will go and fix it as they do. Smart.

Either way, the code is basic projectile firing code. It won't launch mines and then blow them up when you right click.

Lol I knew with in minutes you would be all over me also I didnt know that that was a irrelevant code, I said that I sucked at scripting, but thanks anyway.
« Last Edit: July 01, 2008, 11:29:38 PM by Lance »

Its pretty obvious that code is irrevelant, unless you are seriously that bad at scripting...

OMG how did you know!

Its pretty obvious that code is irrevelant, unless you are seriously that bad at scripting...

Exactly and Lance just look at a weapon like the katana it has a secondary function.

errrr....katana is a bad example, it has the tendency to break other things.  I'd go with the portal gun, but that has allot of code to filter through to find the right piece.

Ya that's why I said katana even though it is really buggy.

Check out the flak cannon. I think I did it quite neatly.

Forgot about that one.

Dual Guns in Manual mode?

Thx space but I gots some help :)