• 🏆 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!

Make unit selection limit? {Theories about selection and synchronization}

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
I´ve been searching for a tutorial on this, but I can not find one.

Some maps in SC2 have a unit selection limit. Just like WC3 has a selection limit of 12 units at once.

How can this be done?

(Is there a field somewhere to change this in the data editor, is it made via triggers or in some other way?)

Ps. No I am not gonna add a 12 units selection limit. It was just an example to show what I mean. That Wc3 had a selection limit of 12.
 
Last edited:
Level 11
Joined
Jul 20, 2004
Messages
2,760
While it is possible to detect when new units are selected via the "Unit Is Selected" Event, determining the current number of selected units via "Selected Units" by (Triggering Player) Group, and altering its contents dynamically, there is the problem of synchronization. You will most likely notice a small delay between the selection of many units, and the system reducing the selection to 12 units. While I'm not sure how this type of behavior could be abused, it should be noticed that it is not flawless or completely unnoticeable (especially when playing online).

I was thinking of tricking the system by running the trigger only for the (Current Player) (If I remember correctly, such a trick worked for Warcraft III), but unfortunately such a native function does not exist, and even if it did, it still wouldn't guarantee an asynchronous or bug-free behavior.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
There already is a unit selection limit by default. Just it is much larger than WarCraft III (8*3*5 I think which is 120 instead of just 12). Frankly the unit selection limit in WarCraft III was plain stupid and was known as a major fault with WarCraft III.

If someone wants to try microing 120 units from 1 control group, who are you to stop him?
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Couldn't find it in the catalogs either. I tried both gameplay and game UI, but from what I can tell, it's one of those hardcoded aspects of the game. Maybe they'll change this in HOTS, though I seriously doubt it; there's no point in restricting the number of selecting units (reminds me of the Dune 2000 mechanics really, but units there were much stupider than in SC2).
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
I'm sure that I watched an online stream in which some LiquidTeam guys had created an almost exact replica of StarCraft 1, including the inability to select more than just a few units, but I could be wrong. I do know they managed to copy the inability to separate worker and army rally points and prevent workers from automatically being ordered to harvest after spawning.
Have you tried forcing the player to de-select the unit if it already has something selected? Event player selects a unit, condition is unit group "selection" (not) empty, action de-select.

In WarCraft III, I think you could have more than 12 units selected, but not through "legal" means.
I'm not entirely sure if it's that, but In RP (not RPG) maps, there was an interesting phenomenon known as the "selection bug" that resulted from Blizzard's BJ unit group enumerations (search area trigger equivalent in SC2) causing bad selection synchronizations.
If you had, say, 3 units selected and had them move somewhere, it was possible that one or more other units would also be ordered to move there, as if they were selected, but not actually displaying as belonging to the selection in the UI. Interestingly, this particular bad selection would be fixed (but others would eventually happen) by clicking a destructible. I don't remember anymore, I was recalling a case in which more units moving alongside 12 selected ones did happen, but I'm not sure.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
The maximum is 8*3*6 which is 144. Nowhere near the 255 the guy above claims. This was done by creating 500 void rays and selecting as many as possible.

Ofcourse if he has found a way to get 255, he can explain to prove me wrong.

im sorry lolwut. i just spawned ~600 marines and double clicked one than ctrl+1

the max isnt 8*3*6 its 2^8-1
 

Attachments

  • no.png
    no.png
    3.2 MB · Views: 1,199
Level 11
Joined
Jul 20, 2004
Messages
2,760
This is bad and you should feel bad.
Be nice! Making people feel bad around here is neither helpful, nor productive. :smile:

Rui, it's not impossible to do it, but from what we could figure out, you need to play with triggers, and due to the problem regarding synchronizations, the "reduced number of selected units" effect is slightly delayed.

If I remember correctly, it's very easy to obtain synchronization problems in Warcraft III. Just try and execute unsafe code via the GetCurrentPlayer() native (or similar, I can't remember the exact name of the functions) - removing units from the map for only a specific player, for example.

Be it as it may, executing isolated code is a tricky business - what happens if when a player presses a button on its UI, the resulting action needs to propagate to all players?

I would be interested to know of course if these LiquidTeam people did things some different, 'safer' way...
 
Status
Not open for further replies.
Top