Set a quest stage after Killing X number of attackers

Post » Wed May 11, 2016 1:43 pm

SOLVED

Being stupid. When I filled the properties in the CK, I filled the DeadAttacker property the same as the TotalAttacker property, which when the game loaded it already had the DeadAttacker_var filled with the number of dead attackers, so when one was killed it automatically set the next stage, because the number was >= the the TotalAttacker.




I'm attempting to advance a quest after killing "x" number of attackers. I have used these two scripts in the past without issue, but for some reason they are no longer working as designed, and I don't know why.

I have placed this script on the actor


Spoiler



Scriptname RCDeadAttackerScript extends ReferenceAlias

RCQuest1Script myQuestScript

Event OnDeath(Actor akKiller)
; increment dead count
myQuestScript = GetOwningQuest() as RCquest1Script
myQuestScript.IncrementDeadAttacker()

endEvent





And this script on the quest


Spoiler



Scriptname RCquest1Script extends Quest Conditional


int Property DeadAttacker Auto Conditional
{tracks how many bandits are killed}

int Property TotalAttacker Auto Conditional
{how many bandits do you need to kill?}


function IncrementDeadAttacker()
DeadAttacker = DeadAttacker + 1
if DeadAttacker >= TotalAttacker
setStage(30)
endif
endFunction






After spawning the actors from a holding cell, they all appear where the are supposed to, but if only one of them are killed, the quest stage advances, when 7 are supposed to be killed before the next stage is set.

I have used this same setup in the past not just for actors, but when opening a certain number of doors. And it worked fine. I don't know what I'm missing. The only thing that is different is the actors are being moved form a holding cell and not placed in the world from the beginning.


All the properties have been filled, the first script is attached to several quest Aliases, it is a start game enabled quest and an SEQ file has been generated, due to some dialogue.

Been working on this for two nights and going crazy. :ahhh:



Any insight will be appreciated.

User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Return to V - Skyrim