HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Location Leaks?

08-31-2006, 06:37 AM#1
darkwulfv
I'm unsure whether this trigger has leaks or not. Since I use Random Point in Rect(bla) in many triggers, this is only one of them, since it would apply to all anyways.
Trigger:
Wave 1
Collapse Events
Time - StartTimer expires
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to NumberOfPlayers, do (Actions)
Collapse Loop - Actions
Unit - Create 9 Alien Spawn 1 for Player 12 (Brown) at (Random point in Alien Spawn <gen>) facing Default building facing (270.0) degrees
Unit Group - Order (Units in Alien Spawn <gen>) to Attack-Move To (Random point in Spawn Attack Target <gen>)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Get the event that fired the trigger) Equal to Timer Expires
Collapse Then - Actions
Trigger - Add to (This trigger) the event (Time - Every 30.00 seconds of game time)
Set Level = (Level + 1)
Collapse Else - Actions
Do nothing

I'm pretty sure the custom text would be RemoveLoc(...) but I'm not positive for this. Anyone know? Thanks.
08-31-2006, 06:50 AM#2
PipeDream
You can decide for yourself quite easily. Convert the trigger to custom text, and find the function which generates the random point. Then look it up in Blizzard.j, and you should find something which clearly does or does not create a location.

In this case though it clearly creates a new location as the random point is not something that exists beforehand.
08-31-2006, 10:29 AM#3
aquilla
You had a group leak as well, the code below should take care of things. Don't destroy the tempgroup as it's continously used by the create unit thingy
Trigger:
...
Set temploc = (Random point in Alien Spawn <gen>)
Unit - Create 9 Alien Spawn 1 for Player 12 (Brown) at (temploc) facing Default building facing (270.0) degrees
Custom script: call RemoveLocation(udg_temploc)
Set temploc = (Random point in Spawn Attack Target <gen>)
Custom script: set udg_tempgroup = bj_lastCreatedGroup
Unit Group - Order (tempgroup) to Attack-Move To (temploc)
Custom script: call RemoveLocation(udg_temploc)
...
08-31-2006, 02:27 PM#4
darkwulfv
Oh, Thanks Aquilla. I'll put that through all my triggers, it looks good. +rep