Warcraft III resources & community, 2003–2006 · archived

Custom Script Question

5 posts
#1

Custom Script Question

the following is some GUI code from my map:

Set point1 = (Random point in worker patrol 1 <gen>)
Unit - Order (Triggering unit) to Patrol To point1

my question is, how do i make sure the points and groups don't cause memory leaks? i tried using the following function:

Custom script: call RemoveLocation (udg_point1)

but the leak checker tells me that local variable point1 has not been removed. can anyone set me straight?
#2
the oh-so-great leak checker doesnt check JASS, as far as i know

anyways, that doesnt leak :D
#3
hmmmm well what about this:

random mobs 7
Events
Time - Every 8.00 seconds of game time
Conditions
Actions
Set point1 = (Random point in random mobs 7 <gen>)
Set group1 = (Units owned by Player 12 (Brown) of type Bandit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in group1) Less than or equal to 6
Then - Actions
Unit - Create 1 Bandit for Player 12 (Brown) at point1 facing Default building facing degrees
Else - Actions

would this leak?
#4
Yes it would, you need to destroy the location and the group
#5
at the end of the trigger ( outside of the if/then ), make

Custom Script: call DestroyGroup( udg_group1 )