I'm updating my Battle for Tatooine map. I'd love to improve the efficiency of the coding. I heard that sometimes it is better to have 1 trigger for each event. I'm curious if this is true. I'll be very specific; which of the following two options is more efficient (in terms of avoiding lag, not in terms of the programer's time):
Option #1:
Option #2:
And so on...
By the way, if you have suggestions or requests for my map, please let me know here:
http://www.hiveworkshop.com/forums/map-development-202/battle-tatooine-update-255342/#post2563841
Option #1:
-
Slip
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Ability being cast) Equal to Slip Left
- (Ability being cast) Equal to Slip Right
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
- Set tempUnit = (Triggering unit)
- Set tempInteger = (Custom value of tempUnit)
- // blah blah... lots of actions specific to this trigger
-
Events
-
Barrel Roll Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Barrel Roll
-
Actions
- Set tempUnit = (Triggering unit)
- Set tempInteger = (Custom value of tempUnit)
- //blah blah...lots of actions specific to this trigger
-
Events
Option #2:
-
Ultimate Ability Trigger
-
Events
- Unit - A unit Starts the effect of an ability
- Conditions
-
Actions
- Set tempUnit = (Triggering unit)
- Set tempInteger = (Custom value of tempUnit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Ability being cast) Equal to Slip Left
- (Ability being cast) Equal to Slip Right
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Trigger - Run Slip <gen> (checking conditions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Ability being cast) Equal to Barrel Roll
-
Then - Actions
- Trigger - Run Barrel Roll Cast <gen> (checking conditions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Events
And so on...
By the way, if you have suggestions or requests for my map, please let me know here:
http://www.hiveworkshop.com/forums/map-development-202/battle-tatooine-update-255342/#post2563841