BioWare Atari
BioWare Info BioWare Games Support Forums Visit the BioWare Store
Neverwinter Nights Home
Neverwinter Nights Home

How Do I Start My Store?

Intended Audience: For Builders
By David Gaider

[Printer Friendly / Syntax Highlight]

Setting up the basic store is pretty easy... all you have to do is use the Store Wizard and that gets your basic store object set up: you've got a store with an inventory, a mark-up and mark-down percentage, a name and a tag. But what do you do with it, then?

Step 1: Place the store object in your module A store that is just an unplaced blueprint cannot be accessed by your module. You've actually got to put it somewhere. You'll notice that when you place it, it looks just like a waypoint... that's fine. Players won't see this store 'object' or be able to interact with it in any fashion... it just needs to exist, preferably closeby to the object that is going to call on it.

Step 2: Create your accessing object Usually this is a merchant NPC... but it doesn't have to be, really. Any object that can run a script can open a store. Having a merchant NPC is the easiest method, however.
Simply create your merchant and go to create a dialogue for him. The simplest method is simply have him say "Greetings! How would you like to see my wares?" Then add two player responses: "Yes" and "No".

Step 3: Add the script to open the store object In the above dialogue, you'd want to add this script into the 'Actions Taken' section of the "Yes" player response... so when the player selects that response, the store is opened. Nothing needs to go in "No"... that will simply end the conversation.

The basic script for opening a store object off of dialogue is this:

NWScript:

...and that's it. Naturally you want to replace "STORE_TAG_HERE" with the specific tag of your store object.

If you look at the command structure of OpenStore, you will see that you can optionally add on extra mark-up or mark-down percentage... that's just in case you want conditional store useage. Take this next script, for instance... the storekeeper doubles all prices for elves (I guess he doesn't like them):

NWScript:

Last comment on stores: the features that the standard store object offers are pretty limited at the moment. Perhaps that will change in the future. Regardless, know that you cannot adjust prices on individual types of items... a merchant applies the same mark-up or mark-down regardless of the item involved... nor can you dictate what types of items a merchant will or will not buy. It is all or nothing.
One thing that does work on stores is that any scripting command that targets an object's inventory works on the store object, as well. Remember: it's the store object that has the inventory, NOT the merchant NPC. So using CreateItemOnObject, GetFirstItemInInventory and GetNextItemInInventory will all work when targeting a store object.

 

 

BioWare Store
Neverwinter Nights 2 Forums
Hide/Show

English
Deutsch
Français
Español
Italiano

Hide/Show

View Latest Screenshots 

View Latest Screenshots
Hide/Show

Multiplayer Games at Neverwinter Connections

Today
Schedule a Game...



Current time is: (set time)
Sun, 22 November 2009 05:35AM

Hide/Show

Buy Premium Modules

Top NWN: HotU Modules:
1. Good vs Evil III
2. More...

Top NWN: SoU Modules:
1. Good vs Evil III
2. More...

Top CEP Modules:
1. The Lord of Terror The Diablo Campa...
2. More...

Top Modules - NWVault:
1. Hall of Fame
2. More...

Total Modules: 4423

Hide/Show

5,051,047 BioWare Users:
  47 Logged In
  2 Hidden
  170 Guests

1183 Playing Online
  100% NWN
  100% NWN: SoU
  99% NWN: HotU

447 Registered Guilds

8,768,698 posts in forums

Newest Forum Topics:
1. I think we ARE goin to earth (Mass Effect 2 General Discussion (No Spoilers Allowed))

2. Merging Clothing (aka. body) par... (NWN 1: Toolset)

3. "Open Your Browser and Close You... (Mass Effect 2 General Discussion (No Spoilers Allowed))

4. A List Gleaned from Dev Statemen... (Mass Effect 2 General Discussion (No Spoilers Allowed))

5. Drowned Dead Test (NWN2: Players - Storm of Zehir (Spoilers Warning))