• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Order Tracking - Submission

Status
Not open for further replies.
vJASS:
scope Order initializer Init

    private function Actions takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local integer o = GetIssuedOrderId()
    
        call BJDebugMsg(GetUnitName(u))
        call BJDebugMsg(I2S(o) + ": " + OrderId2String(o))
    endfunction

    private function Init takes nothing returns nothing
        local trigger trg = CreateTrigger()
    
        call TriggerRegisterAnyUnitEventBJ(trg, EVENT_PLAYER_UNIT_ISSUED_ORDER)
        call TriggerRegisterAnyUnitEventBJ(trg, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
        call TriggerRegisterAnyUnitEventBJ(trg, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
    
        call TriggerAddAction(trg, function Actions)
    endfunction

endscope

vJASS:
scope Order initializer Init

    private function Actions takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local integer o = GetIssuedOrderId()
        local string n = GetObjectName(o)
       
        call BJDebugMsg(GetUnitName(u))
        if(n=="Default string") then
            call BJDebugMsg(I2S(o) + ": " + OrderId2String(o))
        else
            call BJDebugMsg(I2S(o) + ": " + n)
        endif
       
        set u = null
    endfunction

    private function Init takes nothing returns nothing
        local trigger trg = CreateTrigger()
       
        call TriggerRegisterAnyUnitEventBJ(trg, EVENT_PLAYER_UNIT_ISSUED_ORDER)
        call TriggerRegisterAnyUnitEventBJ(trg, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
        call TriggerRegisterAnyUnitEventBJ(trg, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
       
        call TriggerAddAction(trg, function Actions)
       
        set trg = null
    endfunction

endscope
 

Attachments

  • JASS Class - Order.w3x
    24.8 KB · Views: 33
Last edited:
Good job!

full
 
Last edited:
Status
Not open for further replies.
Top