Jump to content

[LE] How to make essential NPC talk-able to after being defeated?


Byeoh

Recommended Posts

I didn't explain this the best in the title, but basically what I want to do is make is so that there is an enemy you have to defeat which is essential, and after "killing" them which is when they go into that kneeling sort of position that they will become unaggressive, talk-able to, and be able to talk to them and ask them questions, before eventually saying "Time for you to die" and then being able to kill them, all while having the NPC stay on the ground.

 

This is what I have been trying to do:

 

I have added a script to the NPC which is as follows:

 

Event OnDying(Actor akKiller)

rsbioreeseproperty.SetObjectiveDisplayed(40)
rsbioreeseproperty.SetStage(40)
EndEvent
I used OnDying in place of OnDeath, but it seems to work identical to OnDeath, and doesn't trigger when you defeat an essential NPC. (rsbioreeseproperty is the name of the property which is linking to the quest)
The reason I did this is that so for stage 40 I could make it so that the NPC would be set to stop attacking (not sure how I would do that, I did experiment with making them an ally by adding them to a faction, but got nowhere), and stop the NPC from regenerating health and getting back up, allowing the player to talk to them and initiate the dialogue which would allow the player to kill the npc. (I've considered using "NPCNAME.SetNoBleedoutRecovery(true)" as a way to stop them from not getting up, I'm not sure if this works or not, or if it's even remotely correct).

 

Using "akspeaker.GetActorBase().SetEssential(false)" to make them unessential after saying a piece of dialogue, which is working.

 

I'm not sure if I'm going about this the right way, am I pretty new to the creation kit and papyrus coding, and most of this is just me guessing and trying to use and piece together other parts of the code to create a working code that does what I need it to. I don't mind how I can get this to work, as long as I get the end result that I want then I am satisfied, so if I am going about this the completely wrong way, please tell me a completely different method of completing what I am attempting to do here if it is necessary to do so.

 

One more thing to note, not sure if this matters or not, but before he attacks you there is a forcegreeting dialogue which leads to the player saying something making him attack you. This works perfectly fine and does not run more than once, so it shouldn't be an issue, but in case that in some way would be I figured to mention it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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