Jump to content

Script to detect actor's death


flyddon

Recommended Posts

In the quest under Quest Stages tab, I have

on stage 37
(in the Papyrus Fragment)

 

NGIJPlayerNeutralThalmorIS.SetEnemy(PlayerFaction)
Alias_ThalmorISKeep.GetActorRef().startcombat(Game.GetPlayer())

Which causes the Thalmor and player to fight.

I want to move the stage to 40 once the Thalmor is killed.

Is there a script that would detect when the thalmor dies? if so does someone have that script that does that?
The Thalmor is UniqueActor and is the quest Aliases.

 

 

*UPDATE*

Never Mind figured it out

 

Event OnDeath(Actor akKiller)
if (akKiller == Game.GetPlayer())
NGIJ_SavingLN.SetStage(40)
endIf
endEvent

 

 

UPDATE to the UPDATE...

Does not work.

 

As soon as I speak to the Thalmor it apparently moves stage to 40 not upon his death... :sad:

 

 

So if anyone has any ideas.

Link to comment
Share on other sites

SO I know your just dying to know...

 

ok so 2 hours later...

 

I had placed the setstage to 40 in the "end" of the ForceGreet package (the dialog was only 2 lines) so as soon as I spoke to the thalmor it ran that ending script. That's why the stage jumped to 40.

 

2nd thing

 

This is the finial script that worked (I placed this script in the Actor's Papyrus Scripts area, just below the ID and name.)

 

Scriptname NGIJ_ThalmorDeath extends ObjectReference

ObjectReference Property ThalmorIS Auto

Quest Property NGIJ_SavingLN Auto

Event OnDeath(Actor akKiller)
if (akKiller == Game.GetPlayer())
Debug.MessageBox("I died by the player")
NGIJ_SavingLN.SetStage(40)
endIf
endEvent

 

 

This of course works when the player kills the NPC, I don't know if it will work if follower kills NPC.

  • Like 1
Link to comment
Share on other sites

Ooh!

 

It's a good job I don't allow followers in a certain part of my mod, if their actions are blamed on the player! I didn't know about that.

 

Come to think of it, I do have a pet Dwarven Spider that is allowed in there, though. It uses a levelled spell of Lightning Bolt that goes way over vanilla. At the top end it does 4x vanilla 'Chain Lightning' damage. I just hope none of my peaceful Falmer run between the little stealth spider and the Dwarven enemies!... dead friendly Falmer and bad outcome for the player, later in the quest...

 

... unless it doesn't count as a follower? It has its own framework, so isn't tied into anything vanilla.

 

Btw, I'd use 'PlayerRef' rather than 'Game.GetPlayer()'. It's way faster. In this instance, I think you're just calling it once, so it may not matter, but in my case there are 8 'Friendly Falmer' that could get killed in quick succession, if the player's daft enough to ignore the strict instruction not to kill them, written on a poster that they must look at in letters half a mile high! In that sort of situation definitely don't use 'Game.GetPlayer()'

Link to comment
Share on other sites

  • Recently Browsing   0 members

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