Jump to content

New to Scripting. Could use some help with something.


EilaDoll

Recommended Posts

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

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

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

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

  • Recently Browsing   0 members

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