Black Powder Guns adds muzzle-loading firearms to the Toolset. It is intended for builders who want to include guns but don't want to make them a major part of the adventure. The package includes:
VERSION 1
guns_core.hak -- the core of the system, including models and scripts
guns_blueprints.erf -- all blueprints are included in this hak, so that the system will be customizable. The samples include important variables, without which the scripts won't work: see the documentation.
guns_readme.txt and guns_documentation.txt Everything you want to know, and more.
Add guns_core.hak to your hak folder and your module, then import guns_blueprints.erf into your module. Be sure to set gun_mod_def_equ as your OnPlayerEquipItem script under Events. You'll then find guns and ammunition in the Toolset.
Version 1 does not overwrite any models used in any version of NWN or CEP to date, and should be fully compatible with them.
VERSION 2: adds sling-based pistols, which can be used one-handed.
Includes guns2_core.hak and guns2_blueprints erf, with documentation. This version also includes a separate erf file, guns2_v1_to_v2, which will add pistols to your blueprints without overwriting version 1 guns or ammunition which you may have customized.
Be sure to set gun2_mod_def_equ as your OnPlayerEquipItem script under Events. This script revision adds support for sling-based pistols.
Version 2 overwrites the "Frost bullet" visual effect, but should otherwise be compatible with NWN and CEP. It uses the sling animation for pistols.
***********************************
The Black Powder Guns system was inspired by D20 Modern (http://nwvault.ign.com/View.php?view=Modules.Detail&id=5355): if this comparatively simple hak interests you, try the D20mm team's much more flexible system.
NOTE: if you are adding the Black Powder Guns system to a CEP 2.1 module, please install the unofficial CEP21ItemActivate package included in these packages. This addresses a bug with tag-based scripting in CEP 2.1, corrected in CEP 2.2.
***************************************
December 20 2008: I have uploaded a corrected version of the hak files for both versions. The new version addresses problems with guns or ammunition purchased from merchants, and also corrects an error which allowed crossbows to fire gun ammunition.
I've got some suggestions for you. First of all, why not make the smaller guns like the blunderbuses for instance be based on the light crossbows? Secondly, I'd like to point out that the sling-based pistols are not actually fired but are instead flung forwards like slings usually are making it look unrealistic. Just a few thoughts, otherwise I like it. _________________________ CW
Posted by C at on02/18/09
Excellent work! I think that the 19th century weaponry is a good addition to NWN and I love the way that you've designed it. However, what's preventing the final 2.5 on the vote is one little glitch: after you fire the last shot in the bullet stack, when you fire again, you fire a crossbow bolt (if one's valid) just before unequipping the gun. I was thinking on editing the script but since I didn't write it (it would be difficult for me to know how to edit it), would you please post an answer? Apart from that little thing, outstanding work! _________________________ CW
Posted by Raven_Blood at 12:07:38 Voted10.00
Ive been thinking about the sling animation issue for some time now. my only response would be to look at the d20 pistol animations, i never worked on doing such things before so i wouldnt know where to start on it. Though since your working with a hak file, you could change anything giving you lots of room to work with.
Posted by Mulu at 12:46:03 Voted10.00
I was thinking, if slings were replaced with hand crossbows, then the same animation would be appropriate for both hand crossbows and pistols, thus allowing a small Medieval ranged weapon and the pistol to coexist. Just a thought, I haven't actually tested the new sling based pistols yet to see what the animation looks like. I must say that Gnome Blunderbussiers look great! :D _________________________ X-INV X-COM War of the Worlds Lantan University
Posted by Raven_Blood at 10:43:04 Voted10.00
excellent work as always :] you get a 10 from me.
Posted by Gylfi at 2008-12-2012:30:51
I've posted revised hak files. Both version 1 and version 2 are included in the same download; place whichever one you're using in your hak folder, and you should be set. No revisions in module setup are needed. These new versions correct two problems, both handled through the "OnEquip" script: 1. Crossbows should no longer fire gun bullets. 2. The script now works around the game engine issue with items purchased from merchants not having their local variables. NOTE: I've addressed this by reading the first four characters in the toolset resref for weapons and ammunition, and resetting the test variables for anything labelled "gun_" or "pst_". Although the test variables are now redundant, I've kept them in place for maximum backward compatibility. Let me know how these work. If the new haks work well, I'll post revised editions of the two "version" files.
Posted by Gylfi at 2008-12-1012:40:55
piotr krizka, With the clues you've given me, I found reference on the forum to a Bioware bug which causes merchants to wipe variables on the items they sell. I've looked through the patch descriptions and haven't yet found any reference to that being fixed, so I'm guessing that's where the problem lies. Since I've tried to keep my resrefs grouped by "gun" and "pst", I'm hoping I can fix this with an OnAcquire script. I may not be able to get to it this week, but that's high on my list!
Posted by piotr at 11:09:14 Voted10.00
Gylfi Gangler, In fact it seems that the items coming from a shop inventory are not affected by your OnEquip script. (If the same items (guns and ammunition) are taken from the floor, or from a box or a crate, for example, then the script works, exepted that there are still the problems I reported in my last comment. Also, if I try to use bullets i've bought from the shop with one of the guns I've taken on the floor (or crate, or box...), then they're considered "wrong ammunition". Also, players do not seem to load the ammunition from shop to ammunition slot. Thank you for your hardwork :) I hope all will be perfect soon.
Posted by Gylfi at 2008-12-1008:29:03
piotr krizka, I think I understand what's going on with crossbows loading bullets, and I'll work on it. The problem is that while my script prevented player characters from loading inappropriate ammunition, when the game engine automatically reloads it can override that. Although my script did indeed kick in to unload the inappropriate ammunition, the game engine kept on reloading it; so the result was weapons firing "straight from inventory." I think what I need to do is just make loading the wrong ammunition trigger unequipping the weaon. Tell me more about the shop inventory problem. I wouldn't have expected that to interfere with my OnEquip script -- unless players are loading directly from shop to ammunition slot? I need to fix this. Thank you again for continuing to report these issues!
Posted by piotr at 08:57:25 Voted10.00
Ok. I tested the two versions and both of them are working. (I personally prefer the first one only based on crossbows, but it's just my own opinion and the second one is also a good one since you can use a torch with your pistol) However there are still little problems remaining : -Even with the last script correction, you can still use bolts with the guns (only if the bullet/bolt slot is empty and if you have bolts in your inventory.(That is quite vicious...)) -If you have a crossbow, you can also use bullets with it, then it just fires like a gun ! I also understood what was happening in my mods : In fact I included guns and bullets in a shop inventory, that is why the script that prevents you to use bolts with a gun didn't work at all in these mods. So there is no compatibility problem with other haks and so on. Good luck !