• 🏆 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.
JASS:
library OrderTracking initializer Init
    private function Action takes nothing returns boolean
        local unit u = GetTriggerUnit()
        local integer i = GetIssuedOrderId()
        local string s = OrderId2StringBJ(i)
        if StringLength(s) == 0 then
            set s = GetObjectName(i)
        endif
        call ClearTextMessages()
        call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Unit ID: " + I2S(GetUnitTypeId(u)) + "
        Order ID: " + I2S(i) + "
        " + GetUnitName(u) + " ordered to " + s + ".")
        set u = null
        return false
    endfunction
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterPlayerUnitEvent(t, GetLocalPlayer(), EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, null)
        call TriggerRegisterPlayerUnitEvent(t, GetLocalPlayer(), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER, null)
        call TriggerRegisterPlayerUnitEvent(t, GetLocalPlayer(), EVENT_PLAYER_UNIT_ISSUED_ORDER, null)
        call TriggerAddCondition(t, function Action)
        set t = null
    endfunction
endlibrary


//Code indented using The_Witcher's Script Language Aligner
//Download the newest version and report bugs at www.hiveworkshop.com
 

Attachments

  • Order Tracking.w3x
    8.6 KB · Views: 47
Last edited:

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Have you tried building structures, training units, researching upgrades and buying items with your code?
I think it would not show the names of them correctly.
 
I like it.

full
 
Status
Not open for further replies.
Top