MyNameIsnt Posted March 11, 2020 Posted March 11, 2020 I'm creating an adult mod where an aggressive NPC moves into the player's house. I'd like to setup a repeating approach system and here's what I've theory-crafted so far: Main approach quest starts at Stage 0. After an interval of 1-2 ingame days (preferrably random within that interval instead of just using RegisterForSingleUpdateGameTime) the quest stage is advanced to 10 and a forcegreet package kicks in. The forcegreet leads into a randomized dialogue path, where each path hooks into a "mini-quest". Once the mini-quest starts, the main quest is moved to Stage 10 to prevent repeating approaches, essentially soft-locking the NPC into just the mini-quest. Upon completion of the mini-quest, the mini-quest sets the main quest back to Stage 0, allowing the game time interval to run and repeat. The issues I'm having are: I don't have a good way to set a range limit for updating game time, it seems to be all or nothing. I feel like there are better ways to accomplish this without resetting quest stages.
Ruffled Pigeon Posted March 11, 2020 Posted March 11, 2020 No reason not to go with Quest stages, however, not needed either. As for the update, read into how gametime works on the CK Wiki if you are unfamiliar with it. Roll a random number between min/max, so for example 1/2, and then register for SingleUpdateGameTime with that number.
MyNameIsnt Posted March 12, 2020 Author Posted March 12, 2020 23 hours ago, Ruffled Pigeon said: No reason not to go with Quest stages, however, not needed either. As for the update, read into how gametime works on the CK Wiki if you are unfamiliar with it. Roll a random number between min/max, so for example 1/2, and then register for SingleUpdateGameTime with that number. Hey I appreciate you taking the time to reply. I think the solution I've found is to use Utility.RandomInt to roll a number between 1 and 2 and possibly store that number as a Global Variable. From there I can possibly use a simple if/else statement to call the Global Variable and assign the RegisterForSingleUpdateGameTime to either 24 hours or 48 hours. I'm thinking of using stages 0 and 10 of the main quest to accomplish this - stage 0 calls a random int and stores it, then stage 10 immediately uses the stored variable to run the update game time script. The reason I'm not using one stage is because I found that creation kit definitely plays nicer if you don't overload a single quest stage, at least in my experience.
Ruffled Pigeon Posted March 12, 2020 Posted March 12, 2020 1 hour ago, MyNameIsnt said: Hey I appreciate you taking the time to reply. I think the solution I've found is to use Utility.RandomInt to roll a number between 1 and 2 and possibly store that number as a Global Variable. From there I can possibly use a simple if/else statement to call the Global Variable and assign the RegisterForSingleUpdateGameTime to either 24 hours or 48 hours. I'm thinking of using stages 0 and 10 of the main quest to accomplish this - stage 0 calls a random int and stores it, then stage 10 immediately uses the stored variable to run the update game time script. The reason I'm not using one stage is because I found that creation kit definitely plays nicer if you don't overload a single quest stage, at least in my experience. Nothing wrong with that, albeit a bit overkill imo As for the Update, you could also just roll between hours, which would give you like anywhere between one and two days So for example event OnInit() // Or whatever actually starts your quest for the first time SetUpQuest() endEvent float function GetRandomEvenFloat return Utility.RandomInt(24, 48) as float // Using RandomFloat can give you stuff like 27.3 and the likes endFunction event OnUpdate() SetUpQuest() endEvent function SetUpQuest() // Set up your quest and stages or whatever here endFunction function MyQuestWasCompleted() // Called by a Papyrus Fragment in a dialogue of your Quest or whatever // Terminate your quest properly by setting stages or the likes RegisterForSingleUpdateGameTime(GetRandomEvenFloat()) endFunction Also I think Papyrus Scripts are Quest Stage independent I'm pretty sure, if you aren't talking about the Papyrus Fragments you can attach to Stages
MyNameIsnt Posted March 13, 2020 Author Posted March 13, 2020 9 hours ago, Ruffled Pigeon said: Nothing wrong with that, albeit a bit overkill imo As for the Update, you could also just roll between hours, which would give you like anywhere between one and two days So for example event OnInit() // Or whatever actually starts your quest for the first time SetUpQuest() endEvent float function GetRandomEvenFloat return Utility.RandomInt(24, 48) as float // Using RandomFloat can give you stuff like 27.3 and the likes endFunction event OnUpdate() SetUpQuest() endEvent function SetUpQuest() // Set up your quest and stages or whatever here endFunction function MyQuestWasCompleted() // Called by a Papyrus Fragment in a dialogue of your Quest or whatever // Terminate your quest properly by setting stages or the likes RegisterForSingleUpdateGameTime(GetRandomEvenFloat()) endFunction Also I think Papyrus Scripts are Quest Stage independent I'm pretty sure, if you aren't talking about the Papyrus Fragments you can attach to Stages I'm definitely thinking that this is the way to go since for some reason the main timer quest does not want to reset back to zero to run the timer again. It works fine the first time, repeat stages is enabled, and the script advances to the right stage but then it doesn't seem to like being set back to Stage 0.
MyNameIsnt Posted March 13, 2020 Author Posted March 13, 2020 Okay, while simply resetting the quest stage doesn't work, the solution I've figured out is to actually stop the timer quest until the mini quest is complete, then starting it again. This lets the timing script fire again and it works well. It's not a perfect solution but it works.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.