Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Tool for making 'Ranged Weapons'.  (Read 1659 times)

alamoes

  • Bay Watcher
    • View Profile
Tool for making 'Ranged Weapons'.
« on: June 21, 2018, 11:54:07 pm »

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:

Spoiler: The Math (click to show/hide)

Example generated information:

Spoiler (click to show/hide)

*Features*

Calculates acceleration and force from muzzle velocity, barrel length, and ammo mass.  Partially DONE

Button to clear all text.  DONE

Converts information into DF friendly values. Next

Add 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=0

The 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. 
« Last Edit: June 21, 2018, 11:57:22 pm by alamoes »
Logged

alamoes

  • Bay Watcher
    • View Profile
Tool for making 'Ranged Weapons'.
« Reply #1 on: June 21, 2018, 11:54:54 pm »

Reserved. 
Logged

scourge728

  • Bay Watcher
    • View Profile
Re: Tool for making 'Ranged Weapons'.
« Reply #2 on: June 27, 2018, 03:20:16 pm »

As much as I hate to be that guy... in your post you said "I'm trying to figure out why the force is not being calculated when acceleration or" and then didn't actually finish the sentence