Jump to content

How to properly kill an NPC through dialouge?


Recommended Posts

Hey fellas, got a problem I could use some help with.

 

I need an npc to just drop dead when they finish a specific topic. So far I've checked the CK Wiki, and sadly didn't find anything especially detailed. I tried following the instructions on the wiki, but it left out a few important details regarding properties.

 

So far, the papyrus fragment for the dialogue looks like this.

 

Game.GetPlayer().Additem(AAADockKey, 1)

 

Marious.Kill(Player)
I was wondering if anyone might have some advice on where to go from here? Every time I try to compile the script it fails on me.
Link to comment
Share on other sites

Right now the error reads as follows-

 

Starting 1 compile threads for 1 files...
Compiling "TIF__060C24B7"...
E:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__060C24B7.psc(38,15): script property Kill already defined
E:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__060C24B7.psc(38,15): script variable ::Kill_var already defined
E:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__060C24B7.psc(38,15): script property Kill already has a get function defined
E:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\TIF__060C24B7.psc(38,15): script property Kill already has a set function defined
No output generated for TIF__060C24B7, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__060C24B7
Link to comment
Share on other sites

Sorry for the wait! Here's the full psc

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 3
Scriptname TIF__060C24B7 Extends TopicInfo Hidden
;BEGIN FRAGMENT Fragment_2
Function Fragment_2(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
Game.GetPlayer().Additem(AAADockKey, 1)
;END CODE
EndFunction
;END FRAGMENT
;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
GetOwningQuest().SetObjectiveDisplayed(20)
GetOwningQuest().SetStage(20)
Marious.Kill()
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
Key Property CidhnaMineJailKey Auto
Key Property BattleBornFarmKey Auto
Key Property AAADockKey Auto
Int Property DIe Auto
Actor Property Kill Auto
Actor Property Kill Auto
Link to comment
Share on other sites

If you're trying to kill Marious, you should have Actor Property Marious Auto. Kill is the function and should not be a property. You also have the Kill property twice which is why you get the "script property Kill already defined" error, but as I said it shouldn't be a property at all.
Link to comment
Share on other sites

Yeah whole bunch of garbage properties there. A few notes:

1. Script name. Leaving a name like TIF__060C2487 is asking for trouble. The way CK does things, it is entirely possible you already got a TIF__060C2487.psc/pex from either one of your own or some other mod. Add something to it. I.e. TIF_m1_060C2487.psc

 

2. No idea how all those properties ended up in there, ( could be result of script name conflict) but anything not used should be removed.

The ONLY property you really should have in that script is:

Key Property AAADockKey  Auto
3. If you want to kill the actor who says the dialogue line this script is attached to, you need, instead of Marious.Kill():

akSpeaker.Kill()
And make sure that script fragment is set to invoke at the end of dialog line.

Or, potentially: In the properties:

Actor Property PlayerRef Auto
In the fragment :

akSpeaker.Kill(PlayerRef)
And once script is cleaned up, renamed and compiled, make sure to click Properties button and verify the properties are filled in correctly.
Link to comment
Share on other sites

I can't seem to add new properties to the script at all now, each time I close the box the new actorbase property I've added simply doesn't take root. What am I doing wrong?

(Sorry again for my weak response times. Work has been a real ball-cracker lately and I haven't had time to check in on the nexus)

Edited by bananakillerBRO
Link to comment
Share on other sites

So, a few things to be aware of working with script fragments.

 

1. Before doing anything, put only a semicolon ; in the fragment and then compile. This will initialize and link the script fragment to your dialogue, quest or what have you.

 

2. Only add or remove properties with the creation kit, not in the source script directly.

 

3. Renaming the script fragment is a good idea, but again only do this in the creation kit, there's a button that allows you to rename the script fragments.

 

I would completely delete your dialogue in the creation kit and delete the script (source .psc and .pex files) and redo it with this in mind.

Link to comment
Share on other sites

I FIGURED IT OUT!!!

So, while pondering my issue some more I remembered that there's an NPC who dies after closing dialogue in Ill Met by Moonlight. So I did some digging in that quest and found the exact fragment I needed to kill my actor. I just had to replace the reference and put the fragment in QUEST STAGES, not in the topics section.

 

The fragment is- Alias_Marious.GetActorReference().Kill()

Link to comment
Share on other sites

  • Recently Browsing   0 members

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