egocarib Posted November 26, 2013 Share Posted November 26, 2013 AddForm works fine. It will persist through the whole duration of a player's playthrough, no matter what kind of list you're adding to (Leveled or not). Link to comment Share on other sites More sharing options...
taleden Posted November 26, 2013 Share Posted November 26, 2013 If you only want the item(s) to be available once from a specific merchant or set of merchants, get their merchant chest ObjectReference(s) and use AddForm to put the item(s) inside. Just note that if the player doesn't buy it before the merchant stock resets, it will disappear. If you want the item(s) to be available every time the merchant restocks, choose a LeveledItem list that's already in their chest and use AddForm on that. Script modifications to LeveledItem lists are now kept in save games, so you only have to do this once when your mod first installs, and it will stay that way afterward. If you need to undo your change, do not call Revert on a LeveledItem from the base game! That will break other mods, including the Hearthfire DLC, depending which LeveledItem you're working with. Instead, make your own LeveledItem list and use AddForm to add it to the base list (only once), and then add your items to your own LeveledItem list when needed, and Revert your own list when the items are no longer needed. The vanilla LeveledItem list best suited for this process depends on what items you're adding, who you want to sell them, and how many you want them to (possibly) sell. For maximum control, an approach I've seen elsewhere (and the one I'm using in my own mod) is to add to the VendorGold* lists, which are included in (almost) every merchant chest of the corresponding type. Just note that in order to do this, you do have to override the VendorGold* list in your mod in order to change it from "calculate from all levels" to "use all" -- this has no effect on its original purpose (since it only contains the one Gold001 entry anyway), but it allows your scripted addition(s) to be used in addition to the gold, rather than it randomly choosing one or the other. This override is (I think) safe to do, because any other mod that alters that same list is almost definitely going to make the same change (to set "use all") so there shouldn't be any load order issues. Just remember, again, never to call Revert on the VendorGold* lists (or any other base game lists) -- doing so will break other mods because there's no way for them to know that you did it. Link to comment Share on other sites More sharing options...
egocarib Posted November 26, 2013 Share Posted November 26, 2013 Instead, make your own LeveledItem list and use AddForm to add it to the base list (only once), and then add your items to your own LeveledItem list when needed, and Revert your own list when the items are no longer needed.Wow, great advice.. I was always stumped about how to remove forms I had added... Thanks for the tip, that will come in handy. :) Link to comment Share on other sites More sharing options...
MegamanNeoX Posted February 18, 2014 Share Posted February 18, 2014 (edited) If You're Using Creation Kit, The Best Way I Found To Do It Is To Go To: [Formlist] And Creat A New (VendorItem Formlist). Go To [Miscellaneous], (Keyword), And Highlight All The (VendorItem) Keywords And Add Them To The VendorItem Formlist You Just Made. Then Go To [Faction] And Creat A New Faction. Go To The Vendor Tab, Check The Box That Says Vendor, Set The End Hour To 24, Radius To 256 And Select The VendorItem Formlist You Created In The Vendor Buy/Sell List. Add The Faction To The NPC You Want. Add A Vendor Chest Under [WorldObjects] (Containers) And make The NPC You Want Owner. Under [items] (LeveledItem) Rightclick Go To New And And Name It Vendor{Whatever Your Want After Vendor}. Click Both Calculate Buttons And Add 1 Gold To It. Under Count Next To Level Add How Much Gold You Want Your Vendor To Have Add The Vendor Leveled Gold To The Vendor's Chest And You're Done. Edited April 27, 2014 by MegamanNeoX Link to comment Share on other sites More sharing options...
cmasonw0070 Posted August 25, 2016 Share Posted August 25, 2016 I think that the above script is no longer necessary. Looking at the linked wiki page (and its previous revision which contains the code referenced by fg109) it seems that Bethesda fixed the problem with non-persistent changes. Thus I assume that the much simpler code CoolItems.AddForm(Axe, 5, 2) [for adding 2 Axes to the list CoolItems for level 5] is sufficient. However, I don't know which object one must attach that script to... Can anyone clarify?thanks, bro. Link to comment Share on other sites More sharing options...
Recommended Posts