Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coded the 45 pistol
07-20-2013, 04:04 PM, (This post was last modified: 07-20-2013, 05:56 PM by dm.mossberg590a1.)
#1
Coded the 45 pistol
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.
Reply
07-20-2013, 11:09 PM,
#2
RE: Coded the 45 pistol
OOOOOOOH THE MANSTOPPER ITSELF IS HERE!

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!

DSO
Windows 8 fanboy =D
"Not dead, can't quit"
Reply
07-21-2013, 12:03 AM, (This post was last modified: 07-21-2013, 12:24 AM by dm.mossberg590a1.)
#3
RE: Coded the 45 pistol
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:

weapon.h
enum {
WEAP_KNIFE = 0,
WEAP_PISTOL,
WEAP_PISTOL2, ....

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

weapon.cpp
(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) {}

Entity.h
default: secondary = WEAP_PISTOL; break;
case WEAP_PISTOL:
case WEAP_PISTOL2:
case WEAP_HEAL:
case WEAP_SWORD:
case WEAP_RPG:
secondary = nextsecondary;
break;

server.h
const int gungame[] = {
WEAP_ASSAULT2,
WEAP_SNIPER,
WEAP_SNIPER2,
WEAP_ASSAULT,
WEAP_SUBGUN,
WEAP_BOLT,
WEAP_SHOTGUN,
WEAP_PISTOL,
WEAP_PISTOL2,
WEAP_RPG,
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.

[Image: name_zps459dc421.gif]
[Image: cooltext1206791925_zps58ab60b5.gif]

"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off." - Bjarne Stroustrup
Reply
07-21-2013, 12:36 AM,
#4
RE: Coded the 45 pistol
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.
Reply
07-21-2013, 06:00 AM,
#5
RE: Coded the 45 pistol
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

[Image: 3SVsNlV.png]
Reply
07-21-2013, 10:19 AM,
#6
RE: Coded the 45 pistol
Dedicated to Mossy? lol

The original shotgun in AC had pump animation

DSO
Windows 8 fanboy =D
"Not dead, can't quit"
Reply
07-21-2013, 11:06 AM, (This post was last modified: 07-21-2013, 11:06 AM by dm.mossberg590a1.)
#7
RE: Coded the 45 pistol
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.

[Image: name_zps459dc421.gif]
[Image: cooltext1206791925_zps58ab60b5.gif]

"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off." - Bjarne Stroustrup
Reply
07-21-2013, 04:05 PM, (This post was last modified: 07-21-2013, 06:18 PM by ruler501.)
#8
RE: Coded the 45 pistol
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.
Reply
07-21-2013, 08:18 PM,
#9
RE: Coded the 45 pistol
All of this code talk....

Guess comp. sci/programming aint for me

DSO
Windows 8 fanboy =D
"Not dead, can't quit"
Reply
07-21-2013, 08:45 PM, (This post was last modified: 07-21-2013, 08:46 PM by dm.mossberg590a1.)
#10
RE: Coded the 45 pistol
@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.

[Image: name_zps459dc421.gif]
[Image: cooltext1206791925_zps58ab60b5.gif]

"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off." - Bjarne Stroustrup
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)