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

spawns. Does this leak?

Status
Not open for further replies.
Level 13
Joined
Mar 23, 2008
Messages
1,214
Hello there people. Im making a spawn based map. Just like Lordaeron Tactics and the Battle for Middle Earth. And i wanna know if it would cause leak with a normal GUI trigger.

Now, i havent made the trigger yet, but if i just made simple spawn at region, or at position of unit (that would be the castles). Would it then leak, or wouldnt it as i use the same position over and over again?
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Yes you need to remove leaks if you use region´s locations


some people say yes some no but i think there is no need to remove leak if your position is unit/destructible in map( that is already WE )

BTW this is how you remove leaks

set VariableTypePoint = (somewhere)
-use your VariableTypePoint as many times you want but don't change it until removing
Custom Script:call RemoveLocation(udg_NameOfYourVarable)
 
Level 10
Joined
Aug 15, 2008
Messages
720
1. It won't cause leak. For such triggers you don't need JASS or vJASS.

2. It would leak of course, use TempLoc/Variables and then remove em.
2.1 Since it is periodical, when timer reaches 0 then all units will spawn, yes? In spawn trigger use those Variables (like TempLoc as point variable) and when trigger finishes main actions then add custom scripts at the end of trigger to remove/null these variables. (call RemoveLocation(udg_TempLoc) , call DestroyGroup(udg_TempGroup) and etc.

Only things what don't leak are integers, strings, reals, boolean and those type of stuff.

See http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/basic-memory-leaks-5889/ for more information about what leaks do.

So basicly you need variables nearly for all things except for those exceptions mentioned above. You can of course set em in variables to make your trigger easier to modify, but its optional.
 
Level 13
Joined
Mar 23, 2008
Messages
1,214
But, if i remove a location with custom script (just so you all know, i already knew how to do it). Will i then be able to set that position again, or have i removed it completely?

BTW Azeroc, dont really understand your 1./2./2.1 thingy. Whats that???
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
As always this can be done without setting any points instead of using perm-regions which are createable via the WE and using periodic events for spawn & attack.
PS: Don't forget to ignore the guard position for the owner of the spawned units (eg. Creeps), because when they got hit by a friendly spell (ex: Flame Strike, Blizzard) they might flee out of battle or I might change their lane if another creep is attacked from the other lane.
 
if you don't want to set the location again and again then set it on initialization and use in your spawn trigger. also, you won't need to remove the location as it will be variable.

I think this works since you would only create the point once(during map initialization) but if during some time of the game you would relocate the point then you should remove the first point and set the new point into the variable.
 
whats so hard with this -.-


set POINT = (somewhere)
-create you dummy unit at POINT
Custom Script:call RemoveLocation(udg_POINT)

No one is saying that its hard, its really almost the same as the other suggestion because you would also write it only once but they differ in execution because the other suggestion will only create the point once while this will make it every time the trigger runs then delete it afterwards, its just a matter of a very-little time saving every time the trigger is ran.
 
Status
Not open for further replies.
Top