Jump to content

Items and merchants


MrStolen

Recommended Posts

Hey guys, I'm making my thesis and its about improving the interaction with merchants in RPGs.



With that said i already have a sketch of a model that I want to implement as a mod for skyrim but I have 2 questions that I haven't found answers yet.



1. Is it possible to change the items that are in a container dynamically, based on other variables other than the player level? I am aware of leveled items and chars, but I want to know if there is any easy way of making the vendor sell you different items based on other variables like the most leveled attribute you have for example.



2. Related with the first question, is It possible to change the container that a vendor is linked to in run-time? This is a possible work around the first problem I wrote above, but I think that this is another problem all by itself. The idea was to change the container that is linked to the merchant based on (again) attributes like if you have the 1 handed maxed out.



Thanks in advance guys!


Link to comment
Share on other sites

Dynamically changing items in a seller's container is tricky business because the game refreshes the container every so often. You can change what container the vendor is linked to ONLY by changing their vendor faction. If you for instance copy their chest and create a new faction (MyVendorFaction1 for example) and change the ownership of that container to the faction. Then the faction itself you want the vendor tab to point to the container. If you want the item always sellable, you can simply add it to the MyVendorFaction1 container, but if you want it only sold once, you should place it in their actual shop as owned by the MyVendorFaction1 faction and make it disabled. Then you would set up a quest that starts enabled and when the quest loads on game start have it registerforupdate(24) (or whatever number of hours you want it to re-check). Then you can set up whatever conditions you could image under the OnUpdate() event in the script which will check for gender, day of the month, weather outside, proximaty of a specific NPC, or whatever in the world you could possibly want as a condition. When the condition is met you can have the quest remove the vendor from his original seller faction and add them to your custom one, hence making the item available. Also Enable said item in the quest script as well. You can then make copies of the vendor chest and copies of the vendor faction for each special item you want to have conditionally available.

 

Another method would be instead of messing with vendor factions and all that you can just have the quest check for the conditions you want for making the item available and then simply change it's ownership setting via script to match the NPC's seller faction, and enable said item.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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