Yes, I'm sure about this, as I have both crossbows and rifles working in game here. However, you're right too: straight copying the row to another place gives the "no ammo" message. I've been looking at the differences between the crossbow and the rifle lines, and didn't see anything obvious, apart from the fact that many things are different as I initially tried to create a totally different ranged weapon, and in the end changed the model name to match the crossbow.
Let me check step by step.
Edit:
First thing I tried: copy my new crossbow to another line.
Result: the "copy from" version still works, the "copied to" version gives the "no ammo" message!
Clearly it's not only the values in the baseitems.2da file that are involved!
Conclusion:
Sorry, I was wrong
Although I had the new lines in baseitems.2da, the blueprints were still referencing the standard crossbow.
However, the workaround with charges or the ranged weapon without ammo (as far as NWN2 is concerned) but using a script to make it unusable if the wielder doesn't have the ammo in the inventory still work.
All the tests I made so far give the expected results, except in the following two cases:
- if the weapon is one-handed (like a pistol), the standard _1hs_ or _1hss_ animation is displayed before the specific animation for the gun. I don't know how to avoid this. Maybe freezing the character? Not sure if combat is still possible in that case though.
- if the attack missed, the number of projectiles is not decreased, and the projectile visual effect is not displayed. This can be solved for NPC by the EndOfCombatTurn event, but I don't have any solution for the PC.