[Java] Clear factory build queue [solved]

[Java] Clear factory build queue [solved]

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
DeinFreund
Posts: 12
Joined: 14 Aug 2014, 00:12

[Java] Clear factory build queue [solved]

Post by DeinFreund »

Is there a simple way to clear the build queue of a factory?
I have tried unit.stop() with no success.

Code: Select all

List<Float> cmds;//contains CommandIDs(=negative unit def id) of units in queue
getUnit().executeCustomCommand(2, cmds, 64, frame + 50)
doesn't seem to work either.
2 indicates CMD_REMOVE, 64 stands for CONTROL_KEY.

Any suggestions?

Also storing command ids as float doesn't seem to make much sense to me. Is there any alternative way of issuing custom commands?
Last edited by DeinFreund on 17 Dec 2015, 00:15, edited 1 time in total.
8611z
Posts: 169
Joined: 08 Jul 2015, 20:20

Re: [Java] Clear factory build queue

Post by 8611z »

commands work same as for humans, so instead of ctrl-modifier try right mouse-button-modifier to reduce queue.
Then spam right-clicks on all buildoptions. (bit stupid, but iirc that worked)
DeinFreund
Posts: 12
Joined: 14 Aug 2014, 00:12

Re: [Java] Clear factory build queue

Post by DeinFreund »

Thanks for the quick response. Although replacing 64 with 16(RMB) doesn't alter the queue :/

Edit: After using 255 (all possible modifier keys mashed at once) it worked :D
aeonios
Posts: 202
Joined: 03 Feb 2015, 14:27

Re: [Java] Clear factory build queue [solved]

Post by aeonios »

for CMD_REMOVE you have to use options.alt in order for it to interpret params as command ids.
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: [Java] Clear factory build queue [solved]

Post by lamer »

From what i see alt and control should be sufficient, e.g. 192 (tested)

Code: Select all

getUnit().executeCustomCommand(2, cmds, 192, frame + 50)
Post Reply

Return to “AI”