Jump to content

[LE] Need help adding items to a merchant


Recommended Posts

I'm working on a mod that will add many new daedra summons, along with a lot of other spells.

 

As for the daedra summon spells, I want them to be sold by an NPC, but only a portion of the spells are available at first.

I think it'd work if I used a quest alias for each tome, and then at the stage I want, add some of them into the merchant's chest.

But that's A LOT..... This isn't just 1 or 2 spell tomes, it's a pretty big number (less than 50, don't get excited). but it's more aliases than I care to make..... So I'm hoping someone can tell me a different way to do this easily (I'm not the most advanced modder lol)

 

I have very, very little experience with merchants. I'm going to have to go look how to set up the chest/factions after I post this so I can create the merchant lol. And every merchant I've ever made, just has a specific stock, not a growing stock like I'm trying to achieve now.

 

 

The quest works like this:

Initially, novice & apprentice summoning spells are available in the shop. This is "Group A".

After a certain stage of the quest, I want to add another handful of spell tomes to the merchant's shop, making both Group A & Group B available for the player to buy.

After a later stage in the quest, I want to add yet more spell tomes to the merchant's shop, Group C. I want the merchant to now be selling Group A, Group B & Group C spell tomes.

 

 

EDIT:
I should have looked at the merchant guide first. Looking at that, I think instead of quest aliases, I can just create 3 different chests and 3 different factions.

1 chest with Group A tomes.
1 chest with Group A & B tomes.
1 chest with Group A, B & C tomes.

1 merchant faction with the sale chest being Group A chest.
1 merchant faction with the sale chest being Group A&B chest.
1 merchant faction with the sale chest being Group ABC chest.

And the quest stages just add/remove the merchant factions from the NPC to change which chest the stock is coming from.


To whoever sees this: If this is a really crappy way to do it, let me know, and I'll go back to it and implement something better. :)

Edited by saintgrimm92
Link to comment
Share on other sites

I finally got around to testing this. It just doesn't work....

Quest Stage 50 Dialogue end: Sets stage 55. Works correctly. Correct objectives complete/display.

Quest stage 55 fragment:

(alias_kazarvel.getreference()as actor).RemoveFromFaction(MerchFact01)
(alias_kazarvel.getreference()as actor).AddToFaction(MerchFact02)
SetObjectiveCompleted(50)
SetObjectiveDisplayed(55)

But the NPC still only sells the items in the first chest.

I've checked the merchant factions, they point to the correct chests. Faction properties on quest are filled properly. Checked to make sure the chests had the correct books in them.

I'm not even sure how he still has access to the tomes in the first chest when the faction that tells him to sell items from it has been removed.

Tried leaving and coming back to see if it's a cell load thing and he still only sells the merchfact01 tomes.


Same result on all other quest stages that remove and then add a new faction to the NPC. He just doesn't start selling out of the chest his new faction is pointing to, only the items from the 1st factions chest.

Link to comment
Share on other sites

Try a single chest with leveled lists to control its contents. If you want the chance of items to change based on the player's level, just using leveled lists should work. If you want to have the contents change based on a quest stage, I believe you can use AddForm to add items to the leveled list.

Link to comment
Share on other sites

Try a single chest with leveled lists to control its contents. If you want the chance of items to change based on the player's level, just using leveled lists should work. If you want to have the contents change based on a quest stage, I believe you can use AddForm to add items to the leveled list.

 

I'll try that either later this evening or tomorrow and report back. Thank you :)

 

I've rarely used leveled lists, but it is something I've done. Kinda. I've done it for NPC enemy drops, never for containers, but I can't imagine it'd be very different. It is through a quest stage though.

 

-

 

I did a little more testing this morning before I left. It seems the stock only changes after some time has passed. I wasn't testing for that specific thing, so I have no idea how much time. So the faction adding/removing tactic does seem to work in general, but I need it to be an instant thing, so it's just not the best option for what I'm doing personally.

 

 

Do you happen to know off-hand if items added to a leveled list through addform will appear in the shop instantly or if it'll take awhile? I'm not sure, but my assumption is that my method is waiting until the "restock" period to change stock, and I'm needing the items to appear in the NPC's shop the moment he says they're available.

 

Link to comment
Share on other sites

I'm not sure about the items in the chest. Have you tried adding the items directly into the merchant's inventory? That should be instantaneous and items of the type the merchant can sell and not equipped I believe will show up in the vendor list.

 

I haven't. I'd never heard of this before. Do I need to change the faction's sell container to the NPC to make that work?

 

If just adding the items though I could probably also just add them to the chest? I was hoping to avoid adding a property for every tome, but if it's the only way to get it to show up when I need it to, I can.

 

I haven't tried implementing the leveled list just yet. I'm pretty sure it works in a way that I could add an entire leveled list to the chest in a quest stage? I'll try that route first. But if it doesn't work like I'm expecting, I'll try just adding them individually to see if that's instant.

 

 

EDIT:

Quick test, adding the items to the chest works for sure.

Edited by saintgrimm92
Link to comment
Share on other sites

  • Recently Browsing   0 members

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