HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Does these functions leak?

03-02-2005, 05:00 AM#1
Al3ks
below is a section of my spawn trigger and the cluster mines trigger, i have read the post about preventing memory leaks, but im still not completely sure if my trigger does leak. should i be using a point variable or not?



spawn
Events
Time - Every 30.00 seconds of game time
Conditions
Actions
-------- Alliance Centre --------
Unit - Create (3 + multiplier[1]) footman[2] for Player 1 (Red) at (Center of alliance centre <gen>) facing (Position of Fortress 0039 <gen>)
Unit - Create (1 + multiplier[2]) knight for Player 1 (Red) at (Center of alliance centre <gen>) facing (Position of Fortress 0039 <gen>)
Unit - Create (1 + multiplier[2]) mage[2] for Player 1 (Red) at (Center of alliance centre <gen>) facing (Position of Fortress 0039 <gen>)
Unit - Create (1 + multiplier[2]) Archer for Player 1 (Red) at (Center of alliance centre <gen>) facing (Position of Fortress 0039 <gen>)
-------- Move Command --------
Unit Group - Pick every unit in (Units in alliance centre <gen> owned by Player 1 (Red)) and do (Unit - Order (Picked unit) to Attack-Move To (Position of Fortress 0039 <gen>))
-------- Building Animation --------
Unit Group - Pick every unit in (Units of type Barracks) and do (Animation - Reset (Picked unit)'s animation)
Unit Group - Pick every unit in (Units of type Arcane Sanctum) and do (Animation - Reset (Picked unit)'s animation)
Unit Group - Pick every unit in (Units of type Blacksmith) and do (Animation - Reset (Picked unit)'s animation)
Wait 20.00 seconds
Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to Barracks) and (((Matching unit) is alive) Equal to True))) and do (Animation - Play (Picked unit)'s work animation)
Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to Arcane Sanctum) and (((Matching unit) is alive) Equal to True))) and do (Animation - Play (Picked unit)'s work animation)
Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to Blacksmith) and (((Matching unit) is alive) Equal to True))) and do (Animation - Play (Picked unit)'s work animation)





cluster mines
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Cluster Mines
Actions
Set barrage = (Target point of ability being cast)
For each (Integer A) from 1 to (3 + (3 x (Level of Cluster Mines for (Triggering unit)))), do (Actions)
Loop - Actions
Unit - Create 1 Wisp for (Triggering player) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
Unit - Add Cluster Mines (dummy) to (Last created unit)
Unit - Set Level of Cluster Mines (dummy) for (Last created unit) to (Level of Land Mine for (Triggering unit))
Unit - Order (Last created unit) to Neutral Tinker - Pocket Factory (barrage offset by (Random real number between 100.00 and (250.00 + (150.00 x (Real((Level of Cluster Rockets for (Triggering unit))))))) towards (Random angle) degrees)
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
03-02-2005, 12:54 PM#2
Elven Ronin
Yes, and remove it at the end
03-02-2005, 04:29 PM#3
Al3ks
Quote:
Originally Posted by Elven Ronin
Yes, and remove it at the end


can u give me an example of how it is done? by the way wouldn't i have to create and destroy the variable ateast 30 times eachtime the trigger fires?
03-02-2005, 09:20 PM#4
Raptor--
everytime you used 'position of XXX' and 'Center of region YYY' those leak, you need to set them to a point first, like udg_temppoint and then after u use it, call RemoveLocation( udg_temppoint )

everytime u use 'pick every unit in group ZZZ' that leaks, you need to set them to a var first and then call DestroyGroup (var) i believe