Bay 12 Games Forum

Dwarf Fortress => DF Modding => Topic started by: Urist McFluffles on May 12, 2015, 12:35:14 am

Title: Modding Ranged Weapons
Post by: Urist McFluffles on May 12, 2015, 12:35:14 am
So basically i'm trying to add a new gun to the game but every time I try using it in adventure or fortress mode the dwarves either don't pick it up or it says "you have nothing left to fire"

Spoiler (click to show/hide)

Spoiler (click to show/hide)
Title: Re: Modding Ranged Weapons
Post by: Propman on May 12, 2015, 12:41:23 am
For one thing, the ammo class for your bullet is still an arrow, while your gun is specified to fire rounds. Change it to [CLASS:ROUND].
Title: Re: Modding Ranged Weapons
Post by: Delioth on May 18, 2015, 01:46:55 am
While you're at it, pop the MAXVEL up from that. It'll be a small thing at a small velocity- probably won't do so well (Or at least not as well as a gun should do. You might find it fine anyways, this is more of an opinion thing.)
Changing it to CLASS:ROUND should fix your ammo problem, though.
Title: Re: Modding Ranged Weapons
Post by: Aseaheru on May 20, 2015, 10:37:09 am
Heres a question that sort of ties into this: Is it possible to have a ranged weapon with a magazine, which when fired requires a longer reload?

And if so, if there is a way to allow the welder to load individual rounds into it when needed?
Title: Re: Modding Ranged Weapons
Post by: Propman on May 20, 2015, 11:23:41 am
I think at one point there was a DFhack script which could control the rate of fire for specific weapons, though I'm not sure what ever became of it. How well it would simulate these aspects is something I do not know, but the closest thing you get to reloading times in the raw is modding recovery times, which work for each individual firing, making them poor at simulting automatic weapons.
Title: Re: Modding Ranged Weapons
Post by: Aseaheru on May 20, 2015, 11:35:59 am
Well, lets hope that the Great and Powerful Toady eventually decides to add some variables that allow that. Possibly by nerfing the crossbow's speed and adding in a repeating crossbow? I dunno.
Title: Re: Modding Ranged Weapons
Post by: scamtank on May 20, 2015, 11:56:25 am
the closest thing you get to reloading times in the raw is modding recovery times, which work for each individual firing, making them poor at simulting automatic weapons.

Well, no. Recovery times only apply to melee attacks.
Title: Re: Modding Ranged Weapons
Post by: Aseaheru on May 20, 2015, 12:08:27 pm
 So, as soon as you fire, you can shoot again, or does the shot already fired need to get removed from play first?

Because not it is looking as if Toady needs to add three or four new tags to ranged weapons...
Title: Re: Modding Ranged Weapons
Post by: Propman on May 20, 2015, 12:53:41 pm
the closest thing you get to reloading times in the raw is modding recovery times, which work for each individual firing, making them poor at simulting automatic weapons.

Well, no. Recovery times only apply to melee attacks.

Huh, through arena testing, I can confirm you are correct: changing the variables in ammo to higher or lower numbers did not effect the fire rate of two dwarves of equal skill when compared side by side and attacking a stationary target, meaning that altering it is entirely dependant on scripting.
Title: Re: Modding Ranged Weapons
Post by: Aseaheru on May 20, 2015, 01:11:10 pm
You can also tell from examples of two-melee attack ranged weaponry that are floating about in various mods...
Title: Re: Modding Ranged Weapons
Post by: vjmdhzgr on May 20, 2015, 08:49:11 pm
So, as soon as you fire, you can shoot again, or does the shot already fired need to get removed from play first?

Because not it is looking as if Toady needs to add three or four new tags to ranged weapons...
When you fire in adventurer mode, and this probably applies to others firing as well, you fire the projectile instantly, and then sit still for five minutes reloading the weapon as you get brutally murdered by enemies that, when you fired, were an entire screen away.