How do I get an NPC to sell items?

Post » Sun May 01, 2011 4:52 pm

How can I get this NPC to sell some food items? I've never been able to figure out how people have a person sell 500 items and when I check their inventory, there's nothing on them. How do I set this up?

http://img34.imageshack.us/img34/1821/99956661.jpg
User avatar
Mandi Norton
 
Posts: 3451
Joined: Tue Jan 30, 2007 2:43 pm

Post » Sun May 01, 2011 4:13 pm

The NPC herself is set up correctly, assuming that foods are set up as ingredients (like NoM's foods, for example). About adding some wares to her: an NPC will sell all items (s)he is set to sell, as long as (s)he owns them. So all you need to do, is create a unique container, add foods to it (with negative numbers if you want them to restock immediately), and set that container's ownership to the merchant NPC.
User avatar
Jeneene Hunte
 
Posts: 3478
Joined: Mon Sep 11, 2006 3:18 pm

Post » Sun May 01, 2011 10:18 pm

How can I get this NPC to sell some food items? I've never been able to figure out how people have a person sell 500 items and when I check their inventory, there's nothing on them. How do I set this up?

http://img34.imageshack.us/img34/1821/99956661.jpg

This NPC can sell food items. Ingredients has a check mark.
If the items aren't in the inventory, then they will be in a nearby container that the NPC has ownership over.
User avatar
Neliel Kudoh
 
Posts: 3348
Joined: Thu Oct 26, 2006 2:39 am

Post » Sun May 01, 2011 5:56 pm

Ah, thanks! I had to give it ownership. I've seen crates with negative numbers but I never knew how it worked.
User avatar
SaVino GοΜ
 
Posts: 3360
Joined: Mon Sep 17, 2007 8:00 pm

Post » Mon May 02, 2011 3:36 am

You probably already know this but you can also add ownership to individual items as well. Like if you wanted her to own the items on the shelf. Those items would pop up in her inventory as well.
User avatar
Tamara Dost
 
Posts: 3445
Joined: Mon Mar 12, 2007 12:20 pm

Post » Sun May 01, 2011 5:27 pm

You probably already know this but you can also add ownership to individual items as well. Like if you wanted her to own the items on the shelf. Those items would pop up in her inventory as well.


Actually, I wasn't aware of that. Thanks. Although, with the NoM items, I'd have to make unique IDs for the ones out in open view since her ownership would apply to all locations of the item.
User avatar
Ridhwan Hemsome
 
Posts: 3501
Joined: Sun May 06, 2007 2:13 pm

Post » Mon May 02, 2011 4:37 am

No, that's not necessary. Ownership only applies to the marked reference (the single exemplar), the object (the "prototype") itself is not affected.
User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Post » Mon May 02, 2011 3:14 am

So if I have that "references persist" button checked, it'll apply to all locations of the item?
User avatar
Hayley Bristow
 
Posts: 3467
Joined: Tue Oct 31, 2006 12:24 am

Post » Sun May 01, 2011 9:09 pm

No, "References Persist" causes Morrowind to keep an object permanently in memory so that scripts/Result Boxes can reference (use) it even when it's not in the same Cell as the calling object/script. Ownership can only be set to a reference, never to an object. You'll see that when you edit (double-click) an object (in the object window): for objects, there's no "Extra Data" section where you could set an ownership. That "Extra Data" section is only available for References.

At the risk of repeating myself (I'd rather explain it yet another time than leave you confused, so if you still don't get it: ask! :) I know that it's confusing at the beginning.):
An object is the prototype of an item; it defines the item's ID, its mesh, and a couple of other things. A reference is an instance of an pobject in the gameworld. (When you place a piece of Hound Meat in a Cell, you are not placing the object "Hound Meat", you are placing a reference to the object "Hound Meat". (Basically, you tell the game: I want a piece of "Hound Meat" at this place. I have defined what "Hound Meat" is in its object, so look it up there.")
User avatar
Angel Torres
 
Posts: 3553
Joined: Thu Oct 25, 2007 7:08 am


Return to III - Morrowind