We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
Had this idea one day: It's bugging me that in SC2 the units don't stick to the formation I gave them before ordering them to move.
So is there a way in UMS maps in SC2 to select a group of units and let them walk as one unit when the player orders them to move/attack somewhere?
For example I manually click the units so they form 3 lines: (F = Firebat, R = Reaper, M = Medic)
FFFFFFFF
RRRRRRRR
MMMMMM
They are set up perfectly to fight lings that are incoming from the north. Now I want to be able to select them all and move them east. When they reach their destination they should automatically return to their formation, except rotated by 90° to the right. Staying in formation all the way would be even better.
I know that GE is supposed to be able to do anything, but I honestly have my doubts with this one. I don't even know where to start. What I'm looking for isn't even a detailed solution. A guideline as to what is needed to in order to achieve that would be fine.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
Guys? Don't make me go to SC2M to get an answer...
I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.
I guess you need some sort of invisible squad leader (middle of your troops).
Every squad should be in 1 unit group.
tasks:
1. select the group's leader when a unit is selected.
2. -> direct orders go to the leader (only selectable)
3. give the squad's units orders to move to their position.
3 A: -get the direction where your squad leader is facing
3 B: -calculate the position where your units should be (different offsets depending on the direction of the squad leader)
Don't forget that you can store information within the unit (using his custom values). -> you could store the initial position of that unit inside the unit.
Maybe I find the time to try this.
Basically it could be done like this. Maybe there's a better way.
possible improvements & extensions:
-Speeding up units that aren't on their position (turning around).
-units would try to go onto a cliff with the offsets when the leader would be next to one.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
Hm, makes sense, but how would the user be able to define the formation if the units are not selectable? Is it possible to make units only selectable by single click and not by drawing a selection box?
Also how would the user be able to define which units follow the squad leader? Is it possible to create a region based on the selection box?
I can detect mouse button press and release events, and cursor position, right? Then it should be doable?
See
http://www.staredit.net/topic/11209/ for creating squads. Formations might be doable if you only have a few squads. Having many squads seems impossible to do well to me. Every single order given to a squad you will need to calculate the path for each individual unit in the squad and then there are dealing with things like cliffs blocking formations.
None.
Well apparently there is a way to do this easily. When issuing orders via triggers there is a Order targeting relative points option, this should work when issuing orders to a group of units so that they stay in formation. I have not tested it very thoroughly so I am not sure what happens when a wall is encountered and it may be tricky implementing a fix if they deform on hitting a wall.
None.
Couldn't you store each unit's position within the squad, make a calculation for degree of movement, and order the units to go back to that position?
None.
It is more detecting when the formation has been deformed, it would be difficult to tell for example if your formation no longer forms a box. Although really this is a minor annoyance and could be fixed by the user forcing their units back into formation if necessary.
Attacking an enemy unit would probably also deform the formation although forcing the units to stay in formation during an attack might be easy (keeping them from moving to attack seems the simplest way, if it is possible)
None.
Wouldn't there be a way to make custom abilities for each unit (or the group leader), that way you could select any unit in the unit group, and choose which formation you'd like hem to keep (with maybe 3 or 4 different "spells" aka formations) maybe even set a spell to save the current formation as a 5th option "custom formation".
None.
An alternative...
You create a Squad unit, which has 6 Marines 2 Firebats and 1 Medic in it...
xFFx
MMM
MEM
xMx
x = Blank Space, F = Firebat, M = Marine, E = Medic...
Enlarge the selection circle of the 'Squad' unit, and then attach the Marines, Firebats and Medics to it... They SHOULD stay in this formation when you give them orders. Then if a player selects any unit in the formation (which I think could be solved through data editor ) just make it select the 'Squad' unit.
I have not had a chance to test this, but it is possible I beleive.
None.