Jump to content

Need scripting advice/help for my mod - Enchanting Vendors


elite403

Recommended Posts

Another solution (which would work for smithing and alchemy as well) would be to create a custom script for each blacksmith (lots of copy/paste because you'd only be changing a few lines for each one) which will do the following:

Check to see if the player has the Commission Fee (higher for better vendors)
Store player SkillLevel in a variable.

Check if the player has each perk in the relevant tree, storing 1 (true) or 0 (false) in each variable.

 

Disable leveling. (because a level 1 character getting a 60 -> 61 skill increase would suck)

 

Set player's SkillLevel to whatever the Craftsman's relevant crafting skill is (this is why custom script for each, or use a formlist and get their skill level dynamically if you're cool like that).

Add all of the perks that Craftsman has to the player.

For enchanting or alchemy, adding knowledge of enchantments/ingredient intrinsics and removing them again afterward may or may not be possible. I have not investigated this.

 

Open the requested crafting menu. (this is done by having a UNIQUE crafting station in a separate cell, and activating it. The player is teleported to the nearest crafting station if you reference the default one while in a cell where one exists)

 

Example:
Player: Do you do commissioned enchanting, if I provide the materials?

Farengar: <Generic 'Yes' dialogue>
(above script)

 

When the menu is closed, the script checks to see if an item was made. If it was, the Commission Fee is removed from the player.

I think the way you'd have to do that is to actually run a second script while under the influence of the NPC's skills that detects if an item is created or not. However, I'm not sure.

 

Lastly, when the script terminates, remove perks the player didn't already have, re-add perks the player had that the NPC did not, reset the skill level back to what it was, and re-enable leveling.

 

I'm about 95% sure this will work.

Link to comment
Share on other sites

@dwiss
Heh yeah dissect that mod and see how he does the enchanting :smile: Thanks, I may just do that. Right now this mod is "shelved" cuz I hit another snag with weapons and just decided to "take a break" from this mod for a bit.

@AvelonHellfyre
Hmmm very interesting method. I will indeed study (and learn) how to do what you have suggested. I never actually thought about swapping skills with the NPC :smile: Much thanks for the idea! Even if I can't achieve what you have suggested I may adapt some elements and use them...

Edited by elite403
Link to comment
Share on other sites

Even if you enchant the base object, it cannot apply retrospectively to earlier saves. Try quitting and restarting Skyrim, then load the earlier save first and see if the armor is enchanted. If it isn't, then that would point to some sort of bug caused by loading an older during a current game in which you have applied the enchantment.

Edited by steve40
Link to comment
Share on other sites

  On 4/4/2013 at 12:52 PM, elite403 said:

@dwiss

Heh yeah dissect that mod and see how he does the enchanting :smile: Thanks, I may just do that. Right now this mod is "shelved" cuz I hit another snag with weapons and just decided to "take a break" from this mod for a bit.

 

@AvelonHellfyre

Hmmm very interesting method. I will indeed study (and learn) how to do what you have suggested. I never actually thought about swapping skills with the NPC :smile: Much thanks for the idea! Even if I can't achieve what you have suggested I may adapt some elements and use them...

Cool. =) If you get it running, please do PM me as it's a feature I'd love to have. I'm slowly learning Papyrus so if the project remains on hold for a while I might take a stab at implementing it myself. Currently working on a better unlock spell and orbless light and hitting snags everywhere, so it'll probably be a while! :P

Link to comment
Share on other sites

@AvelonHellfyre
Sure, go ahead and have a go :smile: I have been thinking about your idea, and thinking maybe I should just simply swap skills with NPCs and using the nearest crafting station (not necessarily a unique station somewhere else). In this case I'd need to add the skills and perks to a new NPC so as not to touch vanilla stuff then have the player swap with this NPC and then using the station all done via script. Need to play around a little bit more but yeah as of right now I'm not really "working on it". Plus, if you get it up and running before I do, I can just use your mod (should you decide to release it) and save myself the headache :)

 

@steve40

Yeah the older save will show the item as enchanted unless Skyrim is restarted. It behaves the same way for my "test" character as well as regular ones I play Skyrim with. If I quit Skyrim then restart and reload the older save then it will not be enchanted before I talk to the vendor. Load order and number of mods doesn't matter - my "test" character runs only with SkyUI and SKSE and the Unofficial Patches.

Edited by elite403
Link to comment
Share on other sites

  • Recently Browsing   0 members

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