Implementing a Coin Pouch

Hey my module has coin items that sit in inventory rather than using the standard gold coins. What I’d like to make is a coin pouch that would only allow for these coin items to be placed in them. I’d also like to limit the number of slots that are in the containers themselves.

So far I am not having any luck resolving either of these problems. It’s not the end of the world if I don’t have them it would be a “nice to have”.

If anyone has any ideas that would be fantastic. The best idea I have had would be for the module’s onacquire and onunacquire to store the coins as variables in the player database and have the coin pouch have a custom use property which would tell the player how much money they have.

I believe that this would work but it’s not something that I am interested in trying to build out right now. Any help is appreciated though.

It is not possible to restrict what kind of item can be put into containers without NWNX. And linux NWNX doesn’t have this feature either afaik, but it can be done (I have it).

Yeah … that is what I was thinking. Would be a nice to have but not a “got to have” by any measure.

Too bad there wasn’t an easy way to differentiate between in inventory and in container in inventory.

The main problem is that moving items inside same inventory doesn’t trigger any events. So you cannot catch it happening and potentially prevent it. I have this coded in my NWNX onto a new custom itemproperty, it looks like this:


Makes sense for sure but I don’t want to add NWNX just for the coins. If I come across other use cases for NWNX though I will make sure I have this in mind.


The module Almraiven has a good coin and pouch system, which uses the open/close shop event to convert the coins into gold and back. You could use this even to clean up the the contents of the pouch. This is not a perfect solution for your problem by any means, but probably annoying enough to teach the player a thing or two.

Yep I am doing something similar here. It coverts the coins into “gold” then uses the normal shop interface and then converts them back again.

What I was hoping for was a coin pouch that they could only put coins in mostly to save on storage space but I don’t want to give them slots they can dump armor and weapons into :wink: It’s OK if there isn’t one though in the end it was a nice bit of polish rather than something that is needed.

I use a periodic check for the contents of coin bags and pouches. If it’s got stuff in it it shouldn’t have it can break and dump some of your stuff to the ground (and the rest just to inventory). It doesn’t prevent you from putting big things in it, but it penalizes you later. I use coins with weight so you really want your coin pouches. Fwiw.