Nymra Posted May 21, 2021 Posted May 21, 2021 solved for now. Seems "SetNoBleedoutRecovery(true)" failed to be applied so I added another check for it to make sure. No script change -> different functionality... sometimes I just dont get it ^^ I noticed that sometimes my scripts just decide to ignore utility.wait and RegisterforSingleUpdate(X) timers, basically fastfowarding so fast that they get ahead of each other happening in the wrong order... From what I know: Function ...do stuff A... debug.trace ("NAKED DEFEAT: timing: 0 sec") RegisterForSingleUpdate(7) debug.trace ("NAKED DEFEAT: timing: 7 sec") ...do stuff B... EndFunction means that "OnUpdate" will happen only after "stuff A" + 7 seconds. Is that correct? so "do stuff B" will only happen after the 7 seconds period AND when OnUpdate fired. True? Because I have a script now that is unchanged but ignores this. RegisterforSingleupdate seems to start and ingore the "7", meaning it treats it as "0" and then stuff B happens way too early... this is the Papyrus.log [05/21/2021 - 03:14:02AM] NAKED DEFEAT: timing: 0 sec [05/21/2021 - 03:14:02AM] NAKED DEFEAT: timing: 7 sec they should be 7 seconds apart but are not I tried the same with Utlity.Wait(7) before and that was sometimes just ignored completly. I noticed this happens especially after Bleedout state recovery (bleedout -> heal player -> player stands back up -> timers are broken...) what I do not understand is that I cannot reproduce this, sometimes it seems to work sometimes not. Now I wonder if this is some special stuff about papyrus I dont know, just a bug that I have to live with or whatever else?!?! thx alot
alex77r4 Posted May 21, 2021 Posted May 21, 2021 10 hours ago, Nymra said: so "do stuff B" will only happen after the 7 seconds period AND when OnUpdate fired. True? I'm sorry but NOT.... RegisterForSingleUpdate is a Non-delayed Native Function and is executed instantly. The game only need one millisecond to execute it... In your code: ...do stuff A... debug.trace ("NAKED DEFEAT: timing: 0 sec") ;external call = delayed = 1 frame = 16 ms RegisterForSingleUpdate(7) ;Non-delayed Native Function = instant = 1 ms debug.trace ("NAKED DEFEAT: timing: 7 sec") ; external call = delayed = 1 frame = 16 ms ...do stuff B... From the end of (stuff A) to the start of (stuff B) only elapsed 33 milliseconds... at 60 FPS... The OnUpdate is called in another thread after the specified time has elapsed. Take good note about another thread... because papyrus is a multi-thread language... If your (stuff B) have a long wait command the OnUpdate can be executed, in a simultaneous way, while your (stuff B) is waiting. And of course... If you have multiple RegisterForSingleUpdate in your code, or if you put the RegisterForSingleUpdate inside a function that can be called by the game multiple times, like OnHit, you can have multiple and simultaneous executions of OnUpdate, running all of them at the same time, in parallel execution, giving you multiple problems. To locate this cases I recommend you use Game.RequestSave() to create a savegame in critical moments. Examine the active scripts and the call stack with ReSaver. Be happy.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.