beyond-all-reason / beyond-all-reason/RecoilEngine
[FR] Add a way to get units by command targetee
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
Bill of materials to be done before starting this ticket:
* awareness of #2125
----
Consider this setup. A unit is the target of a guard command and two attack commands, one of which is queued:

The request is to add something like:
`Spring.GetTargetingUnits(targeteeID, commandID, bool queued = false) -> { targeters }`
So in the example:
* `Spring.GetTargetingUnits(1, CMD.GUARD)` -> `{2}`
* `Spring.GetTargetingUnits(1, CMD.ATTACK)` -> `{4}`
* `Spring.GetTargetingUnits(1, CMD.ATTACK, true)` -> `{3, 4}`
* `Spring.GetTargetingUnits(1, CMD.ATTACK)` -> `{}` if called from LuaUI (can read allied units' queue only!)
* `Spring.GetTargetingUnits(1, CMD.REPAIR)` -> `{}`
For now, targeteeID can probably only be a unit. With #717 you could pass a featureID too, with CMD.RECLAIM and RESURRECT being some useful commands to pass in that case.
Contributor guide
Research direction
Start with prerequisite issue #2125 and the proposed Spring.GetTargetingUnits entry point, focusing on how unit command targets and queued commands are represented. Done means the API returns matching targeters for the requested command, optionally includes queued commands, and applies the stated LuaUI visibility behavior; no implementation files or tests are named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, lua
- Domain
- api, game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100