JPSteel2 Posted August 4, 2018 Share Posted August 4, 2018 Hi guys, I'm creating a mod which adds an AI Package to some guards and need this package to be running each hour. This is a ForceGreet which is linked to a Dialogue (via a Quest). The guard comes to the player as soon as he is in his radius and plays the dialogue. Once finished, the guard should return to his starting location and wait at least an hour before replaying the dialogue, avoiding spam. What I tried : - Adding a condition in the AI Package for the quest to be below stage 30 to start running, and reseting it after RegisterForSingleUpdateGameTime(1) and OnUpdate() -> Reset(), Stop()/Start() and Stop()/SetCurrentStageID(10), nothing worked... - Adding a Script at the End of the AI Package using Utility.WaitGameTime(1) - Using OnMenuClos("DialogueMenu") to trigger an Utilility.WaitGameTime(1) Hopefully someone will have a better idea. I will continue my research and update if I find a solution Link to comment Share on other sites More sharing options...
JPSteel2 Posted August 5, 2018 Author Share Posted August 5, 2018 Ok so I spent the whole night trying to fix this and finally did it, here's the solution in case someone ever has the same problem : The key is to use the following condition GetQuestRunning in the ForceGreet AI Package, with the dialogue quest as parameter == 1 Then in the dialogue quest, add the script YourQuest.Stop() in the "End" Papyrus Fragment of the dialogue(s) which close the branch. Doing so will automatically stop the AI Package thanks to the condition we added to it. Now to restart the AI Package after one hour, add the following script in the "On End" Papyrus Fragment of the Package ("Begin/End/Change" tab) Utility.WaitGameTime(1) YourQuest.Start() The Script will thus wait one in-game hour before restarting the dialogue quest, reactivating in the same time the AI Package, again thanks to the condition "GetQuestRunning". Link to comment Share on other sites More sharing options...
Evangela Posted August 5, 2018 Share Posted August 5, 2018 Wouldn't it have been easier if you gave the package a schedule of 1 hour per day? Link to comment Share on other sites More sharing options...
JPSteel2 Posted August 7, 2018 Author Share Posted August 7, 2018 I just tried it but it doesn't work, the AI Package will just run indefinitely. Thanks for the idea though Link to comment Share on other sites More sharing options...
Recommended Posts