• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger execution speed

Status
Not open for further replies.
Level 3
Joined
Nov 12, 2018
Messages
43
Let's say I have two trigger: TriggerA fires every x seconds (by its own event) and runs TriggerB. TriggerB does lot's of stuff. So much stuff, that it's just impossible to fully execute all actions of Trigger B before TriggerA wants to fire again.

1. Does TriggerA just fire before all actions of TriggerB are finished?
1.1 Or does TriggerA wait, until TriggerB has finished, and therefor "ignores" its own event?
1.2 Or will the game slow down entirely, in order to allow TriggerA to fire "just in time"? (=lag machine?)

2. How would a wait function inside TriggerB effect this system?
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
TriggerA fires every x seconds
TriggerB does lot's of stuff. So much stuff, that it's just impossible to fully execute all actions of Trigger B before TriggerA wants to fire again.
No way a trigger is taking that long to execute unless it has looped waits in it, so something else is actually happening. It would threadcrash long before that, and if you've got waits then... well what did you expect would happen and why are you using waits like that?

A trigger runs in its own thread unless manually run from within another trigger (what you're doing). If a thread takes too long to happen (by number of operations) then the thread crashes and stops. In vJASS .execute runs in a new thread and .evaluate runs in the same one. In GUI the only real option is ExecuteFunc(). If a trigger 'waits' the active thread is passed to something else while the wait counts down, pausing the whole thread (A too if B has waits) while waiting.

1. No, a second instance of A will happen again while the first one is waiting on its executed B.
1.1. Each thread will run with the waits until they end or crash.
1.2. No.
 
Status
Not open for further replies.
Top