PuddingFace1902 Posted July 25, 2021 Share Posted July 25, 2021 I was looking for a way to add the ImmuneParalysis keyword to the player when a certain spell is used. Not very experienced with Papyrus scripting. I was going to add the script to the magic effect that the spell would use. Any guidance anyone can give me regarding this will be very helpful. Thank you. I'v Link to comment Share on other sites More sharing options...
Ghaunadaur Posted July 25, 2021 Share Posted July 25, 2021 I think you have 2 options. 1. Papyrus Extender has 'AddKeywordToRef' and 'RemoveKeywordFromRef' functions.2. Or use a quest alias. For this method, set up a quest with a reference alias for the player, but leave it empty. Make sure to check the 'optional' flag and add the keyword to the alias. Then use following script on the magic effect, fill the properties. Scriptname SomeScriptName extends ActiveMagicEffect Actor Property PlayerRef auto ReferenceAlias Property PlayerAlias auto Event OnEffectStart(Actor akTarget, Actor akCaster) if (akTarget == PlayerRef) PlayerAlias.ForceRefTo(PlayerRef) endif EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) if (PlayerAlias.GetActorReference()) PlayerAlias.Clear() endif EndEvent Link to comment Share on other sites More sharing options...
PuddingFace1902 Posted July 25, 2021 Author Share Posted July 25, 2021 Thank you so much! BTW can this be used for NPCs as well? (akTarget == PlayerRef) this checks if it's the player right? So if I don't use it. It will work for NPCs too I'm guessing. Link to comment Share on other sites More sharing options...
Ghaunadaur Posted July 25, 2021 Share Posted July 25, 2021 No, that won't work. It would require to set up reference aliases for each currently affected NPC, so the number of possible affected NPCs would be limited to the number of available aliases. Link to comment Share on other sites More sharing options...
PuddingFace1902 Posted July 25, 2021 Author Share Posted July 25, 2021 Ah ok and can I use akCaster.ForceRefTo(PlayerRef) If I can't thant means I have to use the Papyrus Extender method right? Link to comment Share on other sites More sharing options...
dylbill Posted July 25, 2021 Share Posted July 25, 2021 I think on your spell's magic effect you can add the MagicParalysis keyword and check the Dispel Effects with These Keywords box. Link to comment Share on other sites More sharing options...
PuddingFace1902 Posted July 26, 2021 Author Share Posted July 26, 2021 The objective isn't to actually make them paralysis immune but knockdown immune. ImmuneParalysis can make you immune to knockdown. My objective is to make it so ward spells prevent knockdown. Link to comment Share on other sites More sharing options...
Ghaunadaur Posted July 26, 2021 Share Posted July 26, 2021 I just realized that the RemoveKeywordFromRef function is exclusive to the SSE version of Papyrus Extender.The LE version has a ReplaceKeywordOnRef function, which in theory could work too, but sadly it only lasts for the current game session. :confused: Sorry about the confusion. Unfortunately I can't think of a practicable way to add and remove keywords for random NPCs, at least for Skyrim LE. Link to comment Share on other sites More sharing options...
PuddingFace1902 Posted July 27, 2021 Author Share Posted July 27, 2021 Ok I'm going to keep trying. if only there was a way to see if the keyword is added or not. Thank you very much for your help. I'll keep posting my progress once I start making it. Link to comment Share on other sites More sharing options...
dylbill Posted July 27, 2021 Share Posted July 27, 2021 I think your best bet, at least without using skse, would be to do what Ghaunadaur suggested and use reference alias's. You can make maybe 30 or something. Once you make one you can duplicate them so it's not hard, and put them in an area for the spell to use. Make sure they have the Optional box checked. Example script: ReferenceAlias[] Property AliasList Auto ReferenceAlias Property UsedAlias Auto Hidden Event OnEffectStart(Actor akTarget, Actor akCaster) UsedAlias = FindUnusedalias() If UsedAlias UsedAlias.ForceRefTo(akTarget) Endif EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) If UsedAlias UsedAlias.Clear() Endif EndEvent ReferenceAlias Function FindUnusedalias() Int i = AliasList.Length While i > 0 i -= 1 If AliasList[i].GetActorRef() == None return AliasList[i] Endif EndWhile return None EndFunction Link to comment Share on other sites More sharing options...
Recommended Posts