Skip to content

CancelProduction

Request cancellation of one queued unit or research item.

CancelProduction(building, batchId) · CancelProductionTracked(building, batchId)

Inputs: building is an owned, live producer Object. batchId is the exact string returned by building:GetProductionQueue().

Output: CancelProduction returns true for queue admission, otherwise false. CancelProductionTracked returns accepted, receipt. Neither confirms that the requested item was cancelled.

Errors: Wrong Lua argument types raise an argument error. A missing or changed batch, unavailable production queue, or native queue position above 255 rejects the request. The tracked receipt gives the reason when available.

The building must be owned and live. The batch is resolved again at execution; a missing batch, changed type, unavailable queue, or native expanded position above 255 rejects. Earlier entries finishing may shift the selected position. This command does not cancel an entire multi-unit batch. No modifier is applied.

The native packet carries a position, not a batch ID. The queue may change after submission during network delay, potentially changing which entry the game cancels. A submitted receipt therefore does not confirm cancellation of the requested batch. Avoid concurrent cancellation requests for the same building. CancelCommandReceipt only cancels local pending submission, not game production.