Buchi Posted June 1, 2023 Share Posted June 1, 2023 Is there a shortcut for that? Chatgpt said no. Can anyone help me create a mod for that? Chatgpt gave me this code: Can you give me some help how to test it or how to continue? function selectWoundedUnits() { var selectedUnits = Engine.GetGUIObjectByName("unitselection").selected; var woundedUnits = []; for (var i = 0; i < selectedUnits.length; i++) { var unit = selectedUnits[i]; var health = unit.GetHealth() / unit.GetMaxHealth(); if (health < 0.6) { woundedUnits.push(unit); } } Engine.GetGUIObjectByName("unitselection").selected = woundedUnits; } Engine.RegisterGuiCallback("onSelectionChanged", selectWoundedUnits); Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted June 1, 2023 Share Posted June 1, 2023 12 minutes ago, Buchi said: Is there a shortcut for that? Chatgpt said no. Can anyone help me create a mod for that? Chatgpt gave me this code: Can you give me some help how to test it or how to continue? function selectWoundedUnits() { var selectedUnits = Engine.GetGUIObjectByName("unitselection").selected; var woundedUnits = []; for (var i = 0; i < selectedUnits.length; i++) { var unit = selectedUnits[i]; var health = unit.GetHealth() / unit.GetMaxHealth(); if (health < 0.6) { woundedUnits.push(unit); } } Engine.GetGUIObjectByName("unitselection").selected = woundedUnits; } Engine.RegisterGuiCallback("onSelectionChanged", selectWoundedUnits); Yes is "o" 1 Link to comment Share on other sites More sharing options...
Gurken Khan Posted June 1, 2023 Share Posted June 1, 2023 51 minutes ago, Lion.Kanzen said: Yes is "o" With an area selection to actually get the wounded units. 1 hour ago, Buchi said: Chatgpt said no. You shouldn't trust it. 2 Link to comment Share on other sites More sharing options...
BreakfastBurrito_007 Posted June 2, 2023 Share Posted June 2, 2023 In settings you can also adjust the hp fraction that classifies the unit as wounded or not. Usually the units that I want to evacuate are expensive champions which usually take a lot of damage before dying, so I set it to 1/4 or 1/5 of total hp. 1 Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted June 2, 2023 Share Posted June 2, 2023 5 hours ago, Gurken Khan said: With an area selection to actually get the wounded units. Drag box selection* also drag selection https://ux.stackexchange.com/questions/114092/whats-the-name-of-the-pattern-where-you-draw-a-rectangle-to-select-items https://www.computerhope.com/jargon/d/dragsele.htm Link to comment Share on other sites More sharing options...
Adeimantos Posted June 4, 2023 Share Posted June 4, 2023 The one problem with the shortcut is it doesn't work when units are in formation; it treats the whole formation as one unit. Link to comment Share on other sites More sharing options...
real_tabasco_sauce Posted June 4, 2023 Share Posted June 4, 2023 1 hour ago, Adeimantos said: The one problem with the shortcut is it doesn't work when units are in formation; it treats the whole formation as one unit. This is a configurable option actually. you can turn off "battalion style formations" in the options. 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now