• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Few units counting as one?

Status
Not open for further replies.
Level 27
Joined
Jul 6, 2008
Messages
11,325
I'm quite curious if it is possible (And how exactly if it is) to make shall we say a one unit consist from few of them. Like shall we say you train a custom Marine Squad unit and three marines pop out. If you pick one, they all get picked as a one unit. For those who played Warhammer 40k Dawn of War or Commpany of Heroes, yes I want to make similar infantry system to that one.
 
Level 11
Joined
Aug 1, 2009
Messages
963
It probably is possible.

I would think the best way to do it is to have a trigger that runs each time a unit is selected; if the unit is a squad member it would select the leader instead, or possibly an invisible dummy unit. Then, whenever the leader/dummy unit is issued an order, it would issue the same order to each unit in the squad. Additionally, if any squad member engages an enemy (like if something attacks it) all members would also engage it.
 
Level 5
Joined
Jun 3, 2010
Messages
100
It's really simple, set them all to the same exact Select Alias.

Example: If Marine is set to Marine, and your units are also set to Marine, double-clicking either one will select all Marines in the area with your units.

Just set all three units to one of the three Squad Members.

For training, if you havent figured that out, take a look at the Zergling, and follow the same idea as it has. Instead of it being two Zerglings in that list, you will have your three squad members.
 
Level 11
Joined
Aug 1, 2009
Messages
963
Go to the Actors tab and search for Selection - there are a few actors of that type. Try making your own and then having it be created (via events) when a unit has a "selection" behavior. This behavior would be applied to all units in the squad when it is selected.

Health bars, I dunno, I usually have health bars on all the time anyways so meh.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Ok I have a potential solution I desinged in my head.

SC2 allows a truely cool thing. Units can be unselectable but attackable. This is shown with the protoss carrier interceptors where they can be killed by enemy hydralisks but the owning protoss player is unable to select any of the interceptors being launched from his carriers.

The whole idea about a squad system is to make the group behave as 1 unit as far as orders go but keep the units separate in combat. This would allow you to block out 2 members of the trio from being selectable so you can represent all 3 with only one icon and 1 leading unit. This however does mean you can not click on just any unit from the group to select all members.

You then devise a system of forwarding orders from the lead unit to his 2 unselectable companions.

This should give you a rather basic squad system. Maybe not perfect but a start.

Other potential ideas could be to try and force selction of the rest of the group (add to selection) when one member is selected. You would have to make the leader unit the only unit with the icon and also make sure that each group has 1 leader unit so it has icons. Deselecting would be a problem with this.
 
Level 7
Joined
Apr 23, 2007
Messages
326
Ok well I tried this and actually got some results that worked where I made a unit called "Marine Squad" then I made another unit called "Marine Member" and used the Brood Lord Hanger ability to bind the Members to the squad. I made the members attackable yet unelectable so that they all act as individual units but can't be manipulated and whenever the main unit attacks the members do as well.

Now the funny part is I made a copy of the hanger ability and it glitched somehow so the squad actually spawns a marine every second and I'm not sure why. Anyway here's what I got so far, it's not super advanced but it should be workable for someone like DSG who understands the editor better. I'll keep working on this myself but if anyone wants to see something funny I recommend checking out the infinite marine spawn.
 

Attachments

  • test map.SC2Map
    182.2 KB · Views: 58
Ok well I tried this and actually got some results that worked where I made a unit called "Marine Squad" then I made another unit called "Marine Member" and used the Brood Lord Hanger ability to bind the Members to the squad. I made the members attackable yet unelectable so that they all act as individual units but can't be manipulated and whenever the main unit attacks the members do as well.

Now the funny part is I made a copy of the hanger ability and it glitched somehow so the squad actually spawns a marine every second and I'm not sure why. Anyway here's what I got so far, it's not super advanced but it should be workable for someone like DSG who understands the editor better. I'll keep working on this myself but if anyone wants to see something funny I recommend checking out the infinite marine spawn.
Well, not only DSG knows about the editor.
 
Level 7
Joined
Apr 23, 2007
Messages
326
Well, not only DSG knows about the editor.

Yes I'm aware other people know about the SC2 editor however DSG in particular was posting in this topic and I figured he might be trying to help tleno with this.

Hmmm, Hanger ability sure is awesome... I should try to experiment with it too... well, at least I'll try to...

Ya hanger ability is pretty sweet but the only problem with it that I see is that if the main unit dies the whole squad dies and that there is no way I know of to revive/replace dead units in the squad. Also I have no clue what is causing that infinite spawn glitch.
 
Status
Not open for further replies.
Top