EilaDoll Posted September 17, 2016 Share Posted September 17, 2016 So, I'm working on a mod that is basically another "You can learn any enchantment and put it on anything" mod but mine has an MCM Menu where you can choose if you can disenchant Daedric artifacts and Amulets (Later Aetherial too), I figured that out on my own through lots of googling and research. The problem I've got is this... I have never scripted in Papyrus before so... I have no idea how to set the "Worn Restriction" property of an enchantment via code, and I have no idea how to remove/add the "DisallowMagicEnchanting" Keyword from an item... Any advice would be helpful. Right now, all I have is: ScriptName MoreEnchantOptMCM extends ski_configbase GlobalVariable Property MoreEnchOpt_LearnDaedric Auto GlobalVariable Property MoreEnchOpt_LearnAmulet Auto GlobalVariable Property MoreEnchOpt_EnchEverywhere Auto event onPageReset(string page) SetCursorFill(TOP_TO_BOTTOM) AddToggleOptionST("OPTION_lEARNDAEDRIC","Learn Daedric", MoreEnchOpt_LearnDaedric.GetValue() as Bool, 0) AddToggleOptionST("OPTION_LEARNAMULET", "Learn Amulet", MoreEnchOpt_LearnAmulet.GetValue() as bool, 0) AddToggleOptionST("OPTION_ENCHEVERYWHERE", "Enchant Everywhere", MoreEnchOpt_EnchEverywhere.GetValue() as bool, 0) endEvent state OPTION_LEARNAMULET event OnSelectST() MoreEnchOpt_LearnAmulet.SetValue(!MoreEnchOpt_LearnAmulet.getValue() as Bool) as Float) SetTextOptionValueST(MoreEnchOpt_LearnAmulet.GetValue() as Bool) if(MoreEnchOpt_LearnAmulet) { DA02EnchPoisonCloak.GetPro } endEvent event OnHighlightST() SetInfoText("Select this option to be able to disenchant amulets such as Amulet of Akatosh.") endEvent endState state OPTION_LEARNDAEDRIC event OnSelectST() MoreEnchOpt_LearnDaedric.SetValue(!MoreEnchOpt_LearnDaedric.GetValue() as Bool) as Float) SetTextOptionValueST(MoreEnchOpt_LearnDaedric.GetValue() as Bool) endEvent event OnHighlightST() SetInfoText("Select this option to be able to disenchant Daedric artifacts.") endEvent endState state OPTION_ENCHEVERYWHERE event OnSelectST() MoreEnchOpt_EnchEverywhere.SetValue(!MoreEnchOpt_EnchEverywhere.GetValue() as Bool) as Float) SetTextOptionValueST(MoreEnchOpt_EnchEverywhere.GetValue() as Bool) endEvent event OnHighlightST() SetInfoText("Select this to place any learned enchantment on any item. (Note: Does not allow weapon enchants on armor or vice versa.") endEvent endState Link to comment Share on other sites More sharing options...
palingard Posted September 18, 2016 Share Posted September 18, 2016 Ok, you have the MCM options to select and set the Globals. What are you doing with the globals? Sorry, not sure what question you are asking associated with this code snippet. Link to comment Share on other sites More sharing options...
NexusComa Posted September 19, 2016 Share Posted September 19, 2016 W e l l .... this one drove me a bit crazy ... It would seem the only real way to do this would be to simply remove the keyword DisallowMagicEnchanting to ALL the forms in the game you wish to use this on. Link to comment Share on other sites More sharing options...
cdcooley Posted September 20, 2016 Share Posted September 20, 2016 Yes, neither the game itself nor SKSE provide any way for scripts to modify keywords or that enchantment property. I seem to remember some experimental SKSE plugin that did something with extra keyword support, but don't remember which one and a quick search didn't find it. Link to comment Share on other sites More sharing options...
NexusComa Posted September 20, 2016 Share Posted September 20, 2016 (edited) You can do it with an alias ...But as for the keyword that is already there "DisallowMagicEnchanting"You can't change that via script ... so the only way left is to do it manually.Still very doable ... just will take some time. Edited September 20, 2016 by NexusComa Link to comment Share on other sites More sharing options...
lofgren Posted September 20, 2016 Share Posted September 20, 2016 You can change the DefaultObjectManager entry that determines which keywords prevents disenchanting by script (Keyword - Disallow Enchanting). But I think he is saying that he already knows how to prevent the disenchanting of specific items. He's just trying to figure out how to write the MCM script. Link to comment Share on other sites More sharing options...
blennus Posted September 20, 2016 Share Posted September 20, 2016 Yes, neither the game itself nor SKSE provide any way for scripts to modify keywords or that enchantment property. I seem to remember some experimental SKSE plugin that did something with extra keyword support, but don't remember which one and a quick search didn't find it.The SKSE plugin in question is DienesTools and the function is: ReplaceKYWD(Form akForm, Keyword akToReplace, Keyword akToAdd) I've never tried using it, but from what I understand it only replaces pre-existing keywords with your own. This means you can remove the DisallowMagicEnchanting keyword if you wish, by replacing it with a new meaningless keyword, but you can't add it to items without it in the 1st place, unless you replace an important pre-existing keyword, so I don't think it would be of much help. Link to comment Share on other sites More sharing options...
lofgren Posted September 20, 2016 Share Posted September 20, 2016 (edited) Well he is only talking about removing a keyword, so that should work just fine. And now I am quite curious. EilaDoll, did you use DienesTools or some other method? Edited September 20, 2016 by lofgren Link to comment Share on other sites More sharing options...
Recommended Posts