Jump to content

Recommended Posts

Posted

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


Posted

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

 

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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 
  • Recently Browsing   0 members

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