Hello, I am making a map in which units spawn in one of 3 barracks and run across a field into one of 3 enemy barracks, and when they get there, it sends them back and goes again. I use Set RandomNumber for the randomization of the return and attack path, but i have noticed a few things.
Trigger-
Here are the problems.
1- South Barracks Left has the least amount of units per wave, usually 1 or 2 out of 12. Furthermore, they only go straight up to North Barracks Left, never going to North Mid or North Right.
2- South Barracks Mid has a medium amount of units per wave and they split to North Left and North Mid, but they never go to North Right.
3- South Barracks Right has the majority of units per wave and they split to each North Barracks.
There is also a South Return with the same trigger and problems, but reversed so they come from North and return at South. I would like to see the unit spawn/split evened out. Can anyone help with these problems?
Trigger-
Code:
North Return
Events
Unit - A unit enters Northwest Return 1 <gen>
Unit - A unit enters Northwest Return 2 <gen>
Unit - A unit enters Northeast Return 1 <gen>
Unit - A unit enters Northeast Return 2 <gen>
Unit - A unit enters North Return <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Actions
Set RandomNumber = (Random integer number between 1 and 3)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 1
Then - Actions
Set ReturnLoc = (Center of South Barracks Left <gen>)
Unit - Move (Triggering unit) instantly to ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Set RandomNumber = (Random integer number between 1 and 3)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 1
Then - Actions
Set ReturnLoc = (Center of North Barracks Left <gen>)
Unit - Order (Triggering unit) to Attack-Move To ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 2
Then - Actions
Set ReturnLoc = (Center of North Barracks Mid <gen>)
Unit - Order (Triggering unit) to Attack-Move To ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 3
Then - Actions
Set ReturnLoc = (Center of North Barracks Right <gen>)
Unit - Order (Triggering unit) to Attack-Move To ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 2
Then - Actions
Set ReturnLoc = (Center of South Barracks Mid <gen>)
Unit - Move (Triggering unit) instantly to ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Set RandomNumber = (Random integer number between 1 and 3)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 1
Then - Actions
Set ReturnLoc = (Center of North Barracks Left <gen>)
Unit - Order (Triggering unit) to Attack-Move To ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 2
Then - Actions
Set ReturnLoc = (Center of North Barracks Mid <gen>)
Unit - Order (Triggering unit) to Attack-Move To ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 3
Then - Actions
Set ReturnLoc = (Center of North Barracks Right <gen>)
Unit - Order (Triggering unit) to Attack-Move To ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 3
Then - Actions
Set ReturnLoc = (Center of South Barracks Right <gen>)
Unit - Move (Triggering unit) instantly to ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Set RandomNumber = (Random integer number between 1 and 3)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 1
Then - Actions
Set ReturnLoc = (Center of North Barracks Left <gen>)
Unit - Order (Triggering unit) to Attack-Move To ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 2
Then - Actions
Set ReturnLoc = (Center of North Barracks Mid <gen>)
Unit - Order (Triggering unit) to Attack-Move To ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RandomNumber Equal to 3
Then - Actions
Set ReturnLoc = (Center of North Barracks Right <gen>)
Unit - Order (Triggering unit) to Attack-Move To ReturnLoc
Custom script: call RemoveLocation(udg_ReturnLoc)
Else - Actions
Else - Actions
Here are the problems.
1- South Barracks Left has the least amount of units per wave, usually 1 or 2 out of 12. Furthermore, they only go straight up to North Barracks Left, never going to North Mid or North Right.
2- South Barracks Mid has a medium amount of units per wave and they split to North Left and North Mid, but they never go to North Right.
3- South Barracks Right has the majority of units per wave and they split to each North Barracks.
There is also a South Return with the same trigger and problems, but reversed so they come from North and return at South. I would like to see the unit spawn/split evened out. Can anyone help with these problems?