beyond-all-reason / beyond-all-reason/RecoilEngine
Make godmode give Lua read access to selected units
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
1) `/cheat` and `/godmode`. Do **NOT** do `/globallos`.
2) blindly drag a box somewhere over the enemy half of the map to select the enemy starting unit.

3) Lua UI realizes that selection happened, but the unit is in the fog of war so interfaces like `Spring.GetUnitHealth` cannot return useful data.

Remarks:
* how does the example above know the unit type if `Spring.GetUnitDefID` doesn't work? Turns out `Spring.GetSelectedUnitsSorted` assumes selected units are visible anyway so doesn't do visibility checks.
* I am unsure whether only selected units should get read access, or just all selectable. Either probably works.
* I am unsure how interfaces like `Spring.GetAllUnits()` should behave, regardless of which option in the bulletpoint above is picked.
* do not assume that only godmode lets you select enemy units, i.e. do not skip the explicit check. See #567
Contributor guide
Research direction
Start at the /cheat and /godmode selection path, then trace the Lua interfaces Spring.GetUnitHealth, Spring.GetUnitDefID, Spring.GetSelectedUnitsSorted, and Spring.GetAllUnits. Check the explicit enemy-selection requirement in #567. Done requires a decided and verified policy for read access to selected or selectable enemy units, including how the listed interfaces behave.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, lua
- Domain
- game-dev, security
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100