Triggering a script at the end of the Civil War

Post » Thu May 15, 2014 12:28 am

I have a script I want to execute once at the end of the Civil War quest. The problem is, I am not sure how best to trigger the script/call the event.

I have a few ideas, but the least intrusive way I can think of is to attach the script to an NPC dialogue response that is conditioned to only play after either Ulfric or Tullius is dead. The problem is that if the dialogue response is never said (if the player never talks to that NPC, for instance), then the script will never execute (although I suppose I can attach the script to one of the 'victory speech' dialogue). So I am looking for something more...'consistent', if you know what I mean. Any ideas?

User avatar
Ebony Lawson
 
Posts: 3504
Joined: Fri Feb 16, 2007 11:00 am

Post » Wed May 14, 2014 10:00 pm

Put a trigger box(OnTriggerEnter event) around the area the NPC is in, and have it conditioned to check if the CW quest has ended(based on which is dead, or the if the last stage in CW questline has completed) each time the player walks through it. You can have a force greet to associate with this too if you want..

That's what I would do.

User avatar
butterfly
 
Posts: 3467
Joined: Wed Aug 16, 2006 8:20 pm

Post » Thu May 15, 2014 9:41 am

Thanks for the suggestions. I've considered a trigger box, and I've also considered using OnCellLoad to check if Ulfric/Tullius are dead (and which one) when the player enters a particular cell. Ideally though, I just want the script to execute after either of them dies, without the player having to talk to anyone or do anything.

User avatar
CRuzIta LUVz grlz
 
Posts: 3388
Joined: Fri Aug 24, 2007 11:44 am

Post » Thu May 15, 2014 3:54 am

Hmm.. in that case, you can probably add them as aliases to your quest, and check "Allow Reserved" assuming that's possible and give them ReferenceAlias scripts with OnDeath events.

User avatar
Ross Thomas
 
Posts: 3371
Joined: Sat Jul 21, 2007 12:06 am

Post » Wed May 14, 2014 11:01 pm

Ah....yes....that's what I am missing. Thanks!

User avatar
vanuza
 
Posts: 3522
Joined: Fri Sep 22, 2006 11:14 pm

Post » Thu May 15, 2014 12:20 am

Hmm....doesn't seem to be working. I've specified UlfricRef as an alias in the quest, and attached this script.

Scriptname StuffHappensScript extends Quest  ReferenceAlias Property UlfricAlias Auto Event OnDeath(actor akKiller)If UlfricAlias.GetActorReference().IsDead() {a bunch of simple things happen, blah blah}EndIfEndEvent

The script compiles fine and property is filled, but after I test in game (by killing Ulfric), none of the changes I want to execute happens.

User avatar
Jason Rice
 
Posts: 3445
Joined: Thu Aug 16, 2007 3:42 pm

Post » Thu May 15, 2014 8:05 am

I hope by specific as an alias, you mean added Ulfric as an alias to your quest(Alias tab). Also I said before "if possible" because I don't know if they are "locked" into their vanilla quest(allowed reserved wont work for some NPCs). It is a imo a great alternative to not having to directly edit vanilla quests and their aliases if your own quest is going to branch off from it in some way.

Anyhow, you can put this on Ulfric and Tullius:

This doesn't cover the situation where someone might kill both of them.. haven't figured out how to script around that.

Scriptname StuffHappensScript extends ReferenceAlias   Event OnDeath(Actor akKiller)  ;Stuff you want to happen with your quest/NPC here. Like GetOwningQuest().Setstage(xx)EndEvent 
User avatar
Samantha hulme
 
Posts: 3373
Joined: Wed Jun 21, 2006 4:22 pm

Post » Wed May 14, 2014 10:49 pm

Yup. And yes it is grayed-out for 'Starts Enabled' quests. But apparently (at least according to the wiki), if that box is checked, all aliases in the quest are treated as if 'allow reserved.'

I am not concerned about that. It's not possible during 'normal' gameplay since their essential flags aren't removed until their respective 'final confrontations.' If a user is going to mess with the console or the CK to disable their essential flags, I am not responsible. :smile:

I should clarify: the reason I didn't simply use

Event OnDeath(Actor akKiller)  ;Stuff happensEndEvent

is because 'stuff happens' include things happening to a number of other actor refs, whose property I defined in the same script. So 'OnDeath(Actor akKiller)' wouldn't specify which actor it was whose death would trigger the 'stuff happens' part. That's why I added the 'GetActorReference().IsDead()', sorry for the confusion.

Hmm...maybe I am going about this the wrong way than what I originally intended. How do I do this without attaching a script to either Ulfric or Tullius? What if I attach that script to the quest, then have their deaths set different quest stages, then attach 'stuff happens' as script fragments to those quest stages? Would that work?

User avatar
Alberto Aguilera
 
Posts: 3472
Joined: Wed Aug 29, 2007 12:42 am


Return to V - Skyrim