Order Tracking - Submission

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,289
JASS:
//! zinc
    library OrderDetection {
 
        function onOrder() {
            integer order = GetIssuedOrderId();
            debug BJDebugMsg(GetUnitName(GetTriggerUnit()) + "'s current order id is: " + I2S(order) + " " + OrderId2String(order));
        }
 
        function onInit() {
            trigger t = CreateTrigger();
            TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER);
            TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER);
            TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_ORDER);
            TriggerAddAction(t, function onOrder);
            t = null;
        }
    }
//! endzinc
 

Attachments

Last edited:
Sorry for the thread derail, I just think it's pointless to do this stuffs (you already know) just for the award. Participating in contest is better if you ask me. The award there is a better ego booster. But for other people familiarizing with JASS, it's the complete opposite. These missions will help them a lot.

But how will the award work? What if a new mission is added?
 
Considering me low score at the last spell contest I hope to pick up a thing or two, and as I said I have not worked with wc3 for a while so it is good practice to refresh memory.
Though I do agree that it is pointless to some extent if you already know stuff.
But how will the award work? What if a new mission is added?
Thought of this myself, no clue.
Maybe it will be like complete 10 missions, does not matter which ones.

Participating in contest is better if you ask me
But then you actually have to be good :D
 
I placed a barracks and trained a few footmen, it worked.

0e8f9e8a2a4c2b37af565e8c1a939c26.png


Apparently it cannot convert to string but the id and name gets displayed

edit: oh wait you want me to build it literary

edit2: this is what happens
e8e920523f350c51a5efeb5b72b7fcff.png


Repair is when the pesant is actually building and the other one is while walking there


JASS:
//! zinc
    library OrderDetection {

        function onOrder() {
            integer order = GetIssuedOrderId();
            string x = GetObjectName(order);
           
            if(x=="Default string") {
                x = GetUnitName(GetTriggerUnit()) + "'s current order id is: " + I2S(order) + " " + OrderId2String(order);
            } else {
                x = GetUnitName(GetTriggerUnit()) + "'s current order id is: " + I2S(order) + " " + x;
            }
           
            BJDebugMsg(x);
        }

        function onInit() {
            trigger t = CreateTrigger();
            TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER);
            TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER);
            TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_ORDER);
            TriggerAddAction(t, function onOrder);
            t = null;
        }
    }
//! endzinc
 

Attachments

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