Buchi Posted June 1, 2023 Report 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); Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted June 1, 2023 Report Share Posted June 1, 2023 On 01/06/2023 at 10:00 PM, 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); Expand Yes is "o" 1 Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted June 1, 2023 Report Share Posted June 1, 2023 On 01/06/2023 at 10:14 PM, Lion.Kanzen said: Yes is "o" Expand With an area selection to actually get the wounded units. On 01/06/2023 at 10:00 PM, Buchi said: Chatgpt said no. Expand You shouldn't trust it. 2 Quote Link to comment Share on other sites More sharing options...
BreakfastBurrito_007 Posted June 2, 2023 Report 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 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted June 2, 2023 Report Share Posted June 2, 2023 On 01/06/2023 at 11:07 PM, Gurken Khan said: With an area selection to actually get the wounded units. Expand 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 Quote Link to comment Share on other sites More sharing options...
Adeimantos Posted June 4, 2023 Report 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. Quote Link to comment Share on other sites More sharing options...
real_tabasco_sauce Posted June 4, 2023 Report Share Posted June 4, 2023 On 04/06/2023 at 7:54 PM, 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. Expand This is a configurable option actually. you can turn off "battalion style formations" in the options. 1 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.