Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script effects can be interrupted by quest scripts. #205

Open
Machiavelique2 opened this issue Dec 4, 2024 · 2 comments
Open

Script effects can be interrupted by quest scripts. #205

Machiavelique2 opened this issue Dec 4, 2024 · 2 comments

Comments

@Machiavelique2
Copy link

Machiavelique2 commented Dec 4, 2024

The problem is difficult to explain, so here's what I'd like to point out

Begin ScriptEffectUpdate
	PrintD "ScriptEffectUpdate1"
	; This script effect can be interrupted by a Quest Script here
	PrintD "ScriptEffectUpdate2"
	; Or here...
	PrintD "ScriptEffectUpdate3"
	; Or here...
	; etc.
End

I don't know if this is the expected behaviour, but I find it abnormal for a script to be interrupted in the middle of execution by something other than Events. The problem occurs randomly but is obviously much easier to reproduce with Low Processing Delay.

One of the other disadvantages of the problem I'm describing is that when the console logs are saved, there's a good chance that the data in the Log file will be erased. Using ‘PrintD’ deletes the logs whereas ‘WriteStringToFile’ keeps them.


I therefore created a very simple mod ‘TestLog.esp’ in order to isolate the problem and reproduce it easily.
TestLog.zip

Here are the logs I get when I use WriteStringToFile (cause PrintD deletes the contents of the log file when the problem occurs):
TestLog

Note : This result was generated with NVSE 6.3.5b and only FalloutNV.esm and TestLog.esp loaded.

@bdemmy
Copy link
Member

bdemmy commented Dec 5, 2024

What is likely happening here (as you may have presumed) is that the script effect script is running on a different thread.

Unfortunately this means that nothing will happen in a predictable order and the logging functionality has not taken any of this into account. This of means your script is not getting 'interrupted' but instead they are running at the same time as each other.

We can fix the log output being clobbered though.

If you have any other questions feel free to join the discord and ping me '@confused'. I appreciate the report!

@Machiavelique2
Copy link
Author

Machiavelique2 commented Dec 5, 2024

Thank you for your reply.

You would be nice if you could fix the log output being clobbered though. I'd really appreciate it. It would make debugging easier while using PrintD. Having the scripts effects running on a different thread is not a problem as long as you are aware of it (maybe the information is on the geck wiki and I just missed it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants