• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Order unit to cast an item spell?

Status
Not open for further replies.
Level 12
Joined
May 9, 2009
Messages
735
Okay, I know that using unit order string in the spells is supposed to work with triggers but for me it doesn't.

They work when a spell is based of a spell that has a unique order string. For example I needed to order a cast of summon a magma monster and when I changed the spell's order string to summon water elemental but when a I order a unit to use that spell string it doesn't work - it only works when it uses its own unique summon lava spawn string.

Now my question is what do I use when I use a spell from the item category that has no string such as item illusion? I tried giving it a thunderbolt, a firebolt, and a banish order string but when I order the units to use those spells it doesn't work.

Is there some kind of order string that does work? How do I order my units to cast those kind of spells (item illusion in particular?)
 
Level 12
Joined
May 9, 2009
Messages
735
Go to "Hero" and choose "Use Item On A Unit". It should work like that.

There is no 'hero' section in the order string in the spell section, there is no 'hero' section in the trigger 'issue order targeting a unit', there is no 'hero' section in any of the 'unit field' options for trigger actions... I really can't tell which hero field you are referring to >.<
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
If you use "Add <ability> to <unit>", then you can just use the regular order I suppose...
However, if the unit does not have direct access to the spell... (noticable by watching the HUD for its button) then it cannot cast it.
 
Level 12
Joined
May 9, 2009
Messages
735
If you use "Add <ability> to <unit>", then you can just use the regular order I suppose...
However, if the unit does not have direct access to the spell... (noticable by watching the HUD for its button) then it cannot cast it.

The unit has the ability in the GUI. However, the ability is an item ability, namely item illusions which is used by the wand of illusion, and does not have and order string for itself. I tried giving it the order strings of other abilities that are cast on units (thunderbolt, firebolt, banish) but that didn't work.
 
Level 12
Joined
May 9, 2009
Messages
735
Okay but the expired units drop the items on death and when i set charge to 1 there is still a chance for unit to be killed before dummy can cast the spell. I tried doing the trigger 'unit dies' 'remove last dropped item' but it doesn't work. Also tried setting the item to 'cannot be dropped' - doesn't work.
 
Level 18
Joined
Nov 21, 2012
Messages
835
They work when a spell is based of a spell that has a unique order string. For example I needed to order a cast of summon a magma monster and when I changed the spell's order string to summon water elemental but when a I order a unit to use that spell string it doesn't work - it only works when it uses its own unique summon lava spawn string.
You can change string orders only for spells based on channel.



Now my question is what do I use when I use a spell from the item category that has no string such as item illusion? I tried giving it a thunderbolt, a firebolt, and a banish order string but when I order the units to use those spells it doesn't work.

Is there some kind of order string that does work? How do I order my units to cast those kind of spells (item illusion in particular?)

If you want to order hero to use an item:
JASS:
call UnitUseItem( YourHero, YourItem )

  • Untitled Trigger 003
    • Events
      • Player - Player 1 (Red) types a chat message containing use1 as An exact match
    • Conditions
    • Actions
      • Hero - Order Paladin 0026 <gen> to use (Item carried by Paladin 0026 <gen> in slot 1)
If you want to use ability based on item check order id and use it. For illusion it is 852274.

JASS:
call IssueTargetOrderById(YourCaster, 852274, TargetUnit).

zibi
 
Status
Not open for further replies.
Top