Jenova23 Posted November 22, 2023 Posted November 22, 2023 Does anyone know how to set a timer so that a quest changes stages after a specific amount of time elapses?
wareware Posted November 23, 2023 Posted November 23, 2023 RegisterForSingleUpdate or RegisterForSingleUpdateGameTime or Cast a spell on the player that advances the stage oneffectend 1
Seijin8 Posted November 23, 2023 Posted November 23, 2023 (edited) 5 hours ago, Jenova23 said: Does anyone know how to set a timer so that a quest changes stages after a specific amount of time elapses? ;; mind this is a low-effort, low-caffeine example ;; Quest property qMyQuest auto ;; example assumes we are looking for stage 30 float property fAdvanceStageTime Event OnUpdate() If qMyQuest.GetStage() >= 30 ;; already hit the desired stage, kill the updates UnregisterForUpdate() ElseIf Utility.GetCurrentGameTime() >= fAdvanceStageTime ;; increment the stage, kill updates qMyQuest.SetStage(30) UnregisterForUpdate() Else ;; stage is less than 30, time has not hit yet, set an update RegisterForSingleUpdate(120) ;; really depends on usage, how fast you need that to increment, etc EndIf EndEvent ;; would also probably want a way to check the time after wait/sleep, etc. ;; for best performance, this would all be in a state that gets invalidated after the stage is reached, but this might be infeasible if ths is meant to happen multiple times EDIT: wareware's version is probably better and definitely simpler. Edited November 23, 2023 by Seijin8
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