- Joined
- Jun 1, 2009
- Messages
- 137
A little question about performance optimization.
What is better: create a separate trigger with it's own conditions for each case, or create one trigger with multiple If Then Else?
Example:
What is better? Keep it as-is? Split on multiple separated triggers? Or both variants are equal?
Thank you for help!
What is better: create a separate trigger with it's own conditions for each case, or create one trigger with multiple If Then Else?
Example:
-
Example 1
-

Events
-


Unit - A unit owned by Player 1 (Red) Dies
-
-

Conditions
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




Round Equal to 1
-
-



Then - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Unit-type of (Dying unit)) Equal to Spawn_UnitType[1]
-
-





Then - Actions
-






-------- do some stuff --------
-
-





Else - Actions
-






Do nothing
-
-
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Unit-type of (Dying unit)) Equal to Spawn_UnitType[2]
-
-





Then - Actions
-






-------- do some stuff --------
-
-





Else - Actions
-






Do nothing
-
-
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Unit-type of (Dying unit)) Equal to Spawn_UnitType[3]
-
-





Then - Actions
-






-------- do some stuff --------
-
-





Else - Actions
-






Do nothing
-
-
-
-



Else - Actions
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




Round Equal to 2
-
-



Then - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Unit-type of (Dying unit)) Equal to Spawn_UnitType[1]
-
-





Then - Actions
-






-------- do some stuff --------
-
-





Else - Actions
-






Do nothing
-
-
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Unit-type of (Dying unit)) Equal to Spawn_UnitType[2]
-
-





Then - Actions
-






-------- do some stuff --------
-
-





Else - Actions
-






Do nothing
-
-
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Unit-type of (Dying unit)) Equal to Spawn_UnitType[3]
-
-





Then - Actions
-






-------- do some stuff --------
-
-





Else - Actions
-






Do nothing
-
-
-
-



Else - Actions
-
-
-
What is better? Keep it as-is? Split on multiple separated triggers? Or both variants are equal?
Thank you for help!





