thefinn Posted October 11, 2013 Share Posted October 11, 2013 I'm kind of a newb at scripting, and worse for skyrim, I learn best by looking through examples - and sometimes the exact example you need you just can't find. http://tesalliance.org/forums/public/style_emoticons/default/aa_wink.gif I currently have made an NPC who I wish to have sell various items. He works just fine and has his container works fine also. However, in order to not have to use master files, I decided to go with detecting mods that are installed and thereby changing the contents of his container based upon what mods the player has. So for instance if Midas magic were installed, perhaps he sells some spells from that mod.If Jaysus Swords are installed, perhaps he sells some daggers or whatever.(No I'm not really using these, it's just for the exercise). I am using as an example chesko's frostfall where he detects various armour packages to make them compatible and it seems fairly straight forward. The one issue I seem to have is finding a good example of an activator script for the container itself and how to add items to it (I am a little iffy on how to reference the container as the target of the created object). Or should the activator be on the actor, so that the container will change whenever someone talks to him? Perhaps someone has a new perk in destruction magic, and thus a few more spellbooks might need to be added to the container at that point. Perhaps something is already bought, and needs to be replaced, etc..(I'd like to avoid any papyrus lag doing that - I'm not sure of the best way). I'm certainly not asking anyone to do it for me, however, any examples you might point me to would be great. Any help appreciated. Link to comment Share on other sites More sharing options...
evenstargw Posted October 12, 2013 Share Posted October 12, 2013 Maybe a script on the actor with an event OnCellAttach. Whenever the player gets into the cell (or a nearby cell if it is outside) the event runs and you can do your thing. Add the container as a (auto) property to the script so you can add items to it from within the actor script. Link to comment Share on other sites More sharing options...
thefinn Posted October 13, 2013 Author Share Posted October 13, 2013 Yeah I have got it to work now. I just need to work out some of the finer points like getting it to run at game start, load game, etc.. Link to comment Share on other sites More sharing options...
Vamyan Posted October 13, 2013 Share Posted October 13, 2013 For the load game, you'll just need an OnPlayerLoadGame event in a script attached to a Reference Alias of the player. Link to comment Share on other sites More sharing options...
Recommended Posts