- Joined
- Apr 23, 2009
- Messages
- 94
Ok so heres what i've got.
This was easy, the hard part is, I need to make it so you can cancel any selection by re-clicking on the selected target, removing that "Dig" unit from the game.
So I need to find the closest "Dig" unit, and if he isn't like 10 in Warcraft distance, then it creates a new "Dig" unit on the slected target, and if he is within the 10 mark, then it removes him.
I hope that was understandable.
-
Player1Order Copy
-
Events
-
Player - Player 1 (Red) Selects a unit
-
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Fortified Wall
-
-
Actions
-
Unit Group - Add (Triggering unit) to Dig_Group
-
Set Temp_Group_2 = (Units owned by Player 1 (Red) matching ((Unit-type of (Matching unit)) Equal to Dig))
-
Unit Group - Pick every unit in Temp_Group_2 and do (Actions)
-
Loop - Actions
-
Set Temp_Unit_1 = (Picked unit)
-
Set Temp_Loc_1 = (Position of Temp_Unit_1)
-
Set Temp_Real_1 = 999999.00
-
Unit Group - Pick every unit in Dig_Group and do (Actions)
-
Loop - Actions
-
Game - Display to (All players) the text: (String((Number of units in Dig_Group)))
-
Set Temp_Loc_2 = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Temp_Loc_1 and Temp_Loc_2) Less than Temp_Real_1
-
-
Then - Actions
-
Set Temp_Unit_2 = (Picked unit)
-
Game - Display to (All players) the text: (String((Unit-type of Temp_Unit_2)))
-
Set Temp_Real_1 = (Distance between Temp_Loc_1 and Temp_Loc_2)
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_Temp_Loc_2)
-
-
-
Set Dig_Position = (Position of Temp_Unit_2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Temp_Loc_2 and Dig_Position) Greater than 10.00
-
-
Then - Actions
-
Unit - Create 1 Dig for Player 1 (Red) at Dig_Position facing Default building facing degrees
-
-
Else - Actions
-
Unit - Remove Temp_Unit_1 from the game
-
-
-
Custom script: call DestroyGroup(udg_Dig_Group)
-
Custom script: call RemoveLocation(udg_Temp_Loc_1)
-
Custom script: call RemoveLocation(udg_Dig_Position)
-
Custom script: call DestroyGroup(udg_Temp_Group_2)
-
-
-
-
This was easy, the hard part is, I need to make it so you can cancel any selection by re-clicking on the selected target, removing that "Dig" unit from the game.
So I need to find the closest "Dig" unit, and if he isn't like 10 in Warcraft distance, then it creates a new "Dig" unit on the slected target, and if he is within the 10 mark, then it removes him.
I hope that was understandable.