Realistic Ballistics?

Do you have a question about making weapon mods, or do you just need some tutorials and resources? Ask about all of that here.

Moderator: wildweasel

Locked
TristanYockell
Posts: 7
Joined: Mon Nov 05, 2007 23:16
Location: Canada

Realistic Ballistics?

Post by TristanYockell »

First things first, I take no credit for the code below, it is being used for my own personal ejoyment for my own personal modification.
It will not be released to the public and I have permission to use this from corey.
Now,
I'v got a question on how to go about doing something.
Heres what I want to do in order to balance out the shotguns in Game.

I'm going to have the primary attack of 10 pellets for example at a range of 1024 obviously. On top of the primary attack I want the gun to also eject an attack of 6 pellets up to say a range of20.

Now I know there is a way to do it with the EJECT function so that these extra pellets with only limited range wont use an extra shell.

The Problem is I have made these new attack scripts, but when I put them into the weapon code in game there are no extra short range pellets.
I feel it would make the shotguns much more realistic by making them deadly at very close range but only slightly injure at longer ranges,
instead of constantly having the same amount of overly lethal pellets the whole way.

It should be the same process as say ejecting shells or smoke, is it not?.

Heres my attack script that I made:

[PLAYER_GUNSHOT]
ATTACKTYPE=SHOT;
SHOTCOUNT=6;
DAMAGE.VAL=4;
DAMAGE.MAX=12;
ACCURACY_ANGLE=8;
ACCURACY_SLOPE=7;
ENGAGED_SOUND=SAWED1;
ATTACKRANGE=20;
PUFF=SPUFF;

And heres the weapon I tried to add it too:

[SAWED_OFF]
AMMOTYPE=SHELLS;
AMMOPERSHOT=1;
AUTOMATIC=TRUE;
SEC_AMMOTYPE=BULLETS;
SEC_AMMOPERSHOT=1;
CLIPSIZE=6;
BINDKEY=3;
PRIORITY=18;
ATTACK=PLAYER_SAWEDOFF;
SECOND_ATTACK=PLAYER_FLARE;
START_SOUND="WEAPU?";
SHOWCLIP=TRUE;
BOBBING=50%;
SWAYING=25%;

STATES(UP)=SAWD:A:1:NORMAL:RAISE;
STATES(DOWN)=SAWD:A:1:NORMAL:LOWER;
STATES(READY)=SAWD:A:1:NORMAL:READY;
STATES(ATTACK)=SAWD:A:0:NORMAL:CHECKRELOAD,
SAWD:A:2:NORMAL:SHOOT, //all b

>>>>>SAWD:A:0:NORMAL:EJECT(PLAYER_GUNSHOT),<<<<<
SAWD:A:0:NORMAL:EJECT(SSG_SMOKE1),
SAWD:A:0:NORMAL:EJECT(PLAYER_GUN3_SPARKS),
SAWD:A:0:NORMAL:EJECT(SSG_SMOKE1),
SAWD:A:0:NORMAL:EJECT(PLAYER_GUN3_SPARKS),
SAWD:A:0:NORMAL:EJECT(SSG_SMOKE1),
SAWD:A:0:NORMAL:EJECT(PLAYER_GUN3_SPARKS),
SAWD:A:2:NORMAL:KICK(0.08), //c
SAWD:E:2:NORMAL:NOTHING,
SAWD:D:1:NORMAL:NOTHING,
SAWD:A:2:NORMAL:NOTHING,
SAWD:F:3:NORMAL:NOTHING,
SAWD:G:4:NORMAL:PLAYSOUND(SAWED2),
SAWD:H:4:NORMAL:EJECT(SAWEDOFF_SHELL_SPAWN),
SAWD:G:5:NORMAL:NOTHING,
SAWD:F:4:NORMAL:NOTHING,
(Yaddy yadda......)
#REMOVE;

[/b]
User avatar
Chronoteeth
Posts: 824
Joined: Wed Jul 06, 2005 10:01

Post by Chronoteeth »

The range is extremely short, even less than the punching range. That could be a reason, the attacks arn't even going far enough to hit the enemy.
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

As far as I can tell, one unit of distance on the AttackRange property is equal to one pixel of the floor texture. Given that, 1024 seems like a logical range for a short-range pistol. Your shotgun would probably need a similar range to it.
TristanYockell
Posts: 7
Joined: Mon Nov 05, 2007 23:16
Location: Canada

Post by TristanYockell »

Ok thanks, yeah someone on another forum informed me of the same thing. I have it working now and it works quite well.
The shotguns now are deadly at close range but are pretty useless from far away, it gives it a sense of realism instead of just having the same amount of high powered pellets going forever.

I made the primary attack have 9 pellets all of which are DAMAGE.VAL=3
DAMAGE.MAX=5.5 (range 1024) not powerful enough to kill an imp point blank for example, and with a pretty wide cone of fire, as its a sawed off im working with.
Then I get the shotgun to eject 3 other pellet attacks.

first one (6 pellets) at an attack range of 350, second one (5pellets) at a range of 450, and the third (5pellets) at around 550 each seperate attack is given a slight less damage value then the previous one to simulate the loss of power over range.

Anyway it works very well, it feels alot more real now. Deffinatly makes shotguns the ultimate close quarter weapon.
Locked

Return to “Weapon Modding Help & Resources”