Disturbed_1 Posted January 12, 2015 Share Posted January 12, 2015 So, I'm working on my first papyrus script, trying to make a staff to kill NPCs. I've got the kill part down, but am now trying to mark them as unessential if they are THEN kill them. Scriptname DeathSpellSCR extends activemagiceffect ObjectReference property Victim auto Event OnEffectFinish(Actor target, Actor caster) ;This part works: If (target.isEssential()) Debug.Notification("This actor is essential and cannot be killed") ;This part throws an error: target.setEssential 0 EndIf target.Kill() EndEvent The error I'm getting is "No viable alternative at input 'setEssential'". Can anyone tell me what this means, and how to go about fixing it? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 12, 2015 Share Posted January 12, 2015 You are using SetEssential with the incorrect syntax. You have the console syntax rather than the papyrus syntax. See the wiki page: SetEssential Unlike IsEssential, SetEssential can only be run on the ActorBase and not the actor. So you'll have to obtain the ActorBase of the Actor before running it. Correct usage for your script:target.GetActorBase().SetEssential(false) Link to comment Share on other sites More sharing options...
Mattiewagg Posted January 12, 2015 Share Posted January 12, 2015 Just replace Kill with KillEssential(). :D Link to comment Share on other sites More sharing options...
Disturbed_1 Posted January 12, 2015 Author Share Posted January 12, 2015 On 1/12/2015 at 2:52 AM, Disturbed_1 said: So, I'm working on my first papyrus script, trying to make a staff to kill NPCs. I've got the kill part down, but am now trying to mark them as unessential if they are THEN kill them. Scriptname DeathSpellSCR extends activemagiceffect ObjectReference property Victim auto Event OnEffectFinish(Actor target, Actor caster) ;This part works: If (target.isEssential()) Debug.Notification("This actor is essential and cannot be killed") ;This part throws an error: target.setEssential 0 EndIf target.Kill()EndEvent The error I'm getting is "No viable alternative at input 'setEssential'".Can anyone tell me what this means, and how to go about fixing it? Thank you! That worked perfectly, except for on Balgruf and crew, but I've a hunch as to why that might be. Link to comment Share on other sites More sharing options...
Terra Nova Posted January 12, 2015 Share Posted January 12, 2015 Their essential status is being overridden by the essential flagged ticked for their Reference Aliases in their quests. Changing this through papyrus does nothing for those types of NPCs. Link to comment Share on other sites More sharing options...
Recommended Posts