Jump to content

Photo

Quest not updating from script

creationkit skyrim special edition scripting modding

  • Please log in to reply
2 replies to this topic

#1
CrimsonLeader89

CrimsonLeader89

    Journeyman

  • Members
  • Pip
  • 27 posts

Hi,

 

I have a quest where the player goes to a civil war camp and kills all the soldiers there. The objective uses a copy of the system from the CW01A quest, from the Fort Hraggstad quest.

 

The objectives work and update as they're meant to, updating the markers as necessary however, once the npcs are dead the quest doesn't update it's objective.

 

The scripts are as follows:

Scriptname RSIQuestCampMasterScript extends Quest  Conditional

LocationRefType Property CWSoldier  Auto  

LocationAlias Property HaafingarCamp  Auto  

Int Property NextStage  Auto  

function checkLocRefTypeAliveCount()

	int aliveCount = HaafingarCamp.GetLocation().GetRefTypeAliveCount(CWSoldier)

	if aliveCount > 0

	Else
		
		;do nothing

			SetStage(NextStage)

	endif

EndFunction

This is the script for checking if the aliveCount is > 0, and if it is, it's meant to do nothing as there are still enemies alive. Once it equals 0 though, we're meant to set the stage to the NextStage (which I've set to 15)

;All soldiers killed

SetObjectiveCompleted(10)

SetObjectiveDisplayed(15)

Alias_COHaafingar.SetEssential(False)

This is for stage 15, so once the stage is set the previous objective is completed and the next one is shown. The commander is also set unessential as the next objective is to kill the commander.

Scriptname HaafStormcloakScript extends ReferenceAlias  

Event OnDeath(Actor akKiller)

	(GetOwningQuest() as RSICampMasterScript).checkLocRefTypeAliveCount()

EndEvent

All of the soldier alias's have this script attached to them, so when they are killed the checkLocRefTypeAliveCount() function is re-run.

 

Attached File  Screenshot.jpg   148.24KB   0 downloads

 

This image shows one of the soldier alias's (the rest are the same as they're just duplicated with a name and reference change)

 

Attached File  Conditions 1.jpg   23.08KB   0 downloads

 

This image shows the conditions on the objective (10) for the first soldier alias.

 

Attached File  Conditions 2.jpg   18.73KB   0 downloads

 

Finally, this image shows the condtions on the objective (10) for the rest of the soldier alias's.

I have no idea what, out of all of this is broken or if anything is. If anyone has any ideas, I'd be grateful. :smile:



#2
cumbrianlad

cumbrianlad

    Right turn, Clyde!

  • Premium Member
  • 963 posts

Just a comment:

 

This is really hard on the eyes. Put your images in spoiler text to shorten the post and take out all of those white empty lines! More people may then respond.

 

I think you may have an issue in that you are trying to 'kill' NPCs that are vanilla, for a start off. That's a bit of a no-no, imo. It could have serious consequences for the vanilla game. If you add a new camp, populate it with new NPCs and get the player to slaughter them, that would be much safer. If you do this, then tracking the dead count is fairly easy and should work. I'm guessing it won't update because of what you are trying to do to vanilla NPCs who are used in a vanilla quest.



#3
ReDragon2013

ReDragon2013

    Old hand

  • Members
  • PipPipPip
  • 511 posts

Typo with scriptname?

(GetOwningQuest() as RSICampMasterScript).checkLocRefTypeAliveCount()

RSIQuestCampMasterScript

Spoiler

 

wiki: https://www.creation...ount_-_Location

 

Hint: By using a dynamic filled quest alias you should check the "Optional" flag. Your refAlias conditions are out of the script, so they could be also a culprit.


Edited by ReDragon2013, 23 May 2020 - 09:18 PM.






Also tagged with one or more of these keywords: creationkit, skyrim, special edition, scripting, modding

Page loaded in: 1.083 seconds