#1 2016-05-26 17:24:05

xweert123
Member

Help Programming a Shotgun

Hello everyone.  I'm relatively new to the forum but i've been modding Tesseract for a while and i'm trying to implement a Shotgun.  The problem is that the bullets never "scatter" like they're supposed to.  I've got everything else working just fine except the scattering or anything of the sort just refuses to happen.  Could anyone be able to help me out on this?

Offline

#2 2016-05-26 22:08:33

NeoXploD
Member

Re: Help Programming a Shotgun

you want to replace or meter a new weapon?

Offline

#3 2016-05-27 11:09:17

xweert123
Member

Re: Help Programming a Shotgun

I'm trying to make a new weapon.  I have the weapon in the game and it's there, I can select it and everything.  It just won't spread or shoot multiple rays at once.

Offline

#4 2016-05-27 11:23:13

NeoXploD
Member

Re: Help Programming a Shotgun

in weapon.cpp

void shoteffects(int atk, const vec &from, const vec &to, gameent *d, bool local, int id, int prevaction)     

create visual effect from a shot
( exemple)

added case : ATK_NEW_SHOOT:

particle_splash(PART_SPARK, 200, 250, to, 0x50CFE5, 0.45f);
                particle_flare(hudgunorigin(gun, from, to, d), to, 500, PART_RAIL_TRAIL, 0x50CFE5, 0.5f);
break;

Offline

#5 2016-05-27 11:26:06

NeoXploD
Member

Re: Help Programming a Shotgun

in ai.cpp

vec getaimpos(gameent *d, int atk, gameent *e)

added case : ATK_NEW_SHOOT:
exemple

case ATK_NEW_SHOOT: aiskew = 20; break;

Offline

#6 2016-05-27 11:33:19

NeoXploD
Member

Re: Help Programming a Shotgun

and in game.h

static const struct attackinfo { int gun, action, anim, vwepanim, hudanim, sound, hudsound, attackdelay, damage, spread, margin, projspeed, kickamount, range, rays, hitpush, exprad, ttl, use; } attacks[NUMATKS] =

added

exemple

{ GUN_NEW, ACT_SHOOT, ANIM_SHOOT, ANIM_VWEP_SHOOT, ANIM_GUN_SHOOT, S_PULSE1, S_PULSE2, 700, 1, 0, 1, 1000, 30, 1024, 1, 5000, 15, 0, 0 },

Offline

#7 2016-05-27 11:34:21

NeoXploD
Member

Re: Help Programming a Shotgun

will have veiled her walk (unless the problem is that you do poura more you connect on a normal server running (I have this problem with hexahedron project) but fortunately because it'll be the antijeux ^^ you can create a weapon makes 4000 dega modifien in the code ....

Offline

#8 2016-05-27 11:48:30

NeoXploD
Member

Re: Help Programming a Shotgun

exemple possibility
5n3e.png

in video

https://www.youtube.com/watch?v=nkb16-4tZbs

Offline

Board footer