Author Topic: Burst fire?  (Read 1158 times)

How to I make a weapon shoot a 3-round burst?


You can make it go through 3 'fire' states, each linked to each other.
I forgot the names of the ready, fire, activate, and reload stages.

You can make it go through 3 'fire' states, each linked to each other.
I forgot the names of the ready, fire, activate, and reload stages.

Uhm, I'll try that!

Thanks in advance!

My old glock18 weapon had burst fire thingy in it.
There's no need for seperate datablocks or fire states, you can just call onFire parent multiple times.
Here it is
« Last Edit: October 24, 2013, 12:40:19 AM by Crystalwarrior »

My old glock18 weapon had burst fire thingy in it.
There's no need for seperate datablocks or fire states, you can just call onFire parent multiple times.
Here it is

I have, no idea, what I should do really

I have, no idea, what I should do really
You could package Armor::onTrigger function and make a check for Jet key there. If a player pressed the jet key and has this weapon mounted to him, run the burst fire function which calls onFire for image three times with a schedule.

You could package Armor::onTrigger function and make a check for Jet key there. If a player pressed the jet key and has this weapon mounted to him, run the burst fire function which calls onFire for image three times with a schedule.

Uh

I am not wanting a selective fire, I am wating a burstfire all the time.

The gun itself uses ammo, ADS and so on

Uhm, I'll try that!

Thanks in advance!
I haven't made weapons for a long time.

Uh

I am not wanting a selective fire, I am wating a burstfire all the time.

The gun itself uses ammo, ADS and so on
Ohhhhhhh.
Then it will be even easier.
Try this in function yourWeaponImage::onFire(%this, %obj, %slot):
%this.schedule(50, onFire, %obj, %slot);
%this.schedule(100, onFire, %obj, %slot);
%this.schedule(150, onFire, %obj, %slot);
etc.
It MIGHT go extremely wrong and I might be full of stuff.
In that case, use states.

actually that's a really good idea crystal
the main issue being that if you have a magazine not evenly divisible by the burst or if you somehow shoot a partial burst then you might end up with negative ammo

Ohhhhhhh.
Then it will be even easier.
Try this in function yourWeaponImage::onFire(%this, %obj, %slot):
%this.schedule(50, onFire, %obj, %slot);
%this.schedule(100, onFire, %obj, %slot);
%this.schedule(150, onFire, %obj, %slot);
etc.
It MIGHT go extremely wrong and I might be full of stuff.
In that case, use states.
won't this fire it again and again and more times t'ill there's so much onfires going on at once and crash