Warcraft III resources & community, 2003–2006 · archived

Request

5 posts
#1

Request

I hope that I can do requests in this section. In fact, I need a function which would return the destination of current order of triggering unit. There is in GUI a function, but it only works on event response. My trigger has begins casting an ability event and other events would ruin it. I cannot find a way in GUI, maybe someone will know how to do in JASS.

I short: Point var = target point of current order of Unit

(var is output variable of function, types begin with capital letters).

I hope I was clear
#2
the best part is, though GUI < JASS, JASS is NOT > Life.

JASS cant do everything :roll:

the only way to do this ( as far as i know ) is just as easy to do in GUI, you just store the current order x/y ( or point ) in a variable, and return that when you need it.
#3
The problem is that I CAN store the current order, but I cannot store the target of this order.
#4
why not?

GetOrderTargetX/Y, and/or GetOrderTargetLoc return it. theres even a Target Point of Issued Order/Targeted Unit for GUI
#5
You have to create a local trigger in the trigger that has 'Event - Spell Effect'. The local trigger's event should be EVENT_UNIT_ISSUED_POINT_ORDER. All you have to do is to store those points (better to store them as corditates).
A piece of the whole trigger:
function Trig_Unit_Ordered_Actions takes nothing returns nothing
    set udg_OrderX = GetOrderPointX()
    set udg_OrderY = GetOrderPointY()
endfunction

function Trig_Spell_Effect_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local trigger t = CreateTrigger()
    call TriggerRegisterUnitEvent(t, u, EVENT_UNIT_ISSUED_POINT_ORDER)
    call TriggerAddAction(t, function Trig_Unit_Ordered_Actions)
endfunction