| 08-24-2006, 04:30 PM | #1 |
subj What is better, i always open maps with jass editor and some maps using only triggers? |
| 08-24-2006, 04:32 PM | #2 |
I assume you're asking which is better -- Periodic Triggers or just timers with timer callbacks. The one significant thought I can think of that means anything here is that TriggerSleepAction()s in timer callbacks break the thread, whereas in periodic triggers that is not the case. I prefer timers though. Since learning jass oh so long ago, I haven't used a periodic trigger since. |
| 08-24-2006, 04:43 PM | #3 |
Depends. if its a constant loop that mustnt stop till the end of the game I prefer a trigger, else its a timer for me. Performancewise there is I think no difference. |
| 08-24-2006, 04:53 PM | #4 |
trigger allow multiple events for same function inside. i started using it only cause this. added: plz any one add poll to thread. |
| 08-25-2006, 04:05 AM | #5 |
Come to think of it, why is it we use timers? Do triggers have all those awful problems? |
| 08-25-2006, 04:08 AM | #6 |
just that destroy trigger bug found recently, no? |
| 08-25-2006, 04:43 AM | #7 |
That destroy trigger bug doesnt happen to me anymore really, i just check if the trigger is null, and if its not, i destroy it, never have anymore problems. |
| 08-25-2006, 01:21 PM | #8 |
DioD - the trigger i more universal the timer have more performance because it's more simple ! 1) Trigger must count the evalcount + generate Triggering Objects (units,triggers and etc...) 2) The timer have only GetExpiredTimer() and maybe some other attributes... so i would say the timers are faster then triggers ! but not a real huge performance difference =) i agree with iNfraNe |
| 08-25-2006, 01:46 PM | #9 | |
Quote:
If you just want a periodic event and nothing more, timers are better. You don't have to care about destroying actions or crap, timers use less memory and it is more likelly triggers create their own timer for the periodic events. I actually prefer to avoid to use triggers, I use trigger if and only if I need to detect an event. Saves me cleaning time. |
| 08-25-2006, 02:09 PM | #10 | |
Quote:
|
| 08-25-2006, 07:48 PM | #11 |
Sounds like conjecture, I'm guessing no one has actually tested then. |
| 08-25-2006, 07:57 PM | #12 |
Even in the remote case when timers which seem to have 3 attributes take more memory or as much memory as Triggers who have like 100000 attributes. It would still be more annoying to use Triggers. You don't have to remove a timer's action |
| 08-25-2006, 08:06 PM | #13 |
I tested triggers hard, event removing is easy and take only one array slot, but WE is damn stupid and dont allow to create triggeraction arrays easy. Any one know way to create handle arrays inside WE? |
| 08-25-2006, 09:26 PM | #14 |
heh, either way, you cant use polledwaits and other function calls inside a timer's function, only with triggers, which has a huge difference. |
| 08-25-2006, 11:01 PM | #15 |
Who the hell uses waits anyway :S they're inaccurate. |
