New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to drone controls #1775
Conversation
The carrier's target and any active or immediately queued fight/attack moves are cancelled. The button icon is a placeholder; improvements are invited. Commanders get the recall drones button if they have drones. The drones will hover around the carrier for ~10 seconds before returning to normal operation.
As far as I can tell you're setting the recall_frame_start rules param to -RECALL_TIMEOUT as a form of removal, including on newly created units. At the same time you're still checking it for nil. If you're guaranteeing the param to be non-nil, consider dropping the nil checks. |
Also rearranged code a little. Should be no player-side change.
The second option seemed more reasonable. |
@@ -90,6 +107,8 @@ local function Drones_InitializeDynamicCarrier(unitID) | |||
if drones then | |||
carrierData[#carrierData + 1] = data | |||
maxDronesOverride[#maxDronesOverride + 1] = drones | |||
Spring.InsertUnitCmdDesc(unitID, recallDronesCmdDesc) | |||
spSetUnitRulesParam(unitID,"recall_frame_start",nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is just initializing the unit (as the previous line suggests) then this line does nothing and should be removed. Setting the unit rules param to nil would only do something if it previously had a value.
function gadget:UnitCreated(unitID, unitDefID, unitTeam) | ||
if (carrierDefs[unitDefID]) then | ||
Spring.InsertUnitCmdDesc(unitID, recallDronesCmdDesc) | ||
spSetUnitRulesParam(unitID,"recall_frame_start",nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely this is not required.
… distance by 20% to compensate.
-- EDIT: Recall no longer cancels orders given to the carrier; it just tells the drones to ignore them for a while.
-- I am not a graphics designer; improvements to the recall icon are welcomed.
-- Commanders get the recall drones button if and only if they have drones.
-- When the carrier is given a recall order, the drones will hover around the carrier for ~10 seconds before returning to normal operation.
-- An attack, fight, patrol or set-target order given to the carrier cancels the remainder of the drone recall time.
It would be a good idea for somebody else to test this before merge/stable, not only for bugs but also to see if this control scheme is intuitive to other people.