Hey guys, I'm trying to create a bunker system in my Terran Base Defence map. I have a system in place, but it doesn't work when there are 2 or more bunker on the map. I am aware of why, but Ive never been good at fixing this sort of problem (like making spells MUI so they can work for more than 1 hero, etc).
Here is the triggers:
There are only 2 types of units allowed in bunkers (marines and firebats) and a max of 2 units can fit inside the bunker. If you've played starcraft 1 or 2, you'd understand that if a firebat enters the bunker, it gets a fire attack. If a marine enters the bunker, it gets a machine gun like attack. So I've used the "pheonixes fire" ability to the bunker.
I have used a wait function to detect a unit leaving the bunker and this wait function makes the system not MUI and glitches if there are more than 1 bunker. Does anybody know how to fix this system please?
Here is the triggers:
-
Marine Load
-
Events
- Unit - A unit Is loaded into a transport
-
Conditions
- (Unit-type of (Loading unit)) Equal to Marine
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] Equal to 0
-
Then - Actions
- Unit - Add Marine Fire to (Transporting unit)
- Unit - Add Marine Slot to (Transporting unit)
- Set Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] = 1
- Wait until (((Triggering unit) is loaded into (Transporting unit)) Equal to False), checking every 2.00 seconds
- Set Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] = (Bunker_Count_Marine[1] - 1)
- Unit - Remove Marine Fire from (Transporting unit)
- Unit - Remove Marine Slot from (Transporting unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] Equal to 1
-
Then - Actions
- Unit - Increase level of Marine Fire for (Transporting unit)
- Unit - Increase level of Marine Slot for (Transporting unit)
- Set Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] = 2
- Wait until (((Triggering unit) is loaded into (Transporting unit)) Equal to False), checking every 2.00 seconds
- Set Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] = (Bunker_Count_Marine[1] - 1)
- Unit - Set level of Marine Fire for (Transporting unit) to Bunker_Count_Marine[1]
- Unit - Set level of Marine Slot for (Transporting unit) to Bunker_Count_Marine[1]
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Firebat Load
-
Events
- Unit - A unit Is loaded into a transport
-
Conditions
- (Unit-type of (Loading unit)) Equal to Firebat
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Bunker_Count_Firebat[(Player number of (Owner of (Triggering unit)))] Equal to 0
-
Then - Actions
- Unit - Add Firebat Fire to (Transporting unit)
- Unit - Add Firebat Slot to (Transporting unit)
- Set Bunker_Count_Marine[2] = 1
- Wait until (((Triggering unit) is loaded into (Transporting unit)) Equal to False), checking every 0.25 seconds
- Set Bunker_Count_Marine[2] = (Bunker_Count_Marine[2] - 1)
- Unit - Remove Firebat Fire from (Transporting unit)
- Unit - Remove Firebat Slot from (Transporting unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Bunker_Count_Firebat[(Player number of (Owner of (Triggering unit)))] Equal to 1
-
Then - Actions
- Unit - Increase level of Firebat Fire for (Transporting unit)
- Unit - Increase level of Firebat Slot for (Transporting unit)
- Set Bunker_Count_Marine[2] = 2
- Wait until (((Triggering unit) is loaded into (Transporting unit)) Equal to False), checking every 0.25 seconds
- Set Bunker_Count_Marine[2] = (Bunker_Count_Marine[2] - 1)
- Unit - Set level of Firebat Fire for (Transporting unit) to Bunker_Count_Marine[2]
- Unit - Set level of Firebat Slot for (Transporting unit) to Bunker_Count_Marine[2]
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
I have used a wait function to detect a unit leaving the bunker and this wait function makes the system not MUI and glitches if there are more than 1 bunker. Does anybody know how to fix this system please?