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 been looking for ways to improve the hak, and intend to release an updated version after CEP 2.3 is available. There will still be limits I can't find a way around; when I change the sling animation to something more suitable, that seems to disable the ability to hold a torch or lantern in the left hand. All pistol models from the sling version are available in the crossbow version; my personal preference will be to make the crossbow version available to player characters, and reserve the sling pistols for "local color" npcs like guards. But both versions will continue to be available.
I think I've fixed the problem with local variables in the update; I find there's a bug in the Bioware programming which clears local variables in objects bought from shops. I've gotten round this by adding a subroutine which identifies guns and bullets by their tag; the local variable subroutine is still in place, to maintain backward compatibility.
I upgraded The Heroes' Stone by Poetic Colossus to use this system for my campaign, and it's worked fine. I can't imagine building or running a fantasy setting without this system in it. The author plugged a huge hole with this hak, content that until now was tragically missing. _________________________ X-INV X-COM War of the Worlds Lantan University
I extensively used this system in my Lantan University campaign. It worked very well, and was liked by the players. The only real issue was the old d20 Modern bug, where because the guns and ammo have local variables they can get broken, by say logging out while holding one, and need to be replaced. Easy enough in a DM'ed adventure.
Posted by Mirjan at 2009-06-28 15:56:55 Voted 9.00 on 06/28/09
Great pack, and great addition to any low-magic fantasy setting. It could be better with crossbow animations on sling pistols, but it`s a minor detail.
Posted by Also Copy at 2009-05-11 20:51:52 Voted 10.00 on 05/11/09
I've got to say this looks great to me. I haven't played with this extensively, but so far the only thing that bugs me is the aforementioned sling animation with the pistols.
Posted by C Writer at 2009-03-25 14:04:20 Voted 9.75 on 02/18/09
Even I would gladly sacrifice slings for correctly working pistols. I mean really, why would someone use a sling when you have more powerful weaponry that is still usable by even wizards and sorcerers? No offence sling users...
By the way, I can't wait for the scipt update to solve the problem with a single bolt being fired after the last bullet is - it will make the system look more genuine. Not that I'm rushing you, take your time! Still, the work that's been done is outstanding! _________________________ CW
Posted by dukemagus at 2009-03-16 08:29:02 Voted 9.25 on 03/16/09
great addition! i pray for your sucess in makin this the ultimate firearm MOD in NWN
Given that halflings can use darts and shuriken as their throwing weapons, I suspect that anyone who wants to add pistols to the game is probably willing to sacrifice slings to get the right animation. I know I am. I'd recommend to just make it another version so people can have muskets and slings, or muskets and pistols, as they prefer. d20 modern changed the animations, so it can be done, it's just all or nothing for that weapon type. _________________________ X-INV X-COM War of the Worlds Lantan University
I'm continuing to work on this project, and hope to improve it, but I can't yet put a time frame on that. The sling animation is indeed a problem; I don't like it for pistols, but it does have the advantage of making them a one-handed weapon (allowing a torch or lantern to be carried in the off hand.) I'm looking for a way to base them on light crossbows and make those one-handed; but the controlling codes aren't in the 2DA file I expected them to be in. I haven't found them yet. Meanwhile, unless the mood and visual appearance of your game make it useful to carry torches with a pistol, I'd recommend version 1, which bases all firearms on heavy crossbows; the animation is more satisfactory.
The problem I'm running into with the bullet stack issue which C Writer noted is that scripts govern player actions, and automatic reloading is a Bioware game machine function. So my script doesn't kick in until *after* the program has reloaded the weapon. At that point, actually firing the weapon is a "player action" and my script can intervene.
Posted by C Writer at 2009-02-21 10:06:25 Voted 9.75 on 02/18/09
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 Writer at 2009-02-18 17:18:35 Voted 9.75 on 02/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 2009-01-10 12:07:38 Voted 10.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.
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 2008-12-23 10:43:04 Voted 10.00
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.
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 krizka at 2008-12-10 11:09:14 Voted 10.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.
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 krizka at 2008-12-09 08:57:25 Voted 10.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 !
Here are the current updates! Version 1 is a correction of the original package, adding gunsmoke visual effects and correcting the scripting error which piotr krizka identified. Version 2 adds sling-based pistols.
If you update a module from Version 1 to Version 2, I recommend using the guns2_v1_to_v2.erf file rather than the full blueprints erf. The full erf file would overwrite any modifications you've made to ammunition or guns; the update version won't.
Also be sure, if you update a module, that you've installed the guns2... hak and added the gun2.. version of the OnEquip script to your Events tab.
I'm keeping Version 1 available; it's more completely compatible, and the crossbow animation is more satisfactory. If you'd like to update the hak, simply replace your existing guns_core.hak with the new version included in the Version 1 package.
Thank you all for your help! Let me know if you find other errors. I still have on my "to do" list the ammunition pouch malfunction Ranger_SG identified; does anyone have suggestions?
piotr krizka,
Thank you very much for your help! I've reproduced the problem you found, and traced it to my "OnPlayerEquip" script, which I've now corrected. I'm hoping that will fix it. Let me know if one of my new versions works better for you -- I very much appreciate your calling my attention to this error in my script.
Posted by piotr krizka at 2008-12-06 00:32:39 Voted 10.00
Yes, it is installed at the right place and all... But it seems it does not work at all in my modules. There can be two reasons, I think :
1 - I have a french version of NWN
2 - I use other haks in my mods, so perhaps there are
conflicts between them...
So, I tested it again with your module using only your hak, and the problem was slightly different, but still existed. When a player has bolts equiped in his inventory and then equips himself with a gun, he unequips the bolts, but can nevertheless use them to shoot, even if they have been automaticaly unequiped by the "gun_mod_def_equ" script. Please, just try and tell me if it does the same with you...
Thanks again :)
Piotr Krizka
piotr krizka,
Thank you very much for catching this. Could you post more details? Just to check: have you installed "gun_mod_def_equ" in the "OnPlayerEquipItem" slot of the Events tab on Module Properties for the module you're testing? That's the script which is supposed to keep crossbow bolts from firing in guns; if it's not working for you, I need to figure out why.
Posted by piotr krizka at 2008-12-01 02:28:02 Voted 10.00
While testing this (great) hakpak, I noticed a small, but ennoying problem : Characters can use crossbow bolts to shoot with the black powder guns ! In fact I think this is the main problem with the hackpak, since it makes the bullets useless since they are more expensive than bolts, and guns are not supposed to work with bolts !
Posted by Raven_Blood at 2008-11-30 17:47:19 Voted 10.00
well it all sounds good to me :) do take your time. well be ready when its ready im sure (i am at least)
I've had less time free to work on Version 2 than I'd hoped, so I probably won't release it till the end of the week; but I don't want to rush testing. Meanwhile, here's what I'm thinking of. Do you have comments or suggestions?
- I'm going to post two versions, one with sling-based pistols and one without. Everything developed under the non-sling version will also work fine in the sling-pistol version; but I'll have to overwrite a sling bullet vfx, and I want to keep one version fully compatible with NWN and CEP.
- I'm planning to overwrite the Ice Bullet vfx file for sling-based pistols. It came down to that or acid, and Farel's Gold (which uses acid) seems to turn up often.
- The firing animation for slings looks strange with pistols; but they look great carried with a torch.
- I'm revising the "bullet pouch" scripts so that they will test whether a sling-based pistol or a crossbow-based gun is equipped, and will load the proper ammunition. That means a single pouch of bullets will work with either.
Do you have any suggestions?
Thank you again for your help! Version 2 coming soon.
Posted by boodah at 2008-11-26 07:21:53 Voted 10.00 on 11/26/08
Absolutely great. And comes with one of the best and most entertaining demo mods I ever saw for a hak. Very useful for Warhammer-like modules.
Posted by Raven_Blood at 2008-11-23 17:55:08 Voted 10.00
well thats all i wanted to hear really lol i had figured as much but i figured id give it a try anyhow :) explaining the specifics to me helped out too, now i *really* know how hard it would be.
If you ask me, using the slings for an alternative look for a pistol would look great, but i consider all races involved with this. meaning all the little races which may (or may not) have the need to handle a small gun as a two handed weapon. i will agree that it would look really cool, but if all fails i say what you have now works good enough.
As for that primer flash idea, yeah! if you could get that in sometime down the road that'd be really awesome :O thats something willing to wait for as an idea.
Raven_Blood,
I'm planning to include a slightly modified vfx for the sling pistols; I think it won't be as satisfactory, because it's tied to the sling animation so the point where the smoke turns up isn't always where I'd like it. (With the crossbow animation, the bow is pointed and then fired; with the sling animation, the vfx fires somewhere along the curve as the sling is thrown overhand.)
At this point I don't see a way to introduce more smoke effects; the problem is that in order to make the smoke effect fire at the same time as the weapon is fired, it needs to be tied to the bullet type. These are built into the ammunitiontypes.2da; so what I've done, for example, is make a new vfx model for the "sonic bolts" category. Each new vfx has to replace one existing model.
I have thought about a primer flash for the locks, which would be fun. The downside is that, at many distances, a realistic primer flash wouldn't be visible, and I don't want to be adding enough detail that it interferes with the game. I could do this later, in a later update; we'll see what people think.
I'm realizing that one of the things which is slowing my final version is that there *is* another way to do the pistols. I could base them on light crossbows; then the animation would be better. The problem is, I'd have to edit the base items 2da file to make all light crossbows one-handed. That could be unbalancing; for example, it would let people fire crossbows while also holding a shield. It would also be high maintenance; lots of haks (including CEP) include custom base items files already, so including crossbow-based pistols would require that people edit their haks. On balance, that doesn't seem like a good idea. I think.
More later this week, I hope. Depends on real life.