Making an NPC Vendor Game: TES V: Skyrim
1a). OBJECT window > WorldObjects > Containers Left-click into the Editor ID window and type Merch so all the merchant chests show up.
1b). Find a chest that sells things which you'd like the merchant to also sell. Duplicate this chest.
1c). Rename its ID, click OK. And select "no" when the CK asks if you'd like to make this chest into a New Item (since it already is a new item), and confirm this by clicking Yes.
1d): Go into this container's inventory and change anything you'd like. I duplicated VendorMiscChestSmall, which contains several Leveled List items.
Note: Make sure the Respawns toggle stays toggled on, so the merchant will restock their store.
It's a good idea to right-click > New into the Item List window, and add find VendorGold X in the scroll-bar, with the X being "Apothecary", 'Inn", and so on. Since I need a general merchant, I am choosing VendorGoldMisc, and then changing Count to 1. This will give the vendor 750 gold to play around with, though sometimes other mods will cause this amount to vary. Gold can also be added directly into the NPC's inventory window as well, after this NPC is created. Any gold added here will not vary.
1e). If there are any leveled items in the container's inventory which say anything to do with "PerkInvestor X" go ahead and remove these. Since the container was duplicated, sometimes this perk will hitchhike along. Since these perks are already associated with other merchants, we don't want to influence these others with our custom merchant. That can mess up things on their ends.
2a). CELL + RENDER windowsDrag the container into a cell where the vendor will be placed. Put it into the void though (outside of character reach), unless you want there to be a chance that the player will choose to try stealing from this chest.
![emot-ninja1.gif](style_emoticons/sinders/emot-ninja1.gif)
Make sure the chest stays onscreen.
3a). OBJECT window > Character > FactionRight-click > New into the window. Give the faction an ID and Name.
3b). Make sure the General tab is selected. If the vendor will be running his/her own shop or stall, click the Can Be Owner toggle on. This is not important for NPCs added into cells which are already inhabited by other vendors though. For instance, I wanted to add a general vendor into Dawnstar's Mortar & Pestle. Frida (the default merchant there) will gladly buy & sell apothecary stuff like potions and ingredients, but I want somebody else in there who will buy general stuff. This second NPC won't need "Can Be Owner" toggled on.
3c). Vendor tab: toggle Vendor on. And click on the Select Reference in Window button. Double left-click on the merchant's chest.
3d). Put some numbers into the Start Hour and End Hour slots. These numbers correspond to hours in the game, however they must be added in military time .... i.e., 18 instead of 6 pm. If times are not added into these slots, the NPC will not buy or sell at all.
3e). Change the Vendor Buy/Sell List to whatever is appropriate. Since my merchant will buy and sell general stuff, I changed this to VendorItemsMisc.
Note: when choosing VendorItemsMisc, toggle Not Sell/Buy on. This keeps them from buying & selling stuff which should not get bought or sold (such as keys).
3f). Click the Location button and choose Near Self. (Note, we can also choose Near Reference, and I will explain why this can sometimes be chosen later). Click Ok.
3g). Click OK, closing the Faction panel, and
save all work.
4a). OBJECT window > Actors > Actor. Right-click > New into the Object window. Do all the usual: ID, Name, and Short Name.
4b). Toggle Unique on, and click OK (this closes the NPC's panel). Now reopen the NPC's panel.
5a). Traits tab: choose a Race. And choose a Voice Type in the scroll-bar.
Note that not all of these voices will work in-game, and if they don't work, sometimes this can screw up the onscreen dialog as well. It helps to make sure the NPC's voice will work. So since I am making my NPC a vendor, here is what to do.
5b). Object window > Miscellaneous > FormListType "voice" into the Filter, so that the window focuses on Voice Types. There are dozens of results in the window now.
5c). Scroll down to VoicesVendor and double left-click on this.
The FormList panel pops up, and this shows all the voice types which are "safe" to use. There are quite a few. Since my NPC will be an ordinary Nord, I can see that MaleNord is indeed safe to use. Why is this important? It's important because choosing the right voice will guarantee the NPC will say all the things vendors usually say: "You lookin' to buy something?" "Trinkets, odds and ends, that sort of thing," and so on. If they haven't got the correct voice type, they won't say anything. And while to some of you this might be a small blessing, I'm not sure if they'll also be able to participate in buying / selling stuff.
5d). Click OK,
save. And reopen NPC's info again.
6a). Stats tab: Choose PC Level Mult to make the NPC level with the character. Choose Auto-calc stats (and then give the NPC a level in the Level slot) to make an NPC who will pertain to a specific level. Or choose neither of these, and customize the NPC in the Skills window.
6b). In the Class scroll-down, VendorPawnbroker is a good class for a general merchant. There are also classes geared toward Smiths, Food, Alchemy, and so on.
Notice that when each class is chosen, this will change some of the numbers up above in the Skills window, if Auto-calc Stats is toggled on.
6c). Go through the rest of the tabs as you see fit, giving the NPC some AI, some clothes, some personal objects, and so on. Note that items in the
Inventory tab's main window COULD get sold, if the NPC deals in this type of vendoring. For instance, if the NPC is to sell potions, any potions in his/her inventory can get sold as one-time items. This is useful for adding rare, possibly expensive items for sale.
6d).. Click OK and save.
7a). Reopen the NPC vendor's info and select his/her
Factions tab. Drag the new faction from the Object window into the NPC's Factions and Ranks window. Right-click > New into this window too, and find the JobMerchantsFaction. These two factions alone are all that's needed for a basic merchant. Our custom faction makes sure the merchant will sell & buy from and to the right container, and the JobMerchantFaction makes sure the NPC will say all the things vendors usually say.
Note: Blacksmiths should not be added into the BlacksmithFaction. JobMerchantFaction will handle all their merchant duties.
It's also a good idea to add one of the crime factions, such as CrimeFactionPale, which is what my vendor will have. This will cause the NPC to freak out and give us a bounty if we get caught stealing something, or attack the NPC. Below the Factions and Ranks window, change the Assigned Crime Faction scroll-bar from None to whichever crime faction was added. Now.... depending how much Confidence this NPC has in her or his AI Data tab, this NPC will either run away if Cowardly is chosen, attack our character if Foolhardy is chosen, or somewhere in between.
A town faction (such as TownDawnstarFaction) might also be a good thing to add. This helps the vendor become part of the town itself, meaning they'll get involved in various things those townies say.
7b). Make sure any factions which are supposed to be "on" have a 0 next to them, under the Rank column. If there's a -1 in this column, change this by highlighting the faction, pressing F2, and changing this manually to 0.
7c).. Click OK, closing the NPC's info, and save.
8). Place the NPC into the cell where the container was added.
The work is basically done. Below are some tips which will make the vendor sell things which are right there in the store. As we buy these items, they will disappear from the store! They will also respawn when the store or stall's cell respawns. Neato.
9a). Grab 'n' drag any items from the Object window, into the Render window, and place these items onto any nearby surfaces. Double left-click on these items in the Render window, and select one of the Ownership tab's scroll-bars, selecting either the NPC vendor, or his/her faction.
9b). Double left-click on any object near where the NPC which cannot be sold, such as a counter or a table, where the vendor will do all vendoring.
9c). Give this object a Reference ID. Click OK.
10a). Double left-click an unsalable object (such as a counter or stall where the NPC will be vendoring) and give this object a Reference ID. Now, make sure this object (counter, stall, whatever) stays onscreen.
10b). Reopen the NPC's custom faction in the Object window, select the Vendor tab, and press the Location button. "Near Self" is toggled already, from step #3f. Change this to Near Reference.
10c). Press the Select Reference button and double left-click on the counter, stall, whatever.
10d). Put a number into the Radius slot, such as 256 or 512. Now, any referenced items placed nearby can be bought in real-time once we're back in-game, and if we can see these items onscreen, they will disappear when bought.
This post has been edited by Renee: Mar 10 2019, 08:08 PM