niston Posted March 29, 2023 Share Posted March 29, 2023 A RunOnce quest can only be run, well, once. Clear the flag and it should work repeatedly.Perhaps also tick the Repeat Stages or whatever it's called. Link to comment Share on other sites More sharing options...
pepperman35 Posted March 29, 2023 Author Share Posted March 29, 2023 (edited) Okay, here is where I stand with the troubleshooting. First, here is the relevant byte from the log: [03/29/2023 - 03:37:40PM] error: (0C96F93C): cannot start scene because its parent quest was not running.stack:[ (0C96F93C)].Scene.Start() - "<native>" Line ?[ (0C8C05C0)].Bart:ActivateSermonScript01.OnActivate() - "C:\Users\Omega1\AppData\Local\Temp\PapyrusTemp\Bart\ActivateSermonScript01.psc" Line 23 The ActivateSermonScript01 resides on ChurchLectern. I have also tried PastorAliasScript on the Alias_Pastor. Both at this point are yielding similar results. When the NPC pastor loads into the furniture (Church Lectern), the lectern light engagse but the quest scene does not play. Scriptname PastorAliasScript extends ReferenceAlias ;/Script designed to automatically play a random scene(sermon) once the NPC (pastor) loads into the furniture (church lectern). Script resides on the pastor alias. Special thanks to DieFeM for the assist. https://forums.nexusmods.com/index.php?/topic/12724311-scripts-on-furniture-event-onsit/ /; ; ╔═════════════════════════════════════════════════╗ ; ║ Properties ║ ; ╚═════════════════════════════════════════════════╝ Scene property PastorAllenSermon01 Auto Const Mandatory ObjectReference Property FO4_LecternLightsEnable Auto Const Mandatory Furniture Property FO4_ChurchLectern02 Auto Const Mandatory Event OnSit(ObjectReference akFurniture) ;Debug.Trace(self + "PastorAliasScript OnSit " + akFurniture) If (akFurniture.GetBaseObject() as Furniture) == FO4_ChurchLectern02 ;Debug.Trace("PastorAliasScript: the pastored has enter the pulpit") ; Add addition code to randomly select a scene to play Utility.Wait(0.1) ; ; Turn the lectern lights on ; FO4_LecternLightsEnable.enable() PastorAllenSermon01.Start() EndIf EndEvent Event OnGetUp(ObjectReference akFurniture) If (akFurniture.GetBaseObject() as Furniture) == FO4_ChurchLectern02 ; Debug.Trace("PastorAliasScript: the pastored has left the pulpit") ; Utility.Wait(1.0) ; ; Turn off the lectern lights ; FO4_LecternLightsEnable.disable() EndIf endEvent Scriptname Bart:ActivateSermonScript01 extends ObjectReference Const ;/Script designed to automatically play a random scene(sermon) once the NPC (pastor) loads into the furniture (church lectern). Script resides on the church lectern. Special thanks to DieFeM and lee3310 for the assist. https://forums.nexusmods.com/index.php?/topic/12724311-scripts-on-furniture-event-onsit/ /; Scene property PastorAllenSermon01 Auto Const Mandatory ObjectReference Property FO4_LecternLightsEnable Auto Const Mandatory ObjectReference Property FO4_PastorAllen Auto Const Quest Property FO4_BartonvillePastorDialogueSermons Auto Const Mandatory Event OnActivate(ObjectReference akActionRef) if akActionRef == FO4_PastorAllen ; Add addition code to randomly select a scene to play Utility.Wait(0.1) ; ; Turn the lectern lights on ; FO4_LecternLightsEnable.enable() ; ; Start up the scene PastorAllenSermon01.Start() endif EndEvent The quest has Start Game Enabled and Allow repeated stages checked. Running sqv FO4_BartonvillePastorDialogueSermons suggests the quest is not running. The quest has no stages at this point. Now on Saturday when I recorded the video, it worked, but obviously I have done something to FUBUR it, but not been successful yet in isolating the problem. Edited March 29, 2023 by pepperman35 Link to comment Share on other sites More sharing options...
lee3310 Posted March 30, 2023 Share Posted March 30, 2023 (edited) Okay, here is where I stand with the troubleshooting. First, here is the relevant byte from the log: [03/29/2023 - 03:37:40PM] error: (0C96F93C): cannot start scene because its parent quest was not running.stack:[ (0C96F93C)].Scene.Start() - "<native>" Line ?[ (0C8C05C0)].Bart:ActivateSermonScript01.OnActivate() - "C:\Users\Omega1\AppData\Local\Temp\PapyrusTemp\Bart\ActivateSermonScript01.psc" Line 23 The ActivateSermonScript01 resides on ChurchLectern. I have also tried PastorAliasScript on the Alias_Pastor. Both at this point are yielding similar results. When the NPC pastor loads into the furniture (Church Lectern), the lectern light engagse but the quest scene does not play. Scriptname PastorAliasScript extends ReferenceAlias ;/Script designed to automatically play a random scene(sermon) once the NPC (pastor) loads into the furniture (church lectern). Script resides on the pastor alias. Special thanks to DieFeM for the assist. https://forums.nexusmods.com/index.php?/topic/12724311-scripts-on-furniture-event-onsit/ /; ; ╔═════════════════════════════════════════════════╗ ; ║ Properties ║ ; ╚═════════════════════════════════════════════════╝ Scene property PastorAllenSermon01 Auto Const Mandatory ObjectReference Property FO4_LecternLightsEnable Auto Const Mandatory Furniture Property FO4_ChurchLectern02 Auto Const Mandatory Event OnSit(ObjectReference akFurniture) ;Debug.Trace(self + "PastorAliasScript OnSit " + akFurniture) If (akFurniture.GetBaseObject() as Furniture) == FO4_ChurchLectern02 ;Debug.Trace("PastorAliasScript: the pastored has enter the pulpit") ; Add addition code to randomly select a scene to play Utility.Wait(0.1) ; ; Turn the lectern lights on ; FO4_LecternLightsEnable.enable() PastorAllenSermon01.Start() EndIf EndEvent Event OnGetUp(ObjectReference akFurniture) If (akFurniture.GetBaseObject() as Furniture) == FO4_ChurchLectern02 ; Debug.Trace("PastorAliasScript: the pastored has left the pulpit") ; Utility.Wait(1.0) ; ; Turn off the lectern lights ; FO4_LecternLightsEnable.disable() EndIf endEvent Scriptname Bart:ActivateSermonScript01 extends ObjectReference Const ;/Script designed to automatically play a random scene(sermon) once the NPC (pastor) loads into the furniture (church lectern). Script resides on the church lectern. Special thanks to DieFeM and lee3310 for the assist. https://forums.nexusmods.com/index.php?/topic/12724311-scripts-on-furniture-event-onsit/ /; Scene property PastorAllenSermon01 Auto Const Mandatory ObjectReference Property FO4_LecternLightsEnable Auto Const Mandatory ObjectReference Property FO4_PastorAllen Auto Const Quest Property FO4_BartonvillePastorDialogueSermons Auto Const Mandatory Event OnActivate(ObjectReference akActionRef) if akActionRef == FO4_PastorAllen ; Add addition code to randomly select a scene to play Utility.Wait(0.1) ; ; Turn the lectern lights on ; FO4_LecternLightsEnable.enable() ; ; Start up the scene PastorAllenSermon01.Start() endif EndEvent The quest has Start Game Enabled and Allow repeated stages checked. Running sqv FO4_BartonvillePastorDialogueSermons suggests the quest is not running. The quest has no stages at this point. Now on Saturday when I recorded the video, it worked, but obviously I have done something to FUBUR it, but not been successful yet in isolating the problem. I'm not seeing you starting the quest like i told you in the previous post. Did you try that ? Event OnActivate(ObjectReference akActionRef) if akActionRef == FO4_PastorAllen ; Add addition code to randomly select a scene to play Utility.Wait(0.1) ; ; Turn the lectern lights on ; FO4_LecternLightsEnable.enable() ; ; Reset The Quest ; ChurchQuest.Stop() ChurchQuest.Start() ; ; Start up the scene ; If ChurchQuest.IsRunning() PastorAllenSermon01.Start() Else Debug.Trace("Quest not running") Endif endif EndEvent Also, if the quest is only used for the sermon part, untick the start game enable since it's repeatable (can be started with the lectern) and you can start the scene OnQuestInit() event instead. Edited March 30, 2023 by lee3310 Link to comment Share on other sites More sharing options...
pepperman35 Posted March 30, 2023 Author Share Posted March 30, 2023 I'm not seeing you starting the quest like i told you in the previous post. Did you try that ? I ran sqv FO4_BartonvillePastorDialogueSermons as you suggested and it reported the quest was not started and I tried multiple things but could not get it to fire up. But after much investigation I did manage to get it working again. Four days troubleshooting resolved with a single line (i.e., conditioned the quest off the pastor voice type. Just tested it...coc'd to the settlement from the start menu then ran sqv which reported the quest running. Thanks guys for the help. I'll take a look at OnQuestInit() event too. Personally, not done much questing so this is quite the experience. Link to comment Share on other sites More sharing options...
lee3310 Posted March 30, 2023 Share Posted March 30, 2023 I'm not seeing you starting the quest like i told you in the previous post. Did you try that ? I ran sqv FO4_BartonvillePastorDialogueSermons as you suggested and it reported the quest was not started and I tried multiple things but could not get it to fire up. But after much investigation I did manage to get it working again. Four days troubleshooting resolved with a single line (i.e., conditioned the quest off the pastor voice type. Just tested it...coc'd to the settlement from the start menu then ran sqv which reported the quest running. Thanks guys for the help. I'll take a look at OnQuestInit() event too. Personally, not done much questing so this is quite the experience. Also, if you have any unfilled non-optional alias, the quest won't start... Link to comment Share on other sites More sharing options...
pepperman35 Posted March 30, 2023 Author Share Posted March 30, 2023 Okay, now that I got the crisis resolved I'm moving forward. For a quick test, I added a moderate amount of reverb to Pastor's Joe. Also, I tried one of the AI voices from Eleven Labs. What do you think? Improvement over the other? Link to comment Share on other sites More sharing options...
pepperman35 Posted April 2, 2023 Author Share Posted April 2, 2023 Fantastic! Are you voicing the minister? Also, tell me if I can help you in any way. I think you said you're working on a settlement, and I need to get some experience in while also in fact finishing any mod-work that I set out to do... (this is easier when part of a team). Skills: Papyrus (behavior and utilities), Graphics, CK wrangling, extracting stuff from xEdit, general troubleshooting.RaidersClamoring, thank you for the offer. The current challenge for me to overcome is here, so if you have any thoughts, or expertise I'd welcome the input. Link to comment Share on other sites More sharing options...
pepperman35 Posted April 6, 2023 Author Share Posted April 6, 2023 (edited) Work progresses, albeit slowly. Currently, working on the script that summons the NPCs to the church. Trying to make the seating more organized, if possible, preventing robots from coming to church and trying to account for max seating capacity. Here's what I have thus far. Scriptname WorkshopSummonedByChurchScript extends Quest ;/Script designed to summon the settlement's NPC to the church. AI packages are placed on the NPC aliases to facilitate seating Script resides on the quest. /; RefCollectionAlias Property Alias_WorkshopNPCs Auto Const ReferenceAlias Property Alias_Workshop Auto Const ReferenceAlias Property Alias_Bell Auto Const workshopparentscript Property WorkshopParent Auto Const Furniture Property FO4_NpcBenchChurchSit01 Auto Const Mandatory Actor Property pPlayerREF Auto Const Mandatory ActorValue Property WorkshopBellDistance Auto Const GlobalVariable Property FO4_CongregationSummonState Auto Const Mandatory ObjectReference Property FO4_ChurchBellsLocMarker const auto Sound Property FO4_ChurchBellsRinging const auto Keyword Property LinkCustom01 Auto Const mandatory Race property HumanRace Auto Const Mandatory ObjectReference Property FO4_ChurchPulpit01REF Auto Const mandatory ObjectReference Property FO4_GoToChurchMarker Auto Const mandatory int numNPCsToSeat = 0 int MaxSeatingCapacity = 52 function Startup() ; debug.trace(self + " FO4_SummonCongregationQuest: Summoning the NPC") FO4_ChurchBellsRinging.play(pPlayerREF) ObjectReference[] furnitureObjects = pPlayerREF.FindAllReferencesOfType(FO4_NpcBenchChurchSit01 as Form, 10240 as float) ObjectReference[] workshopNPCs = WorkshopParent.GetWorkshopActors(Alias_Workshop.GetRef() as WorkshopScript) ; ; For each nondead, human NPC, link each human NPC to a furniture object ; int objectIndex = 0 int npcIndex = 0 while npcIndex < workshopNPCs.Length ObjectReference theNPC = workshopNPCs[npcIndex] ObjectReference theFurnitureObject = furnitureObjects[objectIndex] if ((theNPC as Actor).IsDead() == False) && ((theNPC as Actor).GetRace() == HumanRace) Debug.Trace("The actor is not dead, and they are human, so we link them") theNPC.SetLinkedRef(theFurnitureObject, LinkCustom01) if npcIndex % 4 == 0 objectIndex += 1 endif endif npcIndex += 1 endWhile Debug.Trace("WorkshopSummonedByChurchScript: We needed this many pews for our settlers " + objectIndex) ; add linked NPCs to the collection npcIndex = 0 while npcIndex < workshopNPCs.Length && Alias_WorkshopNPCs.GetCount() < MaxSeatingCapacity ObjectReference theNPC = workshopNPCs[npcIndex] ; ; Check how far away the NPC is from the church lectern. Teleport ; NPCs closer if they are too far away to speed up the process ; if theNPC.GetDistance(FO4_ChurchPulpit01REF) > 3000 ; Debug.Notification("The distance beetween this NPC and the church lectern is " + theNPC.GetDistance(FO4_ChurchPulpit01REF)) theNPC.MoveTo(FO4_GoToChurchMarker) endif ; ; Now we want to only add those actors that we have ref linked earlier ; if theNPC.GetLinkedRef(LinkCustom01) Alias_WorkshopNPCs.AddRef(theNPC) numNPCsToSeat += 1 endif npcIndex += 1 Utility.Wait(7.5) endWhile ; Set a flag so we know the congregation has been summoned FO4_CongregationSummonState.SetValue(1 as float) endFunction function Shutdown() ;start timer StartTimerGameTime(0.25) ; timer shuts down quest endFunction Event OnTimerGameTime(int aiTimerID) FO4_CongregationSummonState.SetValue(0 as float) Stop() EndEvent Edited April 7, 2023 by pepperman35 Link to comment Share on other sites More sharing options...
pepperman35 Posted April 7, 2023 Author Share Posted April 7, 2023 Well, after multiple tests, I would say the above script works to a degree. I seems to keep robots out of the church and max out the capacity but I can't say it is any more efficient at seating the NPCs in the pews...reminds me of the game musical chairs. Need to explore an alternative way(s) to get butts in seats, in a more organized manner. The size of the church's front door is somewhat problematic as it create a bottleneck. Ideas welcomed and appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts