HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit - Order targeting an item

10-10-2003, 09:25 PM#1
Panto
Greetings.

Seems dastardly simple, but how do I order a unit to pick up an item?
10-10-2003, 09:30 PM#2
Zachary_Shadow
Good question...how?! No trigger is available to do such a thing...

JASS programming comes to mind...know u can do alot more than with original triggers..

Or...

A unit comes within 100 of Item

Create Item and give it to unit

Destroy Item(on ground)

?
10-10-2003, 09:43 PM#3
AIAndy
I guess "smart" works
10-10-2003, 09:50 PM#4
Panto
Yes, there's an option in "Unit - Order targeting a Unit" for "Right-click", which I assume translates to "smart".

However, using that trigger, I don't know how to refer to the item, since it doesn't strictly count as a unit.

Until this point, I am referring to the item as "Last created item" and the hero as "Picked Unit", for reference.

Is there a single line of code that I could insert to order it to target an item with "smart"? I'd rather not convert the whole trigger to Jass if I can help it.
10-11-2003, 12:07 AM#5
Reb
Quote:
Yes, there's an option in "Unit - Order targeting a Unit" for "Right-click", which I assume translates to "smart".


You have to use a little jass but not much =). Since you probably dont want to turn that whole trigger into jass create a new trigger and runt he trigger whenever you want the hero to grab the item. In that trigger use "Unit - Order targeting a Unit" for "Right-click" and have the target be some random unit on the map then convert to jass find the line and replace that random unit with GetLastCreatedItem().

In the end the line should look like this

Call IssuedTargetOrderBJ ( GetEnumUnit(), "smart" , GetLastCreatedItem() )

Reb
10-11-2003, 12:18 AM#6
Vexorian
that works, but better use the Custom Script Action
10-11-2003, 12:24 AM#7
lordwiggin
isnt their a trigger 4 it under hero-
10-11-2003, 12:25 AM#8
Vexorian
There is hero use item, but there isn't Hero - Order to pick item