• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Is there way to Select Low Heath Units? Advanced selection system?

Status
Not open for further replies.
Level 32
Joined
Aug 29, 2012
Messages
1,466
That depends on what you want to do exactly, but doing something like this seems to work:

  • Select
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set TempGroup = (Units in (Current camera bounds) matching (((Percentage life of (Matching unit)) Less than or equal to 25.00) and ((Owner of (Matching unit)) Equal to (Triggering player))))
      • Selection - Select TempGroup for (Triggering player)
The real problem is the event really, in this example hitting Escape selects all units within the camera bounds owned by the player with 25% HP or lower, but I don't really see another way to give the player a way to trigger that selection
 
Level 16
Joined
May 2, 2011
Messages
1,351
That depends on what you want to do exactly, but doing something like this seems to work:

  • Select
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set TempGroup = (Units in (Current camera bounds) matching (((Percentage life of (Matching unit)) Less than or equal to 25.00) and ((Owner of (Matching unit)) Equal to (Triggering player))))
      • Selection - Select TempGroup for (Triggering player)
The real problem is the event really, in this example hitting Escape selects all units within the camera bounds owned by the player with 25% HP or lower, but I don't really see another way to give the player a way to trigger that selection
ahhh this trigger is good, I'm sure I can easily expand it to make it cycle through units health

However, I thought surely someone must have created advanced selection system, and it would it include my need as one of its features. With all the tools we already have, from damage detection down to calculators I would be surprised that such system doesnt already exist.

For example such system could have following functions:
  1. Cycle through units according to health
  2. select caster units
  3. select heroes
  4. select combat non caster units
  5. select melee units
  6. select ranged units
  7. select worker units
  8. cycle through all units on screen 1 by 1
  9. add all units of select type to selection (so pressing this key while footman is select will add all footies to selection)
and probably more functionalities.

If no one has ever done this then I might have to do it myself.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
You're going to want to build your own custom UI elements and clickable buttons to make something like this work. You can detect many different keypresses as well, now, with the UI key events so perhaps you can just commit a key binding for some of those things that isn't used for anything else in the map.
 
Level 16
Joined
May 2, 2011
Messages
1,351
You're going to want to build your own custom UI elements and clickable buttons to make something like this work. You can detect many different keypresses as well, now, with the UI key events so perhaps you can just commit a key binding for some of those things that isn't used for anything else in the map.
I still use the Older WE so im not sure if I can detect keypresses or not.
Ideally it would be F1 to F12 becuz these arent used that much, apart from for heroes.

If Esc is the only detectable button in older versions, then @Chaosium solution might not work for me.
 
Level 14
Joined
Jan 10, 2023
Messages
267
This would only work for one group, but you could hijack the idle worker button and create a dummy worker for every unit under full health.

If a player selects an idle worker dummy (f8) select the lowest health unit, start a timer, if they hit it again in that time select the second lowest health unit and reset the timer. You would need a counter for each player that might use the system and you would have to give up the normal idle worker functionality.

Alternatively, you could make a dummy player with shared control heroes and make a hero dummy each for red/yellow/green health units and use the same click-timing system, might get a bit more complicated because I think you would then want a counter for each player for each health group to check how many times they have clicked that hero icon.

The beauty of using shared heroes is that you will have your player heroes' icons, then a little gap beneath them, then the dummy health hero icons.

Working this weekend but I'll try to get back on here to check this out. I've been looking for an excuse to hijack the idle workers button... lol
 
Level 16
Joined
May 2, 2011
Messages
1,351
This would only work for one group,
it can work for multiple groups by cycling through, too. E.g. cycling through Melee/Ranged/Flying/Casters, or cycling through units by health: Red/Orange/Yellow/Green and back to Red.

might get a bit more complicated because I think you would then want a counter for each player for each health group to check how many times they have clicked that hero icon.
well I intend it for campaign so single player should be ok, although a tool working on all maps would have been better (but seems no one thought of doing it yet).
If a player selects an idle worker dummy (f8) select the lowest health unit, start a timer, if they hit it again in that time select the second lowest health unit and reset the timer. You would need a counter for each player that might use the system and you would have to give up the normal idle worker functionality.
I initially intended this to select all units with Red/Orange/Yellow/Green health bar, not for 1 unit selection, so no need for multiple dummy workers. Just 1 worker is enough, and the event will be if worker is selected.

However, worker functionality is important in my campaign: it contains building and harvesting; so this solution wont help me.

Edit: ok but you gave me a good idea. in my campaign usually 1 hero is given, so I can create dummy heroes for each category wanted for cycling, the 8 categories or so mentioned above.

Now would that make the screen a little bit too crowded? not sure. I never noticed that even 3 heroes icons were too much, but I rather not have them appear as they are not really needed. Is there a way to hide their icons? anyway this is minor issue, and the other one is prolly that there is max number of hero hotkeys to be used: probably up to F5 or F6; this is enough for me but not good enough for a system working for all players and for all advanced selection purposes.
The beauty of using shared
I guess I dont mind player controlled heroes. There icons should be distinguishable too.
  1. +Icon for health (there is already red+ and Yellow+ but I dont know if there is Green+)
  2. Sword/Bow/Staff/AnotherIcon for melee/Ranged/Caster/Flying. Not sure which icon for flying but that is to be figured out Insha'Allah
Now is there way to cycle the Hero icon? perhaps I will need morf ability for that? (Illidans Ultimate).

Edit: this BTNHospital might be useful


The beauty of using shared heroes
I think F1-F4 for your own player and F5/F6 for allied players but im not too sure. Also If you more than 4 heroes, does the game let you occupy F5 and F6 which are meant for allies or not? Ill have to test that, brb
Edit: ok I can have F1-F5, the sixth Hero does not have hotkey apparently
1674831899076.png
thats wierd, I don't recall F6 and F7 being used for anything else, why don't they select the 6th and 7th hero!!
 
Last edited:
Level 14
Joined
Jan 10, 2023
Messages
267
Normally I would use quotes for the sake of clarity, but I'm at work so I only wanted to add that I am not sure what function keys work for shared heroes, but another option would be to make the dummies buildings w/o attack (to remove order icons) or hero abilities (unless you want the attribute point as a counter for something)

Give the dummies each an icon for flying, ground et c, then give them a dummy ability for health groups red green yellow.

I have a green one on my pc but it should be pretty easy to make anyway, just a hue change on the old.
 
Level 14
Joined
Jan 10, 2023
Messages
267
Giving the unit the "ward" classification totally disables the command card without having to do anything else.
I guess that is the better option.. I was thinking it might hide other abilities too but that doesn't make sense, wards have those... If I remember correct it hides the health bars too? I used a shared ward hero for a travelling shop in an attempt to fix warchasers once (started off trying to fix the half-of-the-heroes-with-no-inventory-issue and got carred away) but that's it.

Those missing inventories really let me down as a kid... and got me into world edit I guess lol
 
Status
Not open for further replies.
Top