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 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 Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted June 1, 2023 Report 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 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 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 Quote Link to comment Share on other sites More sharing options...
seeh Posted June 2, 2023 Report Share Posted June 2, 2023 (edited) 8 hours ago, Buchi said: Is there a shortcut for that? Chatgpt said no. yes. its there already for many years maybe you just net to config your autoCiv examples: hotkey.autociv.selection.nowoundedonly = "K" hotkey.autociv.session.entity.by.health.wounded.by.class.select.(Cavalry|Infantry|Soldier|Siege|Dog|Elephant|Support) = "J" this for e.g. is aready integreated here: https://github.com/sl5net/0ad-TTS-speaking-population/blob/main/0ad_tts_data/intuitive_config.json Edited June 2, 2023 by seeh 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. 1 Quote Link to comment Share on other sites More sharing options...
real_tabasco_sauce Posted June 4, 2023 Report 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 2 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.