Jump to content

[LE] [Papyrus] Refreshing merchant inventory.


SevenBlue

Recommended Posts

Hey, so I'm working on my MCM for my mod and I'm currently on the toggle option for certain items to appear in the merchant's inventory. It works fine if the player waits 2 days for the merchant chest to respawn, but I was wondering if there was another way of handling it?

 

I have it set up with two layers of leveled lists, ListA gets added to a vanilla leveled list oninit, the only item on ListA is ListB, the toggle option I currently have set up uses addform and revert to control the single item being added and removed from ListB. This works but like I said you also gotta wait for the merchant's chest to respawn.

 

I also tried using globals with a similar set up, and this works in that the item spawns in the vendor's chest immediately, since it was technically always there just hidden, but then when the option to show the item is disabled the item persists in the merchant chest.

 

I'm not even sure if there is a viable solution beyond just having the player wait 2 days in game but I figure I'd throw this out there.

Link to comment
Share on other sites

There's ways, but I'd need to know more about what you're after before making a specific recommendation.

 

1. Is this a singular, known merchant chest?

2. If not, is it a set of known merchant chests?

3. Do you care if the rest of the chest's inventory gets reset at the same time?

Link to comment
Share on other sites

No, three known merchant chests, the three caravans. I've been using the moonsugar leveled item list to target all three at once.

 

Ideally no since that's exploitable by the player, they could just toggle the option to reset the inventory.

Link to comment
Share on other sites

No, three known merchant chests, the three caravans. I've been using the moonsugar leveled item list to target all three at once.

 

Ideally no since that's exploitable by the player, they could just toggle the option to reset the inventory.

 

Okay. Is the item being added a new item created by your mod, or something vanilla?

Link to comment
Share on other sites

Won't compile not sure why, tried tweaking it in various ways.

SetToggleOptionValue(iKit, KitVal)
			
				If (SB_SkoomaSetGlobal.GetValue() == 0)

					SB_SkoomaSetGlobal.SetValue(1)
					
					
					
			

			Else

				
				
				SB_SkoomaSetGlobal.SetValue(0)
				MerchantCaravanAChest.RemoveItem SB_SkoomaSet 10

and here are the errors

C:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SB_MCMScript.psc(100,26): no viable alternative at input 'RemoveItem'
C:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SB_MCMScript.psc(100,37): no viable alternative at input 'SB_SkoomaSet'
Link to comment
Share on other sites

MerchantCaravanAChest.RemoveItem(SB_SkoomaSet,10)

Also, I'm not sure if GetValue() should be GetValueInt() for a bool toggle.

 

Oh... I don't know anything about merchant inventories, but I'm wondering if you could change the levelled list instead. So you have one list with skooma in it, then when you're resetting it you switch it for a list which does not have skooma. Might be more practical than directly adding or removing stuff.

Edited by Kapteyn
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...