[WIP] China Lake Grenade Launcher

https://youtu.be/750cZKOMX2I


Nice, did you code that as well?

Yes. I took some code from the rifle I made, and then I made the pump animation myself. There’s no reload animation, so that’s less work for me.

I can’t script the grenade that gets shot out (without messing with the game’s source code), so for now it’s just a black ball.

What’d you do to make the animation? Jw.

Commented code for the pump action:

`
// The pivot of the weapon as seen on SLAB6
// The gun model and the pump model have the same pivot
private Vector3 pivot = Vector3(5.5f, 29.f, 27.f);

		// The position of the pump model
		Matrix4 pumpMatrix;
		// "readyState" is how "ready" the gun is
		// 0 right after firing, 1 when ready to fire. Can be greater than 1.
		// "mat" is the position of the gun model.
		// The pump is positioned relative to "mat" 

		// Right after firing, don't pump yet
		if (readyState < 0.3f) {
			pumpMatrix = mat;

		// Pump the gun. Offsets the pump by 12 voxels back smoothly.
		} else if (readyState < 0.5f) {
			float alpha = (readyState-0.3f)/(0.5f-0.3f);
			pumpMatrix = mat * CreateTranslateMatrix(Vector3(0.f, -12.f, 0.f) * alpha);

		// Keep the gun pumped for a bit
		} else if (readyState < 0.7f) {
			pumpMatrix = mat * CreateTranslateMatrix(Vector3(0.f, -12.f, 0.f));

		// "unpump" the gun
		} else if (readyState < 0.9f) {
			float alpha = (readyState-0.7f)/(0.9f-0.7f);
			pumpMatrix = mat * CreateTranslateMatrix(Vector3(0.f, -12.f, 0.f) * (1-alpha));

		// if readyState > 0.9f, do nothing. Keep the gun at its default position.
		} else {
			pumpMatrix = mat;
		}

		// the leftHand is at a certain offset from the pump.
		leftHand = pumpMatrix * (Vector3(8.5f, 80.f, 37.f)-pivot);
		
		// Set the pumpMatrix relative to eyeMatrix (the camera)
		pumpMatrix = eyeMatrix * pumpMatrix;
		param.matrix = pumpMatrix;

		// Draw the pump
		renderer.AddModel(pumpModel, param);

`

looks Nice. Still want a shotgun tho

Now about a Spas 12? :3

Wow!!! Nice job

wah holy moly dang it you beat me to it. I was gonna make a grenade launcher XD Amazing job so far, man. I didn’t realize how easy it would actually be to code in a grenade launcher. Just take the position of the hands in for example a rifle script, take the shotgun pump anim and boom you have it. Still, I wanna look at those scripts as this is a really impressive model :slight_smile:

You’d be amazed at what you can do. I’m thinking of making the M79 launcher, including a reload animation.

Currently I’m working on a diff sprint anim. My previous one just makes the gun model go down but I don’t want a reload anim or sprint anim. It’s annoying to have the gun models block your screen when sprinting xd

This looks really cool, amazing job man!

Tad hard to see black-ball-nades ingame IMO, think it’s possible to make it medium green like most grenades, or is it limited to black due to the implementation method? Amazing work btw!

This is awesome. Amazing work once again, Paratrooper!

You should post these mods that you make on BnS if you haven’t already, it might revive some of the modding community there. Just a thought.

Looks really darn good.

Kuunikal, I think he already has :slight_smile: It hasn’t done much though, unfortunately :frowning:

Abandoned for now. Can’t find a way to make it look good. Shifting my focus to a shotgun mod.

Aww :frowning:
Secondly, WOOT CAN’T WAIT FOR IT!

Err, anyone have an idea on which shotgun I should do next? I really wanted to make the Kel-tec KSG, but the models I made weren’t good enough. Twoday suggested the spas-12 on the previous page. Any other suggestions?

It can’t be magazine-fed (obviously) and, preferably, should not be a semi-automatic.

“Hybrids” of two+ guns are acceptable! Suggestions may include adaptations of a weapon from a different game, provided that it shoots bullets (no laser shotguns).

How about the famous 870 MCS?

I second this!