Jump to content

Photo

AddKeyword Not Working?

scripting addkeyword

  • Please log in to reply
2 replies to this topic

#1
HeirOfTheSeptems

HeirOfTheSeptems

    Old hand

  • Members
  • PipPipPip
  • 536 posts

So I'm trying to make an effect that adds a keyword to any weapons and armor added to the player's inventory while its active. Here it is:

 

Scriptname MyScript extends activemagiceffect 

Keyword Property SpecialKeyword  Auto

Event OnItemAdded(Form AkBaseItem, int aiItemCount, ObjectReference AkItemReference, ObjectReference AkSourceContainer)
  If(AkBaseItem As Weapon)||(AkBaseItem As Armor)
   AkItemReference.AddKeyword(SpecialKeyword)
  EndIf
EndEvent

 

When I try to compile it I get:

"AddKeyword is not a function or does not exist"

 

 

AkItemReference is an ObjectReference, so shouldn't it work fine? or am I missing something obvious?

 

I don't really want to have to use an alias to do this

 

Does anyone know what's going on? Any help would be appreciated.


Edited by HeirOfTheSeptems, 09 August 2020 - 03:52 PM.


#2
IsharaMeradin

IsharaMeradin

    The Pale Redguard

  • Members
  • PipPipPipPipPip
  • 8,975 posts

AddKeyword is not a function native to Skyrim.  It is, however, added to Papyrus for Fallout 4

Skyrim Papyrus wiki page

Fallout 4 Papyrus wiki page

 

I do not know if there are any third party script extenders that allow adding keywords via script function.  I couldn't find anything within SKSE when looking. I read something about a MESKSEUtils at loverslab that had such a function, but the LL site is currently down at the time of posting and thus I cannot verify.



#3
HeirOfTheSeptems

HeirOfTheSeptems

    Old hand

  • Members
  • PipPipPip
  • 536 posts

Crap.. Is there any way I could Identify the specific pieces of equipment? Formlists only hold base objects, so that wouldn't work, but is there anything like that that I could do? I just need a way to let a perk know which pieces were added during this time.


Edited by HeirOfTheSeptems, 09 August 2020 - 04:55 PM.






Also tagged with one or more of these keywords: scripting, addkeyword

Page loaded in: 1.077 seconds