DayTri Posted September 6, 2024 Posted September 6, 2024 I'm working on a mod where a scene should start after a quest starts. I have three reference aliases which create actors. I have a scene which uses those actors which is started by the quest's startup stage. However the scene never starts, and in my log I have "cannot start scene because its parent quest was not running". I know this not accurate, because the quest does start. I've tried using Utility.Wait() to delay calling the scene in case there's some kind of slow start which needs to happen, but still nothing.
DayTri Posted September 6, 2024 Author Posted September 6, 2024 Well, figured it out after writing this topic so will share my solution for other people. It seems like maybe every function call in the startup stage papyrus fragment needs to resolve before the quest is considered running for this purpose. Seems like that even includes papyrus fragments in *other stages* which are directly called by SetStage() inside the startup stage fragment. I was able to make this work by starting the scene async; using a RegisterForSingleUpdate(), and then starting the stage through the OnUpdate event.
traison Posted September 6, 2024 Posted September 6, 2024 Generally you should think twice beforce waiting a long time (>1 second) using Utility.Wait, or having a loop with more than a hundered iterations. Papyrus is a slow language because its artificially gimped to only do a set amount of operations per frame by default. Where other languages would do a million iterations, Papyrus might get through 100. Usually when you want to wait for something, or have a long-running task, OnUpdate is your friend for keeping Papyrus happy.
Lyreal Posted December 19, 2024 Posted December 19, 2024 I guess you misunderstand the "quest's startup stage" like I did for a long time. It is not necessary to tell the game which stage starts first (always with the lowest stage) Untick the start up stage Tickbox and it should work.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now