• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Do lots of events on one trigger lag?

Status
Not open for further replies.
Level 13
Joined
Jul 15, 2007
Messages
763
Well, to overcome a problem with a spell i've used the event 'Add to Trigger the event Unit Takes Damage' to the spell trigger, but the spell has a 5 second cooldown so if this gets used alot, the trigger will end up with lots of events of 'Unit Takes Damage' added to it, though only one event will be actively working at one time. Say after 10 mins of playing time the trigger has 250 events, will it promote lag?

And what if i decide to make lots of triggers like this, i.e an armour that can entangle when the buff owner takes damage. Will having lots of triggers which may accumilate a thousand events in total lag?

Don't wanna make it all and then find out i gotta find an alternative way >.>
 
I dont think it will lag... though they say that Unit-Takes damage event leaks or something like that.... I'm not sure if its the event itself or the addition action 'Add to Trigger the event Unit Takes Damage'.... so if it lags I think its because of the leak and not because of the number of events... (You can have lots of triggers working at the same time and not lag at all so I guess that would be the same for a single trigger with lots of events)
 
Level 13
Joined
Mar 16, 2008
Messages
941
You can have an unbelievable high number of events at one trigger, thats not the problem.
And the "leak" of the event is unbelievable small too.
The problem is, that most people still don't know what leaks are, so they say "this event leaks" like Adikutz did :p Every little piece of code in warcraft needs memory, each created unit takes memory (much more then a small event). Everything increases the memory usage of warcraft, that's just normal.
You're talking of a leak in the moment when you don't need the object (for example a location) and you don't remove it. Then the memory is used (like before, NOTHING changed except that you don't need it anymore) but you don't free it. Each new location will take memory too, and if you don't remove them, the memory usage of warcraft will raise slowly.
That's the same with the event.
EACH event leaks in theory, if you don't need it anymore.
People are only talking about leaks, because units can die. This event refers to units, and as soon as a unit dies, the event can't be triggered anymore, but it still remains there and takes memory. In time there will spawn/create/summon/whatever new units and create new events.
 
Level 12
Joined
Dec 10, 2008
Messages
850
Every event you add to a trigger is like making another trigger with the same actions, but this avoids that rediculose work you'd need to do.

So if it lags, it might be the sheer amount of having to go through 250 events and run the rest of the trigger. It wont lag as bad if you could find another way to do it
 
Status
Not open for further replies.
Top