• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Is it possible to use item ability from triggers?

Status
Not open for further replies.
Level 18
Joined
Oct 20, 2007
Messages
353
I know it is possible to cast abilities with call IssueImmediateOrder(u, "roar").
That work with abilities which have order string.
But is it possible to use ability that doesn't have order string (for example item ability) from triggers?
One solution is to add item to unit and use that item.
This method is unpleasant because I need to create item for each ability.
 
Last edited by a moderator:
Level 21
Joined
Mar 27, 2012
Messages
3,232
I know it is possible to cast abilities with call IssueImmediateOrder(u, "roar").
That work with abilities which have order string.
But is it possible to use ability that doesn't have order string (for example item ability) from triggers?
One solution is to add item to unit and use that item.
This method is unpleasant because I need to create item for each ability.

Basically the difference with item abilities is only that they have no tooltip and description. In all other regards they should be normal.
However, if an ability is ON an item, then you need to tell the unit to use the item and not the ability.
 
Level 18
Joined
Oct 20, 2007
Messages
353
Basically the difference with item abilities is only that they have no tooltip and description. In all other regards they should be normal.
However, if an ability is ON an item, then you need to tell the unit to use the item and not the ability.

But how I could cast ability without order string?
For example "Item Area Healing" ('Alha')?
It doesn't have order string.

I have tried to edit Order string in object editor to something ("roar") and calling call IssueImmediateOrder(u, "roar"), but this didn't work.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
I think most if not all item abilities don't have a string to issue order with.
To get around this, issue a unit to cast the ability you want in game and display the ID of the order, then use IssueImmediate/Point/TargetOrderById.

Order ID for Item Area Healing is 852273.
 
Level 18
Joined
Oct 20, 2007
Messages
353
I think most if not all item abilities don't have a string to issue order with.
To get around this, issue a unit to cast the ability you want in game and display the ID of the order, then use IssueImmediate/Point/TargetOrderById.

Order ID for Item Area Healing is 852273.

Yes, I know that. I forgot to say that some item abilities don't show when added to unit and I can't cast them manually, only using item, but when using item raised only use item order.
What to do in such case?

EDIT:
I have crazy idea:
Add wanted ability to unit and issue all orders by id(800000 - 900000) and check for effect))
What do you think?

Just take the ability without ability name and add a string name. It will work.

I don't understand what you mean.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I'm not sure, but I think you can order the unit to cast the ability directly by the Ability ID

call IssueInmediateOrderById(unit, 'abhs') should work even if the ability is on the item, since all items abilities are somehow on the unit too.
 
Level 15
Joined
Feb 15, 2006
Messages
851
I don't understand what you mean.
You have an ability with no order string... then:

  1. Go to Object editor and select the ability with the issue
  2. Then go to the order string field and add an order for it (I'd suggest to add an order string similar to a normal ability in terms of target type and type)
  3. Now you can call it with code :D
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
  1. Go to Object editor and select the ability with the issue
  2. Then go to the order string field and add an order for it (I'd suggest to add an order string similar to a normal ability in terms of target type and type)
  3. Now you can call it with code :D

Nope, the order of an ability is hardcoded unless it's Spellbook/Channel/Charge Gold and Lumber, which possess a special field to change it.

Garfield is right.

Yes, I know that. I forgot to say that some item abilities don't show when added to unit and I can't cast them manually, only using item, but when using item raised only use item order.
What to do in such case?

Which are those abilities? Active ones should be shown.

I have crazy idea:
Add wanted ability to unit and issue all orders by id(800000 - 900000) and check for effect))
What do you think?

Yes but you would have to exclude the unwanted orders since most are not instantly parallel executable. Non-common abilities should be >852000. Still, I do not think you can trigger a hidden ability.

u're right

can't you add "Unit" abilities to items? These do have ordestrings and id's i think.

Items are casted via the inventory's order ids. OP does not want to use items.
 
Level 18
Joined
Oct 20, 2007
Messages
353
I'm not sure, but I think you can order the unit to cast the ability directly by the Ability ID

call IssueInmediateOrderById(unit, 'abhs') should work even if the ability is on the item, since all items abilities are somehow on the unit too.

I have tried this - it doesn't work.

You have an ability with no order string... then:

  1. Go to Object editor and select the ability with the issue
  2. Then go to the order string field and add an order for it (I'd suggest to add an order string similar to a normal ability in terms of target type and type)
  3. Now you can call it with code :D

This also doesn't work.

I guess you can use the abilities of the items by using the order id of the item slot of which it was located. Take a look at this:http://www.hiveworkshop.com/forums/...66594/?prev=search=Disable%20Item&d=list&r=20

AFAIK

I don't need to cast ability from item, I need to cast item ability added to unit.

Which are those abilities? Active ones should be shown.

There are a lot of such abilities, for example "Item Permanent Life Gain +50" ('Almh').
It is active i. e. can be used from item, but when added to unit it doesn't show.
 
Level 18
Joined
Oct 20, 2007
Messages
353
I have crazy idea:
Add wanted ability to unit and issue all orders by id(800000 - 900000) and check for effect))

Yahoo! That worked! I have found order ID for "Item Permanent Life Gain +50" ('Almh').
It is 852264!


That link contains only basic IDs, which can be found by using from unit.

I think I can search more hidden Order IDs and ask for that list update)
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
There are a lot of such abilities, for example "Item Permanent Life Gain +50" ('Almh').
It is active i. e. can be used from item, but when added to unit it doesn't show.

"A lot"

Hm, did not know you could make them actively castable because they are normally used as powerups. If you are thinking of applying this technique to modify a unit's stats, there are still cons to the common approaches, though this one probably is morph-safe. For example, your unit will halt to perform the order and trigger order events.
 
Level 18
Joined
Oct 20, 2007
Messages
353

These are almost all powerups.

If you are thinking of applying this technique to modify a unit's stats, there are still cons to the common approaches, though this one probably is morph-safe. For example, your unit will halt to perform the order and trigger order events.

Of course I'll test order cast for different morph units and other possible cases when stats may reset.
Other orders halting is not a problem because it is supposed to add bonus when unit is viewing fullscreen inventory i.e. does nothing.
 
Status
Not open for further replies.
Top