• 🏆 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!

Questions concerning leaks

Status
Not open for further replies.
Hello guys,

I have a series of questions concerning leaks.

1) When it comes to creating a trigger that spawns multiple units in a point of a region.

We know that this leaks.
  • Unit - Create 1 Warrior Arachnathid for Player 9 (Gray) at (Center of Region 030 <gen>) facing Default building facing degrees
So, what if we initialize the points in variables.
This is an example from the map UndeadX07a.
As you can see, they initiated the point by assigning it to a variable.
  • Set PointSpiderlingSpawn = (Center of Spiderling Spawn <gen>)
Yet they didn't destroy the point after that.
  • Wait 1.00 seconds
  • Unit - Create 1 Spiderling for AP3_Nerubian at PointSpiderlingSpawn facing 300.00 degrees
  • Unit - Order (Last created unit) to Attack-Move To PointVoiceOverSlither
  • Wait 0.50 seconds
  • Unit - Create 1 Spiderling for AP3_Nerubian at PointSpiderlingSpawn facing 300.00 degrees
  • Unit - Order (Last created unit) to Attack-Move To PointVoiceOverSlither
I wondered maybe bacause the map is small and has a 20min worth of gameplay that they didn't destroy the point leaks. But what if the map has over 200 triggers and 2hours worth of gameplay! Would that be a huge problem?

2) Should we destroy special effects? Is it worth the trouble?
I mean should i assign every special effect in a variable then destroy it after it finishes its animation? Is it worth it?

3) Should we initialize sounds like this?
  • Init 03 Sounds
    • Events
    • Conditions
    • Actions
      • Set PlateActivationSound = BattlenetBirth1 <gen>
      • Set ElevatorSound = BattlenetBirth1 <gen>
      • Set GatesRollingSound = BattleNetDoorsStereo2 <gen>
      • Set EarthquakeSound = Earthquake <gen>
      • Set SpikeUpSound = MetalLightSliceMetal1 <gen>
      • Set SpikeDownSound = MetalLightSliceFlesh3 <gen>
      • Set DoorOpenSound = LargeCityGateOpen1 <gen>
4) What's the deal with the used runes and tomes? Do they cause leaks?
I've seen someone post a trigger, years ago, that eliminate used and destroyed items periodically.

Thank you. :grin:
 
Level 7
Joined
Dec 17, 2017
Messages
134
1) Yeah, of course, if it has 200 triggers, it will inevitably lag. Also, it depends on the computer you have. If you have a really slow computer, it will lag even in the slightest of leaks. It is best not to take chances, and destroy the point.
2) I mean, yeah, it is worth it. Or else, the place in which the animation takes place, occupies a place in the memory. Since WE has no garbage collector, it lags.
3) That's not really neccessary. At least I do not do it.
4) As far as I know, the runes and tomes are used up after collecting it, so there is no question of eliminating them.
I've seen someone post a trigger, years ago, that eliminate used and destroyed items periodically.
It would be better if you show it here.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
1. It also depends on how often the trigger runs. If it is a trigger that rarely runs it wont matter much.
The ones you need to watch out for are quick loops or events like "unit is attacked"

2. Just use "destroy last created special effect" to prevent variable spam

3. Probably not worth it

4. I think there is a system in the spell section to clean up tomes, though I never use tomes so never bothered to look it up

Generally, it is good practice to clean all leaks to not form bad habits
 
Status
Not open for further replies.
Top