CrypticModem Posted January 17, 2019 Share Posted January 17, 2019 Alright, so quick and easy anyone know how i would check if say these 5 NPC's, all of them were killed it would set a specific stage? Link to comment Share on other sites More sharing options...
SKKmods Posted January 17, 2019 Share Posted January 17, 2019 What is the trigger that causes the check the be made ? Link to comment Share on other sites More sharing options...
CrypticModem Posted January 17, 2019 Author Share Posted January 17, 2019 Im not exactly sure about that, or if i do i don't understand your question. Link to comment Share on other sites More sharing options...
Roadhouse699 Posted January 17, 2019 Share Posted January 17, 2019 (edited) If you want to have the stage set when the player kills them all, I actually made a script for that in Skyrim. Attach this to each NPC they need to kill and fill out those properties. Scriptname _JMCTotalKilledScript extends ObjectReference GlobalVariable Property KillCount Auto Int Property Objective Auto Quest Property OwningQuest Auto Int Property stage Auto Int Property MinimumKilled Auto Event OnDeath(Actor Killer) Float OldKillCount = KillCount.GetValue() Float NewKillCount = OldKillCount + 1 KillCount.SetValue(NewKillCount) OwningQuest.SetObjectiveCompleted(Objective) If NewKillCount == MinimumKilled OwningQuest.SetStage(Stage) Endif EndEvent Basically, you just need to make a global variable that's set to zero and fill that first property with it. Everything else is much more self-explanitory.Just give me credit if you upload the mod. Edited January 17, 2019 by Roadhouse699 Link to comment Share on other sites More sharing options...
CrypticModem Posted January 18, 2019 Author Share Posted January 18, 2019 Not sure how much of help this would be, i don't really understand the more confusing things of the creation kit like Global Variables. Do you know of a way i can do this without it or a tutorial i can watch to learn how to use Global Variables? Link to comment Share on other sites More sharing options...
DieFeM Posted January 18, 2019 Share Posted January 18, 2019 I would use RefCollectionAlias, the NPCs must have something, let's say a custom faction, that let you use it as condition for your collection, so only those NPC's fill the collection.Now you have a collection that contains the references of the NPC's that you want, so you can attach a custom script to it in which you can use the OnDeath event, once you receive this event you can use RemoveRef to remove this NPC from the collection.Just after removing the NPC form the collection you can use GetCount() to get how many references contains the collection, if it returns 0 then change the stage. Note that Events in RefCollectionAlias are the same ones that Actor and ObjectReference, but in the arguments of these events you must add an extra argument: ObjectReference AkSenderRef, as is explained at the bottom of this page: https://www.creationkit.com/fallout4/index.php?title=RefCollectionAlias_Script. Link to comment Share on other sites More sharing options...
Roadhouse699 Posted January 18, 2019 Share Posted January 18, 2019 I would use RefCollectionAlias, the NPCs must have something, let's say a custom faction, that let you use it as condition for your collection, so only those NPC's fill the collection.Now you have a collection that contains the references of the NPC's that you want, so you can attach a custom script to it in which you can use the OnDeath event, once you receive this event you can use RemoveRef to remove this NPC from the collection.Just after removing the NPC form the collection you can use GetCount() to get how many references contains the collection, if it returns 0 then change the stage. Note that Events in RefCollectionAlias are the same ones that Actor and ObjectReference, but in the arguments of these events you must add an extra argument: ObjectReference AkSenderRef, as is explained at the bottom of this page: https://www.creationkit.com/fallout4/index.php?title=RefCollectionAlias_Script.I think just using this with a global variable is so much simpler. Not sure how much of help this would be, i don't really understand the more confusing things of the creation kit like Global Variables. Do you know of a way i can do this without it or a tutorial i can watch to learn how to use Global Variables?Globals are actually very, very simple. They're literally just single numeric values that the game stores. You can find them in the CK Object Window under Miscellaneous -> Global. Just create a new one like you would with anything in creation kit, give it an appropriate ID, and hit "Okay". They're set to zero by default, so you don't need to change the value. Link to comment Share on other sites More sharing options...
Recommended Posts