I have an item that I would like wasn’t available at a store until a certain point in time in my module. Would it be possible (somehow) to spawn an item into a store (or make it unavailable until a certain thing has happened)?
I mean, looking at a store there’s a slot for OnOpenStoreScript. Could you do something with that?
Edit: Could you use CreateItemOnObject perhaps, or is a store not considered an object?
I discovered that stores are very flexible in NWN2. I even managed to have a system where the vendor will start a conversation with the buyer as they buy the item! The effect is really neat. It allows a feeling of seller/buyer interaction rather than just a dump or collect system.
Restocking and destocking is a core part of my own store systems as the module economy relies upon it. Bottom line … as other have said … definitely.
I was a bit unsure of the CreateItemOnObject function first since it says in the description:
// Create an item with the template sItemTemplate in oTarget's inventory.
And technically it isn’t the object’s inventory where I want to spawn/create the item, but the object’s store, but maybe the game sees those two as the same thing?
Yes, I understand that. However, if you look at this screenshot:
There are two different slots when you look at Properties on an object. That’s what I meant when thinking that the game may see them as the same thing although, at least to me, there seems to be a difference.
I hope you understand my reasoning (or confusion).
I think that’s just for convenience… to show store items in appropriate panels. That is, i don’t think its necessary to have two tabs there, because in BaseItems.2da there’s a column “StorePanel” that likely does the ingame sorting.
Is there a utility that will auto-sort all the items into the right containers for a store blueprint? It’s mighty tedious to do it manually in the toolset.
not that I’ve heard of. But here’s a quirk : as a test I threw an assortment of items all into a store’s Armor tab in the toolset. But ingame they were each sorted to their respective panel …
however the UTM file does keep them sorted as they were assigned in the toolset …
Lance_Botelle… I love the idea of the shop keeper commenting ! Do they say things like “not exactly my choice but up to you” when you buy some new shiny plus one throwing axes that you can never pick up again ?
As for the shop adding things I’d take the easy option that store owners can have more than one shop and when you hit the point in the story you just open the “new improved” store from the conversation.
When a certain item is bought, the shopkeeper starts an entire conversation about it. As it only happens for certain “unique” items, its not as intrusive as that may sound. It actually gives a great interactive feel about what you just bought. i.e. I use the system sparingly.
I imagine you could add simple comments like the type you mention too. In fact, I even have notice text fired on some items. E.g. The store keeper carts the item sold to somewhere safe. (i.e. It will not appear for sale in the store after being sold.)
How about adding a random item from a chest to a store inventory? Say there is a creative smith in the city who sells masterwork weapons through a local vendor.