Changes between Initial Version and Version 1 of Ticket #4015, comment 23


Ignore:
Timestamp:
Dec 22, 2016, 10:31:54 PM (7 years ago)
Author:
bb

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4015, comment 23

    initial v1  
    1111> I have no idea. The likely problem is that when packing is cancelled, the unit auto attacks the nearest enemy. I don't know why my last line does not replace that order. (Even if I recursively call `ReplaceOrder` there.)
    1212
    13 What happens here is that {{{this.PushOrder("CancelPack", { "force": true });}}} cancels the pack directly and then the unit switches over to idle state. From that it will simply attack something random (L1552). After this the code in replace order continues and we push an attack order to the queue (so after we started attacking). In order to solve this we need to avoid that "idle" state. To do so we would need to keep the orderQueue filled so we first add the new order in queue (simply by stating {{{this.orderQueue = [order]}}}) and after that PushOrderFront the cancel order. The PushOrderFront needs some new logic to behave in this use case aswell (this is or less the same logic as in ReplaceOrder, but not exactly the same as stated in last post). We would end up with code in ReplaceOrder like
     13What happens here is that {{{this.PushOrder("CancelPack", { "force": true });}}} cancels the pack directly and then the unit switches over to idle state. From that it will simply attack something random (L1552). After this the code in replace order continues and we push an attack order to the queue (so after we started attacking). In order to solve this we need to avoid that "idle" state. To do so we would need to keep the orderQueue filled so we first add the new order in queue (simply by stating {{{this.orderQueue = [order]}}}) and after that PushOrderFront the cancel order. The PushOrderFront needs some new logic to behave in this use case aswell (this is more or less the same logic as in ReplaceOrder, but not exactly the same as stated in last post). We would end up with code in ReplaceOrder like
    1414{{{
    1515        else if (this.IsPacking() && type != "CancelPack" && type != "CancelUnpack")