Hi there. I have recently started to mess around with the PA mod system. Am i missing something or is there currently no interface for selecting units by their unit ids? model.selection().spec_ids returns an array of unit type [unit id] but the holodeck interface seems to only support adding/removing of matching unit types (ids passed to selectMatchingUnits(option, array of ids)) by generic type or by selection area, not specifically by id. I want to mod in the functionality to split the selection in half (i.e. select a bunch of units, press a key, half of the units remain selected). Would be awesome if something like a holodeck.selectMatchingId() would find its way into the ui interface... or is the functionality there and i have overlooked something?
how very odd to leave something like that out. Assuming that holodeck.js is the only interface allowing any modification of unit-selection it isn't there. There HAS to be something like engine.selectById or sth... :-/
Having selectById would make it possible to create an AI that controls your units. Uber has not yet decided whether they want to make that possible.
well, they could always limit the selectById calls to the active unit selection (i.e. allow only "remove" or "invert" calls and/or limiting them to a selection instance) - that would make this method feasable without implementing any backdoors to macroing. That feature alone would open the possibility to so many useful mods... (select only damaged units, select a certain ratio of unit types, etc.). Even if the full functionality were to be enabled, without position callbacks i can't think of any way of misuse for this functionality.
Yeah, that's how i am getting the unit ids. However once you have a selection you can currently only work with it on a "per flag" basis (i.e. build-capable or not, idle, unit type), not with individual units. I'd want that to change so you can apply f.e. numerical filters.