kitcat81 Posted April 21, 2018 Share Posted April 21, 2018 Hello guys, I will be very thankful for your help.I know how to write scripts, but I never injected anything to vendor Leveled Lists and would like to ask someone who did it. What are the best lists to add your items to (in the meaning of making them easily avalable) ? Is it safe to uninstall a mod that has injected something to a vendor leveled list? Can't the list become corrupted like vanilla menu ? Link to comment Share on other sites More sharing options...
payl0ad Posted April 21, 2018 Share Posted April 21, 2018 The answer, as usual, is "it depends". Injecting actual items (ALCHs or MISCs or whatever) is probably done best on LeveledItems that also contain actual items, while LeveledItems should probably get injected on those that don't contain actual items. As you can't pass a chance none to LeveledItem.AddForm(), I'd try to find a list that doesn't use per-item chances. Link to comment Share on other sites More sharing options...
FlashyJoer Posted April 21, 2018 Share Posted April 21, 2018 Easy. Create a Start Enabled, Run Once quest.Create Stage 0 with the Start On Run checkbox enabled.Create a log entry for stage 0.Add a quest fragment as this: VL_vendor_Doctor.AddForm(FORM, 1, 4) Where FORM = what to add, 1 = player level to show this item at (1 means it always shows right from vault exit) and 4 = number of items vendor has per 24 hour stock rotation. Obviously, you change the VL_vendor_Doctor to whatever leveled list you want. Then be sure you add the script properties for the leveled list and the form to add. You can have as many leveled lists in this fragment as you like. In my mod, RSE, I have about 20 items added to various leveled lists and they all appear at game start without issue. Link to comment Share on other sites More sharing options...
kitcat81 Posted April 21, 2018 Author Share Posted April 21, 2018 Great thanks to your both for all suggestions! Seems to work fine. :) Still wonder though if it's ok to uninstall the mod after this. But I might just test it. Link to comment Share on other sites More sharing options...
payl0ad Posted April 22, 2018 Share Posted April 22, 2018 That's what LeveledItem.Revert() is for. ;) Link to comment Share on other sites More sharing options...
kitcat81 Posted April 22, 2018 Author Share Posted April 22, 2018 That's what LeveledItem.Revert() is for. :wink:Thank you Payl0ad. The problem with revert function is that it deletes everything added by scripts. If any other mod has added something to the same leveled list, it will mess up this mod. So it's only suitable when know that no one else has added anything. Link to comment Share on other sites More sharing options...
FlashyJoer Posted April 23, 2018 Share Posted April 23, 2018 (edited) Create a magic effect or an MCM toggle that does a RemoveAddedForm and leave it to the user to do the right thing, provided you give them ample instruction. And then, if they fubar their save, because the didnt read the clearly labeled instructions, its not your circus and its definitely not your monkeys. Edited April 23, 2018 by joerqc Link to comment Share on other sites More sharing options...
kitcat81 Posted April 23, 2018 Author Share Posted April 23, 2018 Create a magic effect or an MCM toggle that does a RemoveAddedForm and leave it to the user to do the right thing, provided you give them ample instruction. And then, if they fubar their save, because the didnt read the clearly labeled instructions, its not your circus and its definitely not your monkeys.Thanks Joerc. I have scripted my custom menu the same wat. But the function description in the wiki says that it works only with formlists. Not sure that it will work with leveled lists, but probably worth trying. Link to comment Share on other sites More sharing options...
payl0ad Posted April 23, 2018 Share Posted April 23, 2018 Yup, according to the CK wiki, LeveledItem does not have a function "RemoveAddedForm()". What you say is correct - Reverting a LeveledItem will uninstall other mods that injected into the same list. There's no real way around that though. Link to comment Share on other sites More sharing options...
MissingMeshTV Posted April 23, 2018 Share Posted April 23, 2018 (edited) That's what LeveledItem.Revert() is for. :wink:Thank you Payl0ad. The problem with revert function is that it deletes everything added by scripts. If any other mod has added something to the same leveled list, it will mess up this mod. So it's only suitable when know that no one else has added anything. I don’t know if this is an option for your use case or even if it’s the best way, but I’ve done something similar in the past by setting up an Aspirational Container for a vendor and using custom empty levels lists. My items are injected to the form lists via quest as joerqc previously mentioned. The new container is set as a linked ref to the vendor ref with the aspirational vendor container keyword (can’t recall the exact keyword at the moment. It’s something like vendorcontainer01…horrible memory). My custom items show up in the vendor inventory along with the vanilla list items. I have a case where I want my custom leveled list cleared when an item is purchased and have LeveledItem.Revert() triggered by an OnContainerChanged event. That way it clears my custom leveled list assigned to the aspirational vendor container (when the purchased items changes containers) without impacting vanilla leveled lists. Maybe that helps somehow? Edited April 23, 2018 by RedRocketTV Link to comment Share on other sites More sharing options...
Recommended Posts