Adding items permanently to respawning chests WITHOUT editin

Post » Wed Jun 20, 2012 5:25 am

I'm trying to add items (or rather a leveled item) to vendor chests, but in order to keep the mod conflict free, I can't edit the chests themselves. My idea was creating a quest with a script or command to do this.

There is a script command to add items to leveled-lists (http://www.creationkit.com/AddForm_-_LeveledItem), but this function is apparently broken. Only thing I could see working now is a command put in the queststages that checks to see if the item is still in the chest (since it respawns, simply adding the item to it won't help), and if it isn't, add it to the chest.

Does anyone know how? Or is there a better way to achieve what I'm trying to do? Help is much appreciated (it's for a public mod!).
User avatar
Latisha Fry
 
Posts: 3399
Joined: Sat Jun 24, 2006 6:42 am

Post » Wed Jun 20, 2012 1:19 am

Not sure if a vendor can handle more than a single chest, but if can, you could assign a new chest to the vendor via a quest alias.
User avatar
electro_fantics
 
Posts: 3448
Joined: Fri Mar 30, 2007 11:50 pm

Post » Tue Jun 19, 2012 5:23 pm

You can make a custom leveled list that starts out empty, and add it to that chest.

When you want to, use the function for adding objects to a leveled list via script. This should be permanent unless some other script tells that same leveled list to return to its default contents.
User avatar
lilmissparty
 
Posts: 3469
Joined: Sun Jul 23, 2006 7:51 pm

Post » Tue Jun 19, 2012 3:14 pm

You could try to have the player "infect" Merchants with an ActiveSpellEffect that could look in the chests and add your items, perhaps?
User avatar
Kaylee Campbell
 
Posts: 3463
Joined: Mon Mar 05, 2007 11:17 am

Post » Tue Jun 19, 2012 8:21 pm

Create a quest to do it, set the vendor chest as a quest alias, then add your items into the Inventory section of the alias. Works like a charm.
User avatar
Michael Russ
 
Posts: 3380
Joined: Thu Jul 05, 2007 3:33 am

Post » Wed Jun 20, 2012 6:22 am

Create a quest to do it, set the vendor chest as a quest alias, then add your items into the Inventory section of the alias. Works like a charm.
I assume this bypasses the reset of the chest? Ok, this may sound stupid but, I can't get to the inventory part of the window, it's larger than my screen and I can't scroll down or anything...

EDIT: Apparently seems to be a problem with my windows display settings, I'm going set it on smaller and see if that works.
User avatar
maddison
 
Posts: 3498
Joined: Sat Mar 10, 2007 9:22 pm

Post » Wed Jun 20, 2012 1:01 am

Yep, that's a problem. I can see about half the inventory section of the Aliases screen, but that's enough to add a couple items. I can't see the "Ok" or cancel buttons I assume are down there, but that's workable as well. Go back to the Alias Name text field and just hit enter.
User avatar
Rachel Tyson
 
Posts: 3434
Joined: Sat Oct 07, 2006 4:42 pm

Post » Wed Jun 20, 2012 6:47 am

also note: if the item doesn't match the merchants' merchant type, it will only be available if the player has the perk that lets him buy anything in the chest and not just the store's standard fare (I.E. a sword in the chest for Radiant Raiment)
User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Tue Jun 19, 2012 5:37 pm

Could you give an actor a 2nd merchant faction with a new chest?
User avatar
Tanya Parra
 
Posts: 3435
Joined: Fri Jul 28, 2006 5:15 am

Post » Tue Jun 19, 2012 5:24 pm

Could you give an actor a 2nd merchant faction with a new chest?
I tried this, but it doesn't work (or I failed to do it correctly).

However, after having adjusted my settings, I can now see much more of the CK, and I've added the chests as quest aliases as proposed above. This works, as simple as that, I only have to see if it bypasses the reset. I'll let you know if it does.
User avatar
Killer McCracken
 
Posts: 3456
Joined: Wed Feb 14, 2007 9:57 pm

Post » Tue Jun 19, 2012 3:16 pm

Maybe you could put the item in the chest in the merchant's OnActivate event? You know, check when the player activates NPCs...if it's a merchant, find the merchant's chest and put the item in there if there isn't one there already.
User avatar
Emma Copeland
 
Posts: 3383
Joined: Sat Jul 01, 2006 12:37 am

Post » Tue Jun 19, 2012 6:36 pm

I know it's very late to confirm, but the quest-alias thing definitely WORKS.

So I'll repeat the steps:

1. Create a new Quest
2. Go to the Quest Aliases tab
3. Add new Quest Alias: Specific Reference, which in this case is the container you want to add items to
4. Add the items you want to be in the container to the inventory tab.

That's it! It will be re-added at reset as well! Thank you all for your help!
User avatar
matt
 
Posts: 3267
Joined: Wed May 30, 2007 10:17 am

Post » Tue Jun 19, 2012 8:56 pm

be careful with aliases on vanilla objects. sometimes i noticed this will create an edit on that reference in the cell, which defeats the whole purpose.

you should double check in the CK to see if there is an edit record on that container in the reference object window.
User avatar
ijohnnny
 
Posts: 3412
Joined: Sun Oct 22, 2006 12:15 am

Post » Wed Jun 20, 2012 5:42 am

Would just like to report that I just successfully used the Quest Alias method to add new items for sale to all vendors of my choice, without breaking compatibility. This should really be the recommended way to add items to existing vendors for all mods in the future since it ensures compatibility. Thanks to everyone in the thread for the information.

After adding the chests as Reference Aliases, I observed that I had not created an edit to either the chest's base object or the reference itself in the cell.

However, I did notice that the items did not respawn when the vendor restocked their inventory. I got around this by making the aliases Optional, and performing a RegisterForSingleUpdateGameTime() chain that clears all aliases and re-fills them once every 24 game hours. When the alias is refilled, the items reappear. This timer could be tailored to individual mod needs.

Here it is in case anyone ever needs a template. This covers most general goods vendors in the game.

Spoiler
scriptname _WL_VendorStock extends QuestReferenceAlias property RiverwoodTraderChestAlias autoReferenceAlias property CaravanAChestAlias autoReferenceAlias property CaravanBChestAlias autoReferenceAlias property CaravanCChestAlias autoReferenceAlias property AvalAtheronChestAlias autoReferenceAlias property BethethorsChestAlias autoReferenceAlias property BirnaChestAlias autoReferenceAlias property BrandChestAlias autoReferenceAlias property PawnedPrawnChestAlias autoReferenceAlias property WhiterunFraliaChestAlias autoReferenceAlias property SolitudeBitsAndPiecesChestAlias autoReferenceAlias property ArnleifChestAlias autoReferenceAlias property GrayPineGoodsChestAlias autoReferenceAlias property NiranyeChestAlias autoObjectReference property RiverwoodTraderMerchantContainer autoObjectReference property CaravanAChestREF autoObjectReference property CaravanBChestREF autoObjectReference property CaravanCChestREF autoObjectReference property AvalAtheronChest autoObjectReference property BethethorsMerchantChestRef autoObjectReference property BirnaChest autoObjectReference property BrandChest autoObjectReference property PawnedPrawnChest autoObjectReference property WhiterunFraliaChest autoObjectReference property MerchantSolitudeBitsAndPiecesChestRef autoObjectReference property ArnleifChest autoObjectReference property GrayPineGoodsChest autoObjectReference property NiranyeChest autoEvent OnInit();Stock lantern itemsFillAllAliases()RegisterForSingleUpdateGameTime(24)endEventEvent OnUpdateGameTime();Restocks inventory for all merchants once per dayClearAllAliases()FillAllAliases()RegisterForSingleUpdateGameTime(24)endEventFunction ClearAllAliases();Clear all merchant chest aliasesRiverwoodTraderChestAlias.Clear()CaravanAChestAlias.Clear()CaravanBChestAlias.Clear()CaravanCChestAlias.Clear()AvalAtheronChestAlias.Clear()BethethorsChestAlias.Clear()BirnaChestAlias.Clear()BrandChestAlias.Clear()PawnedPrawnChestAlias.Clear()WhiterunFraliaChestAlias.Clear()SolitudeBitsAndPiecesChestAlias.Clear()ArnleifChestAlias.Clear()GrayPineGoodsChestAlias.Clear()NiranyeChestAlias.Clear()endFunctionFunction FillAllAliases();Fill aliases to apply their inventoriesRiverwoodTraderChestAlias.ForceRefIfEmpty(RiverwoodTraderMerchantContainer)CaravanAChestAlias.ForceRefIfEmpty(CaravanAChestREF)CaravanBChestAlias.ForceRefIfEmpty(CaravanBChestREF)CaravanCChestAlias.ForceRefIfEmpty(CaravanCChestREF)AvalAtheronChestAlias.ForceRefIfEmpty(AvalAtheronChest)BethethorsChestAlias.ForceRefIfEmpty(BethethorsMerchantChestRef)BirnaChestAlias.ForceRefIfEmpty(BirnaChest)BrandChestAlias.ForceRefIfEmpty(BrandChest)PawnedPrawnChestAlias.ForceRefIfEmpty(PawnedPrawnChest)WhiterunFraliaChestAlias.ForceRefIfEmpty(WhiterunFraliaChest)SolitudeBitsAndPiecesChestAlias.ForceRefIfEmpty(MerchantSolitudeBitsAndPiecesChestRef)ArnleifChestAlias.ForceRefIfEmpty(ArnleifChest)GrayPineGoodsChestAlias.ForceRefIfEmpty(GrayPineGoodsChest)NiranyeChestAlias.ForceRefIfEmpty(NiranyeChest)endFunction
User avatar
Samantha Mitchell
 
Posts: 3459
Joined: Mon Nov 13, 2006 8:33 pm

Post » Wed Jun 20, 2012 1:05 am

Excellent! I was looking for something like this. Mind if I add this to my compatibility thread?
Also, you can reset all Alias at once by issuing a
Stop ()Utility.Wait (1)Start ()
Stopping it, will clear the Aliases of their references. Starting it will reinitialise them - with all the properties of the Alias that were set in the CK.
The same Script can Stop () and Start () itself.
User avatar
Josee Leach
 
Posts: 3371
Joined: Tue Dec 26, 2006 10:50 pm

Post » Tue Jun 19, 2012 5:17 pm

Hey, Chesko. Do you find the number of items in the vendor increase everyday? I find that when I clear Aliases, items are not removed from the reference of the Alias. And this is what I'm finding here. It may require clean-up before reforcing the Alias.
User avatar
Scott
 
Posts: 3385
Joined: Fri Nov 30, 2007 2:59 am


Return to V - Skyrim