MorbazanRhot
New Member
- Reaction score
- 7
I have a pretty simple question regarding where to remove a variable within multiple instances of it in a single trigger.
Example:
Is that fine? Or would it be better like this:
I'd just like to know which of these would be more efficient? I assumed the first just because it has less lines, but would it be worse for some reason because it's not removed before being assigned a new value? Or maybe neither of these are any good? And would the same go for points, like setting TempPoint1=center of rect, then spawning units there, setting TempPoint1=center of a different rect, then spawning units there, etc. and removing TempPoint1 at the end? Thanks, and +rep for help.
edit: And yes, I know that if there's a wait it needs to be removed before the wait. I'm asking for situations where there are no waits in between.
Example:
Code:
Defenses
Events
Time - Elapsed game time is 0.50 seconds
Conditions
Actions
Set unitgroup = (Units in Pink Army 1 <gen>)
Unit Group - Pick every unit in unitgroup and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Hold Position
Set unitgroup = (Units in Pink Army 2 <gen>)
Unit Group - Pick every unit in unitgroup and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Hold Position
Set unitgroup = (Units in Pink Army 3 <gen>)
Unit Group - Pick every unit in unitgroup and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Hold Position
Set unitgroup = (Units in Pink Army 4 <gen>)
Unit Group - Pick every unit in unitgroup and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Hold Position
Custom script: call DestroyGroup (udg_unitgroup)
Is that fine? Or would it be better like this:
Code:
Defenses
Events
Time - Elapsed game time is 0.50 seconds
Conditions
Actions
Set unitgroup = (Units in Pink Army 1 <gen>)
Unit Group - Pick every unit in unitgroup and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Hold Position
Custom script: call DestroyGroup (udg_unitgroup)
Set unitgroup = (Units in Pink Army 2 <gen>)
Unit Group - Pick every unit in unitgroup and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Hold Position
Custom script: call DestroyGroup (udg_unitgroup)
Set unitgroup = (Units in Pink Army 3 <gen>)
Unit Group - Pick every unit in unitgroup and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Hold Position
Custom script: call DestroyGroup (udg_unitgroup)
Set unitgroup = (Units in Pink Army 4 <gen>)
Unit Group - Pick every unit in unitgroup and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to Hold Position
Custom script: call DestroyGroup (udg_unitgroup)
I'd just like to know which of these would be more efficient? I assumed the first just because it has less lines, but would it be worse for some reason because it's not removed before being assigned a new value? Or maybe neither of these are any good? And would the same go for points, like setting TempPoint1=center of rect, then spawning units there, setting TempPoint1=center of a different rect, then spawning units there, etc. and removing TempPoint1 at the end? Thanks, and +rep for help.
edit: And yes, I know that if there's a wait it needs to be removed before the wait. I'm asking for situations where there are no waits in between.