Closed Pychnight closed 7 months ago
this entirely happens due to the threads looping. The general idea of splitting the threads was to resolve a issue with not being able to spawn monsters at the same time as well counting a timer.
This could of been implemented in way where it's not dependent on loops or split threads,
We could of reserved the main thread for the quest and allow loading of secondary scripts to be run along side the main script, such as for enemy spawning or timer counting.
The current implementation does work but just don't overuse the Loops in other threads otherwise the quest will abort automatically with the above error.
best advice, avoid using the split thread function and try to create quests that are built on the grounds of working with only 1 thread.
Resolved
as mentioned in my last e-mail the threading errors often happen when the quest encounters Delay function that are across Threads, making it very hard to create a quest that has a timer.
Other note the delay function seems to effect other threads in a negative way...
Prevent Delay from effecting other threads, reading the TPL Documentation, i have seen there is actually a way to do this which is creating true isolated threads and not child threads.
Solve the OnRun threading errors...
Ensure custom quests is more stable when actually doing quests...
Safety Request
Errors Reported
[CustomQuests] Warning 'slayzombies' MainQuestTask terminated due to errors or cancellation. [CustomQuests] Warning System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled. --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00014] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00052] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Threading.Tasks.Task.Wait () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 at CustomQuests.Quests.Quest.Delay (System.Int32 milliseconds) [0x0000c] in <8e5fa3194d2944409350082cce0f60a3>:0 at g2_newlands_ch2Quest+$OnRun$closure$5.Invoke () [0x001a0] in <bf1bdcda48cf40039475534a64335325>:0 at System.Threading.Tasks.Task.InnerInvoke () [0x00012] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Threading.Tasks.Task.Execute () [0x00016] in <8f2c484307284b51944a1a13a14c0266>:0 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00014] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00052] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Threading.Tasks.Task.Wait () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 at g2_newlands_ch2Quest.OnRun () [0x00155] in <bf1bdcda48cf40039475534a64335325>:0 at CustomQuests.Quests.Quest.<Run>b__66_0 () [0x00000] in <8e5fa3194d2944409350082cce0f60a3>:0 at System.Threading.Tasks.Task.InnerInvoke () [0x00012] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Threading.Tasks.Task.Execute () [0x00016] in <8f2c484307284b51944a1a13a14c0266>:0 ---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled. --- End of inner exception stack trace ---