Key detection wont bog down the system if you do it like this
Trigger Key Detect
Events
UI - Player 1 hits key ("a")
Actions
Turn off trigger(this trigger)
Text message (" player 1 hit key a")
wait .5 realtime seconds
turn on trigger(this trigger)
this wont lag really at all.
most people complain about the time it takes for this trigger to activate after clicking the button. It takes a small moment to react
to use the "turn trigger off" each key needs its own trigger for each player so you can properly turn them on and off. this prevents the events from flooding the game as a player holds a key down or hits the key repeditively
I'm sceptic about that. I can't think of a reason why disabling the trigger for a short time would reduce delay. Doesn't make sense in my books. I don't have any solid info that speaks against this though (because I can't be bothered to runs tests..).
About the last paragraph:
If I remember correctly the Key Down event will only be triggered once, even if the player holds down the key for several seconds.
general rule: as more often a trigger fires, as more important it is to optimize it as well as possible. however, trigger optimizing is overrated by lots of people especially at their point of trigger knowledge.
To elaborate a bit:
Basically you don't have to care about trigger optimization at all until players start lagging. It doesn't matter if you have a trigger that fires all 5 minutes or all 0.1 seconds.
As long as the trigger doesn't create a small lag ( = freeze ) when it's run once then the number of executions really don't matter at all.
For Starcraft modding writing efficient triggers is really only needed so you can run very long or complex triggers without lags. Not so you can run them a lot of times.
I'm sceptic about that. I can't think of a reason why disabling the trigger for a short time would reduce delay. Doesn't make sense in my books. I don't have any solid info that speaks against this though (because I can't be bothered to runs tests..).
About the last paragraph:
If I remember correctly the Key Down event will only be triggered once, even if the player holds down the key for several seconds.
To elaborate a bit:
Basically you don't have to care about trigger optimization at all until players start lagging. It doesn't matter if you have a trigger that fires all 5 minutes or all 0.1 seconds.
As long as the trigger doesn't create a small lag ( = freeze ) when it's run once then the number of executions really don't matter at all.
For Starcraft modding writing efficient triggers is really only needed so you can run very long or complex triggers without lags. Not so you can run them a lot of times.