Staredit Network > Forums > SC2 Custom Maps > Topic: Units walking in formation
Units walking in formation
Aug 6 2010, 11:16 am
By: NudeRaider  

Aug 6 2010, 11:16 am NudeRaider Post #1

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.




Aug 9 2010, 10:19 am NudeRaider Post #2

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...




Aug 9 2010, 12:24 pm Ahli Post #3

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.




Aug 9 2010, 12:31 pm NudeRaider Post #4

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?




Aug 9 2010, 4:53 pm Temp Post #5



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.

Aug 12 2010, 8:11 am Temp Post #6



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.

Aug 12 2010, 8:08 pm BiOAtK Post #7



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.

Aug 12 2010, 8:25 pm Temp Post #8



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.

Aug 30 2010, 12:57 pm playpong Post #9



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.

Oct 1 2010, 5:04 pm NicholasBeige Post #10



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.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[07:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[06:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[03:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: jun3hong