| 07-16-2008, 05:32 PM | #1 |
Is it possible to cancel unit training through scripts? I need to remove all units in the training queue. TY |
| 07-17-2008, 05:02 AM | #2 |
Not sure how sloppy this can get, but would selecting your unit and doing Force UI Key - Cancel work well (if you do it fast enough)? |
| 07-17-2008, 02:33 PM | #3 | |
Quote:
|
| 07-23-2008, 08:44 AM | #4 |
Then no, you can't do it. Forcing the UI key is the only way. |
| 07-23-2008, 03:14 PM | #5 | |
Quote:
call IssueImmediateOrderById(u, 851976) (don't know the gui-command right now) Do that 10 times or so and all unit-production should be cancelled :) Edit: attached my test map |
| 07-25-2008, 05:50 PM | #6 |
Just loop it 7 times, since it only has that many que slots... Ten times is just a waste, IMO. |
| 07-25-2008, 08:08 PM | #7 |
Why not just do: JASS:function CancelTrainOrder takes unit u returns nothing call IssueImmediateOrderById(u, 851976) call IssueImmediateOrderById(u, 851976) call IssueImmediateOrderById(u, 851976) call IssueImmediateOrderById(u, 851976) call IssueImmediateOrderById(u, 851976) call IssueImmediateOrderById(u, 851976) call IssueImmediateOrderById(u, 851976) endfunction No loop involved (so should be faster, even with extra function call) and makes the code cleaner. |
