SteelBlood2 Posted July 31, 2015 Share Posted July 31, 2015 (edited) I'm just trying to make it where you have to clear Falmer out of a dungeon, and the quest doesn't advance until they are all dead. I'd also like the enemies to not spawn until a certain stage of the quest is hit. But I'm not quite sure how to do this, and the part that is giving me the most trouble is linking the leveled NPC to a quest. Edited July 31, 2015 by SteelBlood2 Link to comment Share on other sites More sharing options...
Aragorn58 Posted August 1, 2015 Share Posted August 1, 2015 (edited) I'm just trying to make it where you have to clear Falmer out of a dungeon, and the quest doesn't advance until they are all dead. I'd also like the enemies to not spawn until a certain stage of the quest is hit. But I'm not quite sure how to do this, and the part that is giving me the most trouble is linking the leveled NPC to a quest.I'm sure there is a more efficient way of doing this but here are a few scripts that I have used to increment the number of dead NPCs to advance a quest stage. (I'm sure using an array would be best but not quite sure how to do it I'm not very good at scripting) First attach this script to your quest Scriptname FI1Script extends Quest Conditional { change the script name to whatever you want} int Property DeadBandits Auto Conditional {change DeadBandits to whatever you name your aliases} {tracks how many bandits are killed} int Property TotalBandits = 5 Auto Conditional { change 5 to the number of aliases you need killed} {how many bandits do you need to kill?} function IncrementDeadBandits() DeadBandits = DeadBandits + 1 if DeadBandits >= TotalBandits setStage(65) {set this to the stage you want to set} endif endFunctionThen create another script and attach it to your NPCs Scriptname FI1BanditScript extends ReferenceAlias {change the script name to whatever you want} FI1Script myQuestScript {change FI1Script to whatever you name the script you attach to the quest} Event OnDeath(Actor akKiller) ; increment dead count myQuestScript = GetOwningQuest() as FI1Script {same as above} myQuestScript.IncrementDeadBandits() {change DeadBandits to whatever you name your aliases} endEvent Go to the quest stages tab in the CK and in any stage BEFORE the stage you want to set, and in the kmyQuest box use the dropdown to select the first script you created from here. ( ex. FI1Script) Now your quest stage will set when all the enemy NPCs are dead. To link the Leveled NPCs to your aliases select Specific Reference and not Unique Actor To get your enemies to spawn at a certain stage, set them as initially disabled, and the aliases as allow disabled and then in the proper quest stage enable them by using Alias_<AliasName>.GetReference().Enable() This is just an example of something I have used in the past, you may have to tailor it to your needs. Edited August 1, 2015 by Aragorn58 Link to comment Share on other sites More sharing options...
SteelBlood2 Posted August 2, 2015 Author Share Posted August 2, 2015 Thank you so much for the reply :) With this I will hopefully be able to continue working on my mod. Link to comment Share on other sites More sharing options...
Recommended Posts