FrankFamily Posted September 16, 2016 Share Posted September 16, 2016 In other words, can i use HasKeyword(X) to quickly identify spells? The wiki says "If the form doesn't support keywords, it will always return false" and spells don't have a keyword box like other forms, am i right guessing it will usse all the keywords of all it's magic effects? And, around the same idea, would GetNthKeyword give me the keywords in the order of the effect list (and the keyword order within them)? Link to comment Share on other sites More sharing options...
lofgren Posted September 16, 2016 Share Posted September 16, 2016 HasKeyword works as you describe. This also works for the keywords of magic effects on potions and enchantments and probably ingredients too. I've never tested the behavior of GetNthKeyword on a spell-type before. Link to comment Share on other sites More sharing options...
FrankFamily Posted September 16, 2016 Author Share Posted September 16, 2016 Thanks, did some testing and apparently GetNumKeywords doesn't work, i guess GetNthKeyword won't work either but even if it would getNth doens't have much use without GetNum. Tested on flames that has magicdamagefire,magicinfluence and magicinfluencefear across 2 magic effects. This script returned "0/success/success/success". A bit insonsistent that Has work but Get doesn't... ScriptName TEST_PlayerAliasScript extends ReferenceAlias Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) Spell MySpell = akBaseObject as Spell String KeywordList If (MySpell) int index = MySpell.GetNumKeywords() KeywordList += index as String while index index -= 1 Keyword Mykeyword = MySpell.GetNthKeyword(index) KeywordList += ", " KeywordList += Mykeyword.GetString() endwhile If MySpell.HasKeywordString("magicdamagefire") KeywordList += "/success" Endif If MySpell.HasKeywordString("magicinfluence") KeywordList += "/success" Endif If MySpell.HasKeywordString("magicinfluencefear") KeywordList += "/success" Endif EndIf Debug.Messagebox(KeywordList) EndEvent Link to comment Share on other sites More sharing options...
lofgren Posted September 16, 2016 Share Posted September 16, 2016 Well Get was added by SKSE, so it's probably related to that. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 16, 2016 Share Posted September 16, 2016 Get the magic effect with GetNumEffects and GetNthEffectMagicEffect from the spell first then run the GetNumKeywords and GetNthKeyword on the effect. The reason is that GetNumKeywords and GetNthKeyword work on the form calling it but not on any linked forms. Link to comment Share on other sites More sharing options...
FrankFamily Posted September 16, 2016 Author Share Posted September 16, 2016 Ah, i see, makes sense, thanks a lot :smile: Link to comment Share on other sites More sharing options...
Recommended Posts