Musket code

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Six_Ten

FNG / Fresh Meat
Mar 12, 2006
1,382
400
0
aztecmod.darkesthourgame.com
Moving this here since fewer and fewer people read the Coding forum any more:
http://forums.tripwireinteractive.com/showthread.php?t=39955

I'm making a musket by converting the Kar98.

What I want to happen is

player squeezes trigger:

0 seconds
weapon animation begins, flint strikes steel, there's a flash in the pan and smoke rises from pan

1 second later
bullet is fired, muzzle flash, muzzle smoke

How do I code the delay from the time the trigger is squeezed and the pan is ignited, to the bullet being fired and the muzzle flash and smoke?

So far what I have is:

0 seconds
weapon animation begins, flint strikes steel, there's a flash in the pan and smoke rises from pan, bullet is fired, muzzle flash, muzzle smoke all simultaneously.
 
Last edited:

worluk

FNG / Fresh Meat
Nov 21, 2005
2,226
85
0
what exactly is the problem?
I would assume its pretty straightforward to start the anim, then either work with calls from within the animation (like with bayo attach) or play 2 seperate animations. After the first play the effect of the flint, then play the second anim, after that spawn the bullet.
 

Six_Ten

FNG / Fresh Meat
Mar 12, 2006
1,382
400
0
aztecmod.darkesthourgame.com
The problem is in setting a delay between the time the first half of the firing sequence is triggered and the second half.

Currently everything happens at once. A Kar98 or Mosin fires everything the instant you pull the trigger. A musket has a different firing system: a pan near the trigger holds a bit of powder, which is set off at teh time the trigger is pulled. However there is a noticeable delay between that flash in the pan, and the time the main charge fires.

All I want to change now is to make a delay between the first part and the second. There is only one animation. It works now as it should: the instant the trigger is pulled the cock drops the flint against the hammer. Thats the end of the animation sequence. At that moment there is a flash and smoke in the pan. That too is okay as it is. Now what I have to do is make it so that the bullet firing, the recoil, and the main muzzle flash and smoke are all delayed for one second. (it's actyually less than a second usually, but for a start I want it to be noticeable so I can tweak the effects easily.)

YouTube - BrownBess_1.movhttp://www.youtube.com/watch?v=O16oDu6E960
 
Last edited:

worluk

FNG / Fresh Meat
Nov 21, 2005
2,226
85
0
im not sure what to say to help you.
You have to split the function that is responsible for playing the effects into 2 functions and call them either with delay (setTimer) or with callbacks from the animations.
 

knight133

FNG / Fresh Meat
Jan 30, 2011
1
0
0
musket code? Where

musket code? Where

I say this is cool but, where can I download this?