The following warnings occurred:
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.10-2ubuntu1 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/printthread.php(287) : eval()'d code 2 errorHandler->error_callback
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



AssaultCube Reloaded Forums
Coded the 45 pistol - Printable Version

+- AssaultCube Reloaded Forums (https://acrf.victorz.ca)
+-- Forum: Gameplay (https://acrf.victorz.ca/forum-3.html)
+--- Forum: Suggestions (https://acrf.victorz.ca/forum-11.html)
+--- Thread: Coded the 45 pistol (/thread-888.html)

Pages: 1 2 3 4 5


Coded the 45 pistol - dm.mossberg590a1 - 2013-07-20

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.


RE: Coded the 45 pistol - DeltaStrikeOp - 2013-07-20

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!


RE: Coded the 45 pistol - dm.mossberg590a1 - 2013-07-21

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.


RE: Coded the 45 pistol - ruler501 - 2013-07-21

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.


RE: Coded the 45 pistol - -{ET}-xdEpicZombie - 2013-07-21

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


RE: Coded the 45 pistol - DeltaStrikeOp - 2013-07-21

Dedicated to Mossy? lol

The original shotgun in AC had pump animation


RE: Coded the 45 pistol - dm.mossberg590a1 - 2013-07-21

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.


RE: Coded the 45 pistol - ruler501 - 2013-07-21

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.


RE: Coded the 45 pistol - DeltaStrikeOp - 2013-07-21

All of this code talk....

Guess comp. sci/programming aint for me


RE: Coded the 45 pistol - dm.mossberg590a1 - 2013-07-21

@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.