-
Notifications
You must be signed in to change notification settings - Fork 0
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
Design New Thread Event Handler #11
Comments
Undergoing continued testing and refinement. |
Everything seems to be working as intended. However, you'll still need to be vigilant about situations involving race conditions or unintended dead locking. Theres no autopilot that magically solves these types of problems. |
Reopened and unchecked Multi Event Execution. Can't execute Triggers on different threads, they will always wait for the first task on the main thread to complete thus ending in the same situation as custom quests v1.0
|
tried working around this issue by using goto loops
the trigger will not execute at all. |
alright --- i broke something in the script -_-; i will try to see what's causing the triggers to fail... in the code. seems like triggerKill = TriggerWaitAll( 120000, KillNpcs(party,1,"Green Slime"), KillNpcs(party,1,"Green Slime") ) doing the same triggers back to back also ends up breaking the triggers. |
I greatly simplified the script to try to prove the issue exists
in this script both events fail, it looks like they start successfully however, you can't complete ether one for what ever reason. |
No comment, found the reason why both events are failing. TriggerWaitAll( 120000, KillNpcs(party,1,"Green Slime") seems like if you reuse the enemy name for a different trigger such as green slime. it will cause the trigger to fail, however it only fails on different threads, reusing the enemy on the same thread works fine. even doing this triggerKill = TriggerWaitAll( 120000, KillNpcs(party,count,"Green Slime"), KillNpcs(party,count,"Green Slime") ) causes failure. I have also tried doing clever TPL cancellation methods to work around the issue but it's the same. With this starting anther thread to run code in side by side of the main thread seems to not work at all currently, it seems like when you start the new code sequence it stops executing the main thread into it's done waiting for a trigger on a different thread. -_- |
Okay a couple of points to touch on here...
You may have already picked up on it, but theres no call to Complete(true) anywhere, so your quest never succeeds. If you want the quest to succeed, you must issue a Complete(true) somewhere.
I've tested multiple duplicate KillNpcs triggers, in both a single task, and dual task form. They both work, with the caveat that something like:
Results in them being handled sequentially. I presume this could cause issues elsewhere as well.( though the only reason your original example is having issues is because of the lack of Complete(s), as stated above ). Now this is actually an issue with the KillNpc's trigger itself, and not the Tasks. This could have caused issues with the old quest callback system as well. KillNpcs internally keeps a single global dictionary of player npc strikes, removing the strikes on death. Hence why multiple duplicate triggers are operating sequentially. The first one is removing the strikes before the second one sees them, and thus the kill never gets associated with the player when the second trigger runs its code... I'm not sure the best way to fix the trigger is just yet, but I'll work something out. |
Okay think that was an easy enough fix for KillNpcs. Just made it so its a dictionary per trigger. Closing this again. |
#1
#10 #8 #9 #3 #5 #4 #6 #7
The text was updated successfully, but these errors were encountered: