I figured it'd be quite easy to do, and save me a lot of headache. I was right. This program calculates, or at least should, calculate the SHOOT_FORCE of a weapon using three things, its muzzle velocity, its ammo mass, and its barrel length, or more specifically the distance between the start point of the projectile and the muzzle, where muzzle velocity is calculated. I'll post the math, but it's all highschool physics. I used the kinematic equations, because that's what I know.
To get one thing out of the way, this tool is far from comeplete. I'm trying to figure out why the force is not being calculated when acceleration or
I did this because I wanted to mod in a bunch of guns into Dwarf Fortress. We'll see what I put in, but I already got several ones, including the Springfield 1861, the Brown Bess, KAR98k and the AK47. In theory, if it works for me, you should be able to do so as well. It will also accept custom inputs.
I also plan on having it directly write each entry into a text file, which should be very easy for me to do, if not time consuming. This will happen after the main features are in though.
And finally, I'll learn python and remake it in that. Visual Basic is nice and easy, but I keep having math errors in places where it wouldn't make sense.
And now, the math, taken directly from comments in my code:
' v^2 = vi^2 + 2a*x
' vi^2 = 0
' v^2 = 2a*x
' v^2/2x = a
' a*m = F
' F = SHOOT_FORCE
' v = SHOOT_MAXVEL
Example generated information:
[ITEM_WEAPON:SPRINGFIELD_EIGHTEEN_SIXTY_ONE]
[NAME:springfield 1861:springfield 1861s]
[RANGED:CROSSBOW:MINIE_BALL]
[SHOOT_MAXVEL:1148]
[SHOOT_FORCE:25112]
*Features*
Calculates acceleration and force from muzzle velocity, barrel length, and ammo mass.
Partially DONEButton to clear all text.
DONEConverts information into DF friendly values.
NextAdd calculations or just input for size.
Not yet.Exports to a .txt file
Not yet.Learn Python
Not Yet.Remake in Python
And finally, the download. Take a look, run it through Visual Studio if you want. It should be fairly legable except for its incompleteness. Oh and it's in visual basic. It's the one language I know very thoroughly, and I figure why not just make really small programs in that instead of some complicated language like C, where I'd have to definitely reinvent the wheel several times.
https://www.dropbox.com/s/vk7a4svid451q86/DF%20RWG%20Release.zip?dl=0The only things I would say last, is that I debugged it, and everything seemed to be working with my several random inputs, and that this isn't the source code. I can upload the source with the executible inside of it, but I didn't because I figured some people would be a bit lost on that, and I don't want to upload twice. If there is demand for it, I'll post it.