So I'm not very savvy with programming technique. I've always just structured my triggers with a layman's logic, probably ignorant of several programming faux pas i was committing. I've recently begun running into odd behavior on one of my maps, however, so I think I need to get a little more up to speed.
One thing I can remember causing problems in my sc1 days was multiple triggers running multiple waits, which apparently conflicted with each other. Is that still an issue? And is replacing those waits with timers more sound programming? Instead of say, wait 200 seconds, run trigger 2 (which has no events or conditions), set a 200 sec timer and have the timer expired as a trigger 2 event?
Another thing I noticed in Blizzard maps mainly is they didn't use "run trigger" too often, but rather "add trigger to trigger queue." I take it this too is less sloppy in its execution, and has been replaced by action queues in sc2?
Every trigger runs on a separate thread, just use Wait :)
Also, only use triggers when you need to activate them through Events.
If it's just a block of code and you need to call it often, define an Action instead.
Thanks. I just tried playing around with some action definitions, but I didn't foresee it stalling the trigger until the actions were complete. Is there any way to continue a trigger without waiting until action definition finishes?
Thanks. I just tried playing around with some action definitions, but I didn't foresee it stalling the trigger until the actions were complete. Is there any way to continue a trigger without waiting until action definition finishes?
Perhaps try making the action definition its own "thread". Click the action definition its in the list of checkbox options (create thread). Not sure if this will do the trick, but may.
Perhaps try making the action definition its own "thread". Click the action definition its in the list of checkbox options (create thread). Not sure if this will do the trick, but may.
that did it, thank you
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I'm not very savvy with programming technique. I've always just structured my triggers with a layman's logic, probably ignorant of several programming faux pas i was committing. I've recently begun running into odd behavior on one of my maps, however, so I think I need to get a little more up to speed.
One thing I can remember causing problems in my sc1 days was multiple triggers running multiple waits, which apparently conflicted with each other. Is that still an issue? And is replacing those waits with timers more sound programming? Instead of say, wait 200 seconds, run trigger 2 (which has no events or conditions), set a 200 sec timer and have the timer expired as a trigger 2 event?
Another thing I noticed in Blizzard maps mainly is they didn't use "run trigger" too often, but rather "add trigger to trigger queue." I take it this too is less sloppy in its execution, and has been replaced by action queues in sc2?
Thanks for any help.
bumping, sorry
Every trigger runs on a separate thread, just use Wait :)
Also, only use triggers when you need to activate them through Events.
If it's just a block of code and you need to call it often, define an Action instead.
Thanks. I just tried playing around with some action definitions, but I didn't foresee it stalling the trigger until the actions were complete. Is there any way to continue a trigger without waiting until action definition finishes?
Perhaps try making the action definition its own "thread". Click the action definition its in the list of checkbox options (create thread). Not sure if this will do the trick, but may.
that did it, thank you