Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] 1.24d stopped SetUnitPosition from cancelling orders

Discussion in 'Triggers & Scripts' started by Element of Water, Jan 28, 2010.

  1. Element of Water

    Element of Water

    Joined:
    Aug 3, 2008
    Messages:
    2,298
    Resources:
    5
    Spells:
    3
    Tutorials:
    1
    JASS:
    1
    Resources:
    5
    BASTARDS

    Any other suggestions for an instant order cancellation to be triggered on order?
     
  2. overload119

    overload119

    Joined:
    May 28, 2007
    Messages:
    362
    Resources:
    3
    Skins:
    1
    Tools:
    1
    Maps:
    1
    Resources:
    3
    Are you sure about this? I'll test it later, but I'm pretty sure I'm using it in my map.

    In the meantime:

    call PauseUnit( u, true)
    call IssueImmediateOrder( u, "stop" )
    call PauseUnit( u, false)
     
  3. Element of Water

    Element of Water

    Joined:
    Aug 3, 2008
    Messages:
    2,298
    Resources:
    5
    Spells:
    3
    Tutorials:
    1
    JASS:
    1
    Resources:
    5
    Nah, tried that already, seems pause and stop doesn't work either. I managed to get something to work, however (requires TimerUtils)

    Code (vJASS):
    globals
        unit StopOrder_TempUnit
    endglobals

    function StopOrder_TimerCallback takes nothing returns nothing
        call ReleaseTimer(GetExpiredTimer())
        call IssueImmediateOrder(TempUnit, "stop")
    endfunction

    function StopOrder takes unit u returns nothing
        set TempUnit = u
        call TimerStart(NewTimer(), 0., false, function StopOrder_TimerCallback)
    endfunction

    EDIT: I just tried SetUnitPosition after the 0 second timer, and that also worked... curious...
    EDIT2: I wrote a script for it: PreventOrders. The script also supports permanently disabling orders, because it seemed useful.
     
    Last edited: Jan 28, 2010
  4. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Code (vJASS):

    call PauseUnit( u, true)
    call IssueImmediateOrder( u, "stop" )
    call PauseUnit( u, false)
     

    This will bring the selection-and-stuck bug into your map. Hooray!