antstubell Posted September 26, 2020 Share Posted September 26, 2020 This timer sets NPC's quest to 40, which in turn allows a conditioned (GetStage Quest == 40) package to be run. NPC doesn't wait. Float Property TimeToPass AutoQuest Property MyQuest AutoInt Property StageToSet AutoFunction MyTimer()RegisterForSingleUpdateGameTime(TimeToPass)EndFunctionEvent OnUpdateGameTime()MyQuest.Setstage(StageToSet)UnregisterForUpdateGameTime()EndEvent Name of script - My_Timer_SetQstStagePropertiesTimeToPass = 0.5StageToSet = 40Quest = Name of the quest this timer script is in. Stage 30 papyrus fragment -Debug.Notification ("timer started")kmyquest.MyTimer() Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 26, 2020 Share Posted September 26, 2020 What do you mean by "the NPC doesn't wait"? Are you saying that the package runs even if the stage is not yet at 40? Also doesn't kmyquest simply return the parent quest of the stage fragment? If so, it won't run the timer properly. You'll need to cast it into the script.(kmyquest as My_Timer_SetQstStage).MyTimer() But if the NPC is running the package without the timer running to set the stage, then there is probably a different issue that needs to be resolved as well. Link to comment Share on other sites More sharing options...
antstubell Posted September 26, 2020 Author Share Posted September 26, 2020 (edited) NPC runs the package when stage is at 30. Doesn't wait for stage 40 to be set.Package schedule is 9.35 for 1 hour daily. Condition GetStage MyQyest == 40 Edited September 26, 2020 by antstubell Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 27, 2020 Share Posted September 27, 2020 All I can say is to double check the condition and make sure it is set correctly. Maybe add one that says the stage cannot be 30? Link to comment Share on other sites More sharing options...
antstubell Posted September 28, 2020 Author Share Posted September 28, 2020 (edited) I tried GetStage Questname != 20 AND GetStage Questname != 30 AND NPC still runs the package when the quest stage is at either stage 20 or stage 30.Doesn't make sense. The first package is set to run at < 10 and it does perfectly. The next package in the stack is set to run at == 20, that runs too. I have notifications telling me what stage the quest is currently at so I know the NPC is ignoring the condition(s). EDIT: Tried using a global variable that is 1 before timer starts and 2 after. NPC still runs the package when the global is 1 even though the package is conditioned to GetGlobalValue MyGlobal == 2. This sucks. Edited September 29, 2020 by antstubell Link to comment Share on other sites More sharing options...
antstubell Posted September 30, 2020 Author Share Posted September 30, 2020 Is there a way to remove a package from a NPC's AI package list through script/script fragment? Just this is driving me mad and defies the logic of conditions. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 30, 2020 Share Posted September 30, 2020 If the package is provided via quest alias, you can stop that quest and they'll no longer run that package. But if the package is on the actor record, you're pretty much stuck with it. Sorry there is no way to directly remove packages via script. Link to comment Share on other sites More sharing options...
antstubell Posted October 1, 2020 Author Share Posted October 1, 2020 I have the package on the actor alias in the quest. How do stop it? Link to comment Share on other sites More sharing options...
cumbrianlad Posted October 1, 2020 Share Posted October 1, 2020 I've conditioned quest alias packages before and they seem to work. Your conditions seem a bit odd, though. To me they say if the quest is not at stage 20 or 30, run this package. At stage 0 they could start running it. They may not stop running it afterwards. I tend to just need an NPC to run a package at 1 particular quest stage, so I condition it Get Stage MyQuest == MyStage. When I hit that stage to be sure they don't carry on using any earlier package, I type this into the stage fragment... Alias_MyAliasName.GetActorRef().EvaluatePackage() When that stage fragment runs, they should run through their packages and pick that one to start. Any other packages must either be conditioned not to run at that stage, run at different stages or ordered correctly in the stack so that this is the one my NPC will use after evaluating. Edit: having said that, that's what I did to make sure one NPC moved to wait for the player at stage 150 of a quest. The package was conditioned to be valid for stage 150. At the end of the conversation, he automatically went back to sandboxing, which is his lowest package in his list of quest alias packages and the only one viable at that time. I didn't need to script him to re-evaluate. NPCs do re-evaluate packages when theey are in the loaded cell, though. ie when the player is near. I used the line of script to have him in position before the player entered his cell at stage 150. Link to comment Share on other sites More sharing options...
antstubell Posted October 1, 2020 Author Share Posted October 1, 2020 (edited) @cumbrianladIf you read the top of this thread you'll see I said that setting the package, on the actor, to run at GetStage QuestName == 40 didn't work. Ishara suggested adding conditions that make it so the package cannot run at any other stage except 40, which is what == 40 should do. Since then I've moved all packages to the actor's alias and redone the packages (changed the linear opening storyline of the NPC) and see how it goes from there.You see this NPC has a linear story at the beginning. Player encounters NPC, is told to follow him. NPC proceeds to a house where he searches for a key (in a watering can, see my other thread), finds key and enters house. That's 3 packages NPC must do. Then the final package will be NPC goes home and sandboxes. I THINK this package should go directly on the actor because as of this moment I don't have any more 'scripted' actions for him and will probably end quest, this quest, here. If I'm wrong please advise. Edited October 1, 2020 by antstubell Link to comment Share on other sites More sharing options...
Recommended Posts