HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Item Abilities order?

06-27-2006, 10:11 AM#1
Freakazoid
Ok. I created a dumy ability based of the "Item Illusions" and I want my dummy unit to cast it on a unit. I tried to convert it to jass and change the raw code but it doesn't work.
06-27-2006, 10:24 AM#2
Jacek
have you converted it to Unit ability?
06-27-2006, 10:34 AM#3
Thunder_Eye
the rawcode doesnt matter, you cast it by the orderstring
06-27-2006, 10:58 AM#4
Rising_Dusk
That's the point, abilities based on Item Illusions dont have order IDs.
So unless there is a workaround...

I'm guessing it'll include playing with Channel maybe.
Maybe simulating the whole mirror image effect via triggers... Decisions, decisions.
06-27-2006, 11:48 AM#5
shadow1500
Search Keywords: "order illusion" to find answer.
06-27-2006, 12:04 PM#6
Rising_Dusk
So there is a difference between the strings and the Ids. :/
Makes sense.
06-27-2006, 12:10 PM#7
BertTheJasser
Some Order IDs do not have corresponding order STRINGS, like most of the item abilities.
Collapse JASS:
function OrderCheck_Actions takes nothing returns nothing
local integer o=GetIssuedOrderId()
call DisplayTimedTextToPlayer(Player(0),0,0,60,"|cff009933"+I2S(o)+"=="+OrderId2String(o)+"|r")
endfunction

function InitTrig_OrderCheck takes nothing returns nothing
local trigger t=CreateTrigger()
local integer i=0
loop
   call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null)
   call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_ISSUED_ORDER,null)
   call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,null)
   set i=i+1
   exitwhen i>15
endloop
call TriggerAddAction(t,function OrderCheck_Actions )
set t=null
endfunction

This will display you the everytime an order is issued the order id and order string. If an ability has no orderstring, oh well it will return "...=="
06-27-2006, 12:14 PM#8
Rising_Dusk
I had already figured that out, but thanks I suppose.
This was the post I dug up. (By Anitarf)

Quote:
Most of the usual abilities have an orderstring, but some don't , but every ability has an orderId. OrderId s are integers, to get the orderid of an ability that doesn't have a string you would have to cast the ability manually in a map with this trigger:

Trigger:
Collapse Events
Unit - A unit is issued an order targeting a point
Unit - A unit is issued an order targeting an object
Unit - A unit is issued an order with no target
Conditions
Collapse Actions:
Custom Script: call BJDebugMsg(I2S(GetIssuedOrderId()))
It should show a silly number like 856703, take a paper and write it down, that is the order id for that ability and every ability based on it.

Now to use that ability you need to use the byId Natives, naturally they are different for point-target, unit-target and no-target spells:

Collapse JASS:
native IssueImmediateOrderById takes unit whichUnit, integer order returns boolean
native IssuePointOrderByIdLoc takes unit whichUnit, integer order, location whichLocation returns boolean
native IssueTargetOrderById takes unit whichUnit, integer order, widget targetWidget returns boolean

So, if I would want to order a unit with a trigger to cast a spell-shield-based spell onto a point (I'm giving this example because I can copy&paste it from a map of mine :) ), I would do this:

Custom script: call IssuePointOrderByIdLoc( GetLastCreatedUnit(), 852572, udg_TempCSPoint[GetForLoopIndexA()] )