- Joined
- May 20, 2009
- Messages
- 822
Okay, so I'll tell you what I need to do. But I don't have any idea how to do it.
When you have more than 1 unit selected, all the units need to move a relative distance between each other. I figured I could solve this by doing what (I think) SC1 does. What it does, is:
It takes all the units selected. And determines the most-center point between all the units.
Then, when the units are ordered to move as a group (Max: 12 units, because of the selection limit) it takes the distance each unit is at from the center, and then orders each unit individually to move to an offset point based on that distance the unit is from the center.
I have no idea where to even start with this, really. But I have a trigger slightly built. It's far from finished and is non-functional:
The three points are units. The two other points are the centers of the X and Y. I need that to stay like that when those three units are ordered to move.
EDIT: Here's a video. Watch closely how the units stay in whatever formation you put them in.
http://www.mediafire.com/watch/7tdc6yset2tuwng/bandicam_2014-10-27_21-12-44-430.avi
This is what I want to achieve. And I know how to achieve it. I just don't know how to trigger it in WC3.
When you have more than 1 unit selected, all the units need to move a relative distance between each other. I figured I could solve this by doing what (I think) SC1 does. What it does, is:
It takes all the units selected. And determines the most-center point between all the units.
Then, when the units are ordered to move as a group (Max: 12 units, because of the selection limit) it takes the distance each unit is at from the center, and then orders each unit individually to move to an offset point based on that distance the unit is from the center.
I have no idea where to even start with this, really. But I have a trigger slightly built. It's far from finished and is non-functional:
-
Modded Group Movement
-
Events
-
Unit - A unit Is issued an order targeting a point
-
-
Conditions
-
Actions
-
For each (Integer PlayerInt) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Triggering unit) is in PlayerSelectionGroup[PlayerInt]) Equal to True
-
-
Then - Actions
-
Unit Group - Pick every unit in PlayerSelectionGroup[PlayerInt] and do (Actions)
-
Loop - Actions
-
Set PointXofUnit = (X of (Position of (Picked unit)))
-
Set PointYofUnit = (Y of (Position of (Picked unit)))
-
Set PointXResult = (PointXResult + PointXofUnit)
-
Set PointYResult = (PointYResult + PointYofUnit)
-
Set PlayerSelectionGroupCenter[PlayerInt] = (Point(((X of (Position of PointArrayUnit[PlayerInt])) + (1.00 + 1.00)), (Y of (Position of PointArrayUnit[PlayerInt]))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Then - Actions
-
Else - Actions
-
-
-
-
-
Else - Actions
-
-
-
-
-
The three points are units. The two other points are the centers of the X and Y. I need that to stay like that when those three units are ordered to move.
EDIT: Here's a video. Watch closely how the units stay in whatever formation you put them in.
http://www.mediafire.com/watch/7tdc6yset2tuwng/bandicam_2014-10-27_21-12-44-430.avi
This is what I want to achieve. And I know how to achieve it. I just don't know how to trigger it in WC3.
Attachments
Last edited: