HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Ordering a Unit to Cast an Ability Via Ordercode

01-20-2004, 03:30 AM#1
Xinlitik
I'm trying to get a unit to cast an ability that doesnt have a string to use as the order, so I need to use it's ordercode. UMSWE has this feature, but I dont know what JASS function will return the ordercode.

Quote from the UMSWE description of what needs to be typed in:

Quote:
Enter JASS code that returns an orderid value (integer). Example: 'my_ordercode()'


In case you need to know, the order code is 852273. (It's the choose hero or random hero [forgot which] for Lord Vexorian's hero select system.)

thanks
01-20-2004, 03:35 AM#2
Scarlet-Russian
why can't you just give it an orderstring?
01-20-2004, 03:37 AM#3
Xinlitik
Doesnt work. Or at least it hasnt worked before.
01-20-2004, 04:40 AM#4
Grater
From common.j:

native IssueImmediateOrderById takes unit whichUnit, integer order returns boolean
native IssuePointOrderById takes unit whichUnit, integer order, real x, real y returns boolean
native IssuePointOrderByIdLoc takes unit whichUnit, integer order, location whichLocation returns boolean
native IssueTargetOrderById takes unit whichUnit, integer order, widget targetWidget returns boolean

Like normal orders, there are 3 versions, the functions work exactly the same way as for order strings except for taking an integer instead of a string.
01-20-2004, 05:48 AM#5
Xinlitik
So I do

Code:
Unit- Order x unit to JASS Script IssueImmediateTargetOrderById(852273)

Do I need a native in front of it?
I dont quite understand what I do with my number heh.

Thanks again grater :foot:
01-20-2004, 06:24 AM#6
Grater
No, what I think you need to do (if I understand correctely) is use a custom script action:
Custom Script: call IssueImmediateOrderById(udg_x, 852273)

where "x" is a global unit variable