HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Quick Q about Point Variable

05-09-2006, 10:29 PM#1
StRoNgFoE_2000
Hello again. In a previous post I was given a little heads up on memory leaks. To avoid memory leaks when creating a unit, I see you have to create a temporary point, create the unit, and then remove it.

So, if I have a trigger that uses a point, can I use that same point in another trigger without it interfering with the first trigger without using an array.

Trigger:
Round1Melee1
Collapse Events
Time - Every 14.00 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Player((Integer A))) slot status) Equal to Is playing
Collapse Then - Actions
Collapse For each (Integer B) from 1 to 3, do (Actions)
Collapse Loop - Actions
Set UnitSpawns = (Random point in Bowl <gen>)
Unit - Create 1 Soldier (Level 1-HMelee) for (Player((Integer A))) at UnitSpawns facing Default building facing (270.0) degrees
Point - Remove UnitSpawns
Set UnitSpawns = (Random point in Bowl <gen>)
Unit - Order (Last created unit) to Patrol To UnitSpawns
Point - Remove UnitSpawns
Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
Special Effect - Destroy (Last created special effect)
Unit - Add a 14.00 second Generic expiration timer to (Last created unit)
Else - Actions
Collapse For each (Integer B) from 1 to 3, do (Actions)
Collapse Loop - Actions
Set UnitSpawns = (Random point in Bowl <gen>)
Unit - Create 1 Bandit (Level 1-CMelee) for Neutral Hostile at UnitSpawns facing Default building facing (270.0) degrees
Point - Remove UnitSpawns
Set UnitSpawns = (Random point in Bowl <gen>)
Unit - Order (Last created unit) to Patrol To UnitSpawns
Point - Remove UnitSpawns
Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
Special Effect - Destroy (Last created special effect)
Unit - Add a 14.00 second Generic expiration timer to (Last created unit)

The big question is can I use the point variable UnitSpawns in another trigger without it affecting this one, or should I use an array for each new trigger?
05-09-2006, 11:45 PM#2
PipeDream
Yes, this is fine. The warcraft engine is not multitasking. You need only worry if you use sleeps or do things which trigger other triggers.
05-10-2006, 08:13 AM#3
The)TideHunter(
Or, if you set the point in your other trigger and as Pipe said, your first trigger is still using that point.