AssaultCube Reloaded Forums

Full Version: Coded the 45 pistol
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Ok, guys I coded the 45 pistol (using the USP as the model for now)... it has 50 damage or something from 36 damage so it's a two shot kill but I changed its recoil to 60 from 48... I don't know if those were the correct ones but whatever.... Big Grin it works. I only did it for Linux, and my Linux computer is bad at playing ACR so it's a bit tricky to test out though...

Ok so I think 60 for recoil is pretty good but 50 for damage is too low... I end up having to hit the guy three or four times to kill but the recoil is so huge I can't even place the shots... I'll try increasing it to 60 damage....

Ok 60 damage does the trick... 2 body shots is a kill. Believe me, this gun is balanced... It's really difficult even lining up the 2 shots because of the massive recoil. I hope the 1911 would have really good sights because it really needs it (the USP sights sucked because it wasn't long range enough and the Sig sights suck because they are too difficult to see Tongue) but this could have potential to be a very good pistol.

This is the damage/recoil code:

{ "pistol2", S_PISTOL, S_RPISTOL, 1400, 90, 60, 24, 90, 17, 0, 0, 90, 90, 9, 7, 8, 6, 4, 50, 70, 70, 2, false},

For some reason it lists the number of magazines I have with me as 27 or something. If only soldiers could carry that much in real life Big Grin .

Now I'm just waiting for xdEpicZombie to come up with a decent 1911 model and we're all set!

I have pics now!

At 5.2 meters rapid fire:
[Image: 52M_zpse61c546d.png]

At 11.2 meters semi-rapid fire:
[Image: 112M_zps4c5c7dbe.png]

So spraying and praying is not good with this pistol. Slow fire it's all one hole so it's actually accurate it is just the recoil.

Stats sound good! Haven't personally fired a M1911 yet (I know, what type of American gun nut doesnt shoot one?), but the recoil sounds like a wallop.

Nice testing though! If it were me, I'd probably stop at the 2-shot kill line and not mess around too much with the recoil. But hey, it seems to work out just fine!
Yeah I had to keep the recoil somewhat high in order to balance the game. At close range though the pistol is beastly because you can fire pretty quickly and most of the shots will hit their target. Basically if you love firing rounds as fast as you can click your mouse the p226 is better but if you value accuracy more than the 1911 is the way to go.

Realistically, I have never fired the 1911, but based on what other people say the 45 is not as bad as people say it is. The 1911 should generally have the same recoil as a Glock 19 because the 1911 is heavier and absorbs recoil while the small and light Glock does not. p = mv, as some people say.

Ruler501, I did the following:

enum {

struct pistol : gun
pistol(playerent *owner, int weap) : gun(owner,weap) {}

struct p226 : pistol
p226(playerent *owner) : pistol(owner, WEAP_PISTOL) {}

struct m1911 : pistol
m1911(playerent *owner) : pistol(owner, WEAP_PISTOL2) {}

(for akimbo)
if(w->selectable() || w==curweapon || ((w->type==WEAP_PISTOL || w->type==WEAP_PISTOL2) && player1->akimbo))

In weapon::equipplayer
pl->weapons[WEAP_PISTOL] = new p226(pl);
pl->weapons[WEAP_PISTOL2] = new m1911(pl);

Commented out the pistol constructor
// pistol
//pistol::pistol(playerent *owner) : gun(owner, WEAP_PISTOL) {}

default: secondary = WEAP_PISTOL; break;
case WEAP_RPG:
secondary = nextsecondary;

const int gungame[] = {
WEAP_HEAL, // nuke after killing with this

{ "pistol2", S_PISTOL, S_RPISTOL, 1400, 90, 60, 24, 90, 17, 0, 0, 90, 90, 9, 7, 8, 6, 4, 50, 70, 70, 2, false},

I did this just by glancing at the code, so there are probably a ton of other dependencies I didn't see, also the akimbo thing is all messed up. I personally would like to just get rid of all that akimbo crap and focus on realism, but otherwise it would be a major pain in the butt.

Anyways, this code is really messed up... it needs to have a better structure so that weapons could be more easily added. Right now it seems like almost all of the pistol code was only coded with one pistol in mind and the RPG is still labeled the crossbow... Also a lot of the tricky parts don't have documentation so it is even harder to understand the code.
I've commented before on the lack of documentation. If I ever have time(and maybe if I try to redo the system) I'll add it in.
The system was written to just use what was already there I believe so it is not too easy to expand. I'd love to change it to be more easily expandable(check a mod directory for files first and allow servers to serve new files for mods), but I'm not sure if it's even possible to implement. This and a bug fix I've been meaning to get done for a while are my current priorities.
I have the model but its a bit glitchy.It will be ready soon.Also I thoought that You could code a pump-action shotgun.Basically the firerate would be slower,damage bigger.For the model I have Mossberg 590 Big Grin
Dedicated to Mossy? lol

The original shotgun in AC had pump animation
LOL me and Ruler501 are working on getting a dynamic weapon system that'll make it easier to add more weapons in the future. Right now the akimbo only works with one specific pistol so we're trying to make it independent of the specific weapon (it would theoretically even work with assault rifles, shotguns, whatever). Once we get that down adding the 45 pistol would work without bugs. However, what I coded right now actually works with akimbo somewhat so that's a surprise.
In the latest copy on the dynamicsystem branch akimbo is no longer it's own class and has instead been moved into gun. The structs for assault rifle, m16, ak47, pistol, and subgun have also been merged now.
All of this code talk....

Guess comp. sci/programming aint for me
@DeltaStrikeOp I lessened the recoil a lot. I also increased the magazine size to 8+1 (with Wilson combat magazines). I figured that the magazine size is so small and you only have 2 extra mags so you'll run out of ammo anyway so might as well make the pistol have less recoil (I was annoyed by the huge recoil). However the delay time is higher for the 45 so you can't fire as fast as the 9mm.
Pages: 1 2 3 4 5