- Joined
- Mar 27, 2008
- Messages
- 8,035
TRIGGER 1
But what about a unit that is NOT in that KnockBackGroup ?
Of course, this is what I'm talking about doing a null thing or just simply does nothing action
Example: You're washing a clean plate. (doing something that should not been done will return it as null). You wash a clean plate = ? Yes, a clean plate.
TRIGGER 2
Yes, by this way, this action will return a non-null result
True Question: Which is more efficient ?
Frequently Faced Situation:
Now, this IF/THEN/ELSE function is to determine whether to turn the trigger ON or OFF (for less-lag game, you can prevent a lag game by turning off a looping trigger which is not needed (like Unit Group is empty, turn off trigger)
My question is, should we perform a check before turning on the trigger or just turn it on without performing a check, just:
-
Remove Unit From Group
-
Events
- Unit - A unit Dies
- Conditions
-
Actions
- Unit Group - Remove (Triggering unit) from KnockBackGroup
-
Events
But what about a unit that is NOT in that KnockBackGroup ?
Of course, this is what I'm talking about doing a null thing or just simply does nothing action
Example: You're washing a clean plate. (doing something that should not been done will return it as null). You wash a clean plate = ? Yes, a clean plate.
TRIGGER 2
-
Remove Unit From Group
-
Events
- Unit - A unit Dies
-
Conditions
- ((Triggering unit) is in KnockBackGroup) Equal to True
-
Actions
- Unit Group - Remove (Triggering unit) from KnockBackGroup
-
Events
Yes, by this way, this action will return a non-null result
True Question: Which is more efficient ?
Frequently Faced Situation:
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (WS KnockBack <gen> is on) Equal to False
-
Then - Actions
- Trigger - Turn on WS KnockBack <gen>
- Else - Actions
-
If - Conditions
Now, this IF/THEN/ELSE function is to determine whether to turn the trigger ON or OFF (for less-lag game, you can prevent a lag game by turning off a looping trigger which is not needed (like Unit Group is empty, turn off trigger)
My question is, should we perform a check before turning on the trigger or just turn it on without performing a check, just:
- Trigger - Turn on WS KnockBack <gen>