• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[Trigger] How many times can a handle leak?

Status
Not open for further replies.
Level 10
Joined
Jan 28, 2009
Messages
442
If I want to use a function like Center of PlayableMapArea, which I understand leaks. If I want to use it several times, I don't have to destroy it, right? Or is Center of PlayableMapArea actually a new handle each time I refer to it?

Then what if I Pick all units in EmoRegion and do actions. When I refer to that handle later, some of the units might be dead or gone, and new units might be in the region now. So all units in EmoRegion is a different group now only if the contents have changed, or simply everytime referred to?
 
Level 6
Joined
Jun 4, 2009
Messages
91
  • -------- every time it is called, it create a new location. so do this --------
  • set temploc = Center of (Playable map area)
  • -------- add your own stuff here, using the variable temploc --------
  • Custom script - call RemoveLocation(udg_temploc)
 
Level 10
Joined
Jan 28, 2009
Messages
442
Okay, so dansaDisco is talking about setting a variable to the location, not calling the location many times and then cleaning the trash, but cleaning up everytime you mess a bit. Or at least, making sure you have a variable set to it until it is destroyed. Think I get it now. Thanks. And thanks for a really speedy response!
 
Level 6
Joined
Jun 4, 2009
Messages
91
the advantage with creating/destroying is that you can use the same variable in every triggers, so you won't have a hudge list if you need many different locations. But if you need only this one, you should pre-allocate once.
 
Status
Not open for further replies.
Top