Idle builders auto repair#7338
Conversation
|
It should not uncloak commanders, and commanders that are wanting to cloak shouldn't start repairing once they become idle. |
|
Units on hold position can be in range to repair a unit, but not initiate the repair. |
|
Yeah, I'm not taking into account the width of the unit, the center of the unit needs to be in the build radius for it to work. It's a known issue. |
I think this is due to the polling rate. If you use a slower unit it doesn't move. |
For cloak, you can track which units are attempting to cloak when the command is issued. I've done it in UnitCommand, but maybe CommandNotify would work as well: function widget:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag)
if unitTeam ~= myTeamID then return end
if cmdID == CMD_CLOAK then
unitSeekingCloak[unitID] = cmdParams[1] == 1
endFor the width, perhaps you can add the damaged unit's radius to the check. |
Yeah, you are right about that I think. |
|
Very nice! Would you mind crediting uBdead for the original widget somewhere? |
|
Sure? I wrote this from scratch though, and didn't use his widget at all. |
|
Oh alright I assumed you based it on the original widget. |
|
Will they assist on construction as well? |
|
No, this is only for repair. Assisting construction isn't free |
|
Nits have been nitted! |
Work done
Idle mobile builders now auto-repair units within a range that depends on the movement state.
They go back to their starting point when done or when target leaves the leash radius.
They won't repair any units that have been reclaimed by the player within 1 minute.
The radius is pretty conservative, build radius + 100, or +200 at most when on roam.
AI / LLM usage statement:
I used claude to help me write this. I made sure it was up to quality standards and tested.
Note: This has been approved by GDT a while back, I'm just getting to this.