- Joined
- Sep 20, 2024
- Messages
- 15
Hello,
1. Do I need to make many point variables "TempPoint1, TempPoint2, TempPoint3... etc." and then have each point variable only be used for maximum 1 trigger to fix all memory leaks? Or can I use only one variable "TempPoint1" for all my triggers even though triggers are active at same time and different regions for the point variable?
2. Should I use the variable called "Point" or "Point Array" for best optimization and no leaks?
Below is some triggers from my map:
1. Do I need to make many point variables "TempPoint1, TempPoint2, TempPoint3... etc." and then have each point variable only be used for maximum 1 trigger to fix all memory leaks? Or can I use only one variable "TempPoint1" for all my triggers even though triggers are active at same time and different regions for the point variable?
2. Should I use the variable called "Point" or "Point Array" for best optimization and no leaks?
Below is some triggers from my map:
-
Wave Green base
-
Events
-
Time - Every 30.00 seconds of game time
-
-
Conditions
-
Actions
-
Set VariableSet AE_TmpGroup[0] = (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to Crypt) and ((Owner of (Matching unit)) Equal to Player 7 (Green)))))
-
Set VariableSet AE_Tmpinteger[0] = (Random integer number between 1 and 3)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
AE_Tmpinteger[0] Equal to 1
-
-
Then - Actions
-
Set VariableSet Wave_Type1 = Ghoul
-
Set VariableSet Wave_Amount1 = 2
-
Set VariableSet Wave_Amount1 = (Wave_Amount1 + (Wave_Bonus1 x (Integer(0.75))))
-
Set VariableSet Wave_Type2 = Necromancer
-
Set VariableSet Wave_Amount2 = 0
-
Set VariableSet Wave_Amount2 = (Wave_Amount2 + (Wave_Bonus1 x (Integer(0.34))))
-
Set VariableSet Wave_Type3 = No unit-type
-
Set VariableSet Wave_Amount3 = 0
-
Set VariableSet Wave_Type4 = No unit-type
-
Set VariableSet Wave_Amount4 = 0
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
AE_Tmpinteger[0] Equal to 2
-
-
Then - Actions
-
Set VariableSet Wave_Type1 = Skeleton Warrior
-
Set VariableSet Wave_Amount1 = 1
-
Set VariableSet Wave_Amount1 = (Wave_Amount1 + (Wave_Bonus1 x (Integer(0.75))))
-
Set VariableSet Wave_Type2 = Skeleton Archer
-
Set VariableSet Wave_Amount2 = 1
-
Set VariableSet Wave_Amount2 = (Wave_Amount2 + (Wave_Bonus1 x (Integer(0.75))))
-
Set VariableSet Wave_Type3 = Skeletal Orc
-
Set VariableSet Wave_Amount3 = 1
-
Set VariableSet Wave_Amount3 = (Wave_Amount3 + (Wave_Bonus1 x (Integer(0.75))))
-
Set VariableSet Wave_Type4 = Skeletal Mage
-
Set VariableSet Wave_Amount4 = 1
-
Set VariableSet Wave_Amount4 = (Wave_Amount4 + (Wave_Bonus1 x (Integer(0.75))))
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
AE_Tmpinteger[0] Equal to 3
-
-
Then - Actions
-
Set VariableSet Wave_Type1 = Zombie
-
Set VariableSet Wave_Amount1 = 2
-
Set VariableSet Wave_Amount1 = (Wave_Amount1 + Wave_Bonus1)
-
Set VariableSet Wave_Type2 = Abomination
-
Set VariableSet Wave_Amount2 = 0
-
Set VariableSet Wave_Amount2 = (Wave_Amount2 + (Wave_Bonus1 x (Integer(0.20))))
-
Set VariableSet Wave_Type3 = No unit-type
-
Set VariableSet Wave_Amount3 = 0
-
Set VariableSet Wave_Type4 = No unit-type
-
Set VariableSet Wave_Amount4 = 0
-
-
Else - Actions
-
-
Set VariableSet AE_Tmpinteger[1] = (Random integer number between 1 and 2)
-
For each (Integer A) from 1 to Wave_Amount1, do (Actions)
-
Loop - Actions
-
Set VariableSet AE_TmpPoint[1] = (Position of (Random unit from AE_TmpGroup[0]))
-
Unit - Create 1 Wave_Type1 for Player 1 (Red) at AE_TmpPoint[1] facing Default building facing degrees
-
AI - Ignore (Last created unit)'s guard position
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
AE_Tmpinteger[1] Equal to 1
-
-
Then - Actions
-
Set VariableSet AE_TmpPoint[0] = (Center of GreenHordeGather2 <gen>)
-
Unit - Order (Last created unit) to Attack-Move To AE_TmpPoint[0]
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
-
Else - Actions
-
Set VariableSet AE_TmpPoint[0] = (Center of GreenHordeGather1 <gen>)
-
Unit - Order (Last created unit) to Attack-Move To AE_TmpPoint[0]
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
-
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[1])
-
-
-
For each (Integer A) from 1 to Wave_Amount2, do (Actions)
-
Loop - Actions
-
Set VariableSet AE_TmpPoint[1] = (Position of (Random unit from AE_TmpGroup[0]))
-
Unit - Create 1 Wave_Type2 for Player 1 (Red) at AE_TmpPoint[1] facing Default building facing degrees
-
AI - Ignore (Last created unit)'s guard position
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
AE_Tmpinteger[1] Equal to 1
-
-
Then - Actions
-
Set VariableSet AE_TmpPoint[0] = (Center of GreenHordeGather2 <gen>)
-
Unit - Order (Last created unit) to Attack-Move To AE_TmpPoint[0]
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
-
Else - Actions
-
Set VariableSet AE_TmpPoint[0] = (Center of GreenHordeGather1 <gen>)
-
Unit - Order (Last created unit) to Attack-Move To AE_TmpPoint[0]
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
-
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[1])
-
-
-
For each (Integer A) from 1 to Wave_Amount3, do (Actions)
-
Loop - Actions
-
Set VariableSet AE_TmpPoint[1] = (Position of (Random unit from AE_TmpGroup[0]))
-
Unit - Create 1 Wave_Type3 for Player 1 (Red) at AE_TmpPoint[1] facing Default building facing degrees
-
AI - Ignore (Last created unit)'s guard position
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
AE_Tmpinteger[1] Equal to 1
-
-
Then - Actions
-
Set VariableSet AE_TmpPoint[0] = (Center of GreenHordeGather2 <gen>)
-
Unit - Order (Last created unit) to Attack-Move To AE_TmpPoint[0]
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
-
Else - Actions
-
Set VariableSet AE_TmpPoint[0] = (Center of GreenHordeGather1 <gen>)
-
Unit - Order (Last created unit) to Attack-Move To AE_TmpPoint[0]
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
-
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[1])
-
-
-
For each (Integer A) from 1 to Wave_Amount4, do (Actions)
-
Loop - Actions
-
Set VariableSet AE_TmpPoint[1] = (Position of (Random unit from AE_TmpGroup[0]))
-
Unit - Create 1 Wave_Type4 for Player 1 (Red) at AE_TmpPoint[1] facing Default building facing degrees
-
AI - Ignore (Last created unit)'s guard position
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
AE_Tmpinteger[1] Equal to 1
-
-
Then - Actions
-
Set VariableSet AE_TmpPoint[0] = (Center of GreenHordeGather2 <gen>)
-
Unit - Order (Last created unit) to Attack-Move To AE_TmpPoint[0]
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
-
Else - Actions
-
Set VariableSet AE_TmpPoint[0] = (Center of GreenHordeGather1 <gen>)
-
Unit - Order (Last created unit) to Attack-Move To AE_TmpPoint[0]
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
-
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[1])
-
-
-
Custom script: call DestroyGroup (udg_AE_TmpGroup[0])
-
Wait 30.00 seconds
-
Unit Group - Pick every unit in (Units in GreenHordeGather1 <gen> owned by Player 1 (Red)) and do (Actions)
-
Loop - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Random point in Hearthglen <gen>)
-
-
-
Unit Group - Pick every unit in (Units in GreenHordeGather2 <gen> owned by Player 1 (Red)) and do (Actions)
-
Loop - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Random point in Hearthglen <gen>)
-
-
-
-
-
Summon Loop
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
(Boss_Necromaster is hidden) Equal to False
-
-
Actions
-
Set VariableSet AE_TmpPoint[0] = (Position of Boss_Necromaster)
-
Set VariableSet AE_TmpPoint[1] = (AE_TmpPoint[0] offset by 150.00 towards (Random angle) degrees.)
-
Set VariableSet AE_TmpPoint[2] = (Random point in Hearthglen <gen>)
-
Set VariableSet AE_TmpType[0] = Skeleton Warrior
-
Set VariableSet AE_TmpType[1] = Skeletal Orc
-
Set VariableSet AE_TmpType[2] = Skeleton Archer
-
Unit - Create 1 AE_TmpType[(Random integer number between 0 and 2)] for Player 1 (Red) at AE_TmpPoint[1] facing (Random angle) degrees
-
Unit - Add a 600.00 second Generic expiration timer to (Last created unit)
-
Unit - Order (Last created unit) to Attack-Move To AE_TmpPoint[2]
-
Special Effect - Create a special effect at AE_TmpPoint[1] using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
-
Special Effect - Destroy (Last created special effect)
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[1])
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[2])
-
-
-
Necroblast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Necroblast
-
-
Actions
-
Set VariableSet AE_TmpPoint[0] = (Position of (Triggering unit))
-
Set VariableSet AE_TmpGroup[0] = (Units within 500.00 of AE_TmpPoint[0] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of Player 1 (Red).) Equal to True)).)
-
Set VariableSet AE_Tmpinteger[0] = 0
-
Unit Group - Pick every unit in AE_TmpGroup[0] and do (Actions)
-
Loop - Actions
-
Set VariableSet AE_Tmpinteger[0] = (AE_Tmpinteger[0] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
AE_Tmpinteger[0] Less than 6
-
-
Then - Actions
-
Set VariableSet AE_TmpPoint[1] = (Position of (Picked unit))
-
Unit - Create 1 Necroblast (Target) for Player 1 (Red) at AE_TmpPoint[1] facing Default building facing degrees
-
Unit - Add a 2.20 second Generic expiration timer to (Last created unit)
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[1])
-
-
Else - Actions
-
-
-
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
-
-
Final wave ghouls
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Set VariableSet AE_TmpPoint[0] = (Center of FinalAttackGhouls1 <gen>)
-
Unit - Create 1 Ghoul for Player 6 (Orange) at AE_TmpPoint[0] facing Default building facing degrees
-
AI - Ignore (Last created unit)'s guard position
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[0])
-
Unit - Order (Last created unit) to Attack-Move To (Random point in Hearthglen <gen>)
-
Set VariableSet AE_TmpPoint[1] = (Center of FinalAttackGhouls2 <gen>)
-
Unit - Create 1 Ghoul for Player 8 (Pink) at AE_TmpPoint[1] facing Default building facing degrees
-
AI - Ignore (Last created unit)'s guard position
-
Custom script: call RemoveLocation (udg_AE_TmpPoint[1])
-
Unit - Order (Last created unit) to Attack-Move To (Random point in Hearthglen <gen>)
-
-
Last edited: