• 🏆 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!

Trigger a unit to cast a spell not on the given list.

Status
Not open for further replies.
Level 3
Joined
Oct 11, 2005
Messages
19
Im attempting to create an ability to where when a certain hero kills unit, the hero will spawn an illusion of himself as a result. I created an ability off of the Wand of illusion's "Illusion Item" ability for my dummy unit to use so it can work on the hero when he kills a unit.

The problem is when i want the dummy to cast the illusion ability on my hero, I was curious if we are limited to the abilities the trigger editor offers when you want to issue an order targeting a unit or if there is some way to bypass this so I am able to make my dummy unit use the illusion ability on my hero. Basically, how do I get my dummy unit to target the killing hero with the illusion ability (If possible)?

Any help is appreciated and Thank you!
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
I heard this way from Poot
You make a trigger like
Unit gets order
Display OrderId to player with Text Message

After making that trigger
You just make your unit cast that ability and it gives you OrderId
as you know the OrderId and you can give orders by Id you have no problem left
(using orderstring doesnt work for item abilities like that)
 
Level 3
Joined
Oct 11, 2005
Messages
19
Sorry but I am not sure I understand what you are saying, could you explain a little more in depth. I found the "Unit is issued Order" command under events but can not find anything about displaying an OrderId (Sorry If im not understanding all the GUI/Trigger language). Are you saying create a custom script? or am I just blind?
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
oh sorry... hold on... :/ In GUI it seems its only possible with WEU or UMSWE (NewGen comes with UMSWE if you use NewGen you can enable UMSWE)
otherwise its for JASS only

Anyway I'll give it with Custom scripts
  • OrderId learn
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))
This will give you the OrderId whenever a unit gets order with targeting an object
Enable This trigger and Cast the Illusion on a unit to see its order id (its a number)

after getting the Id Note it somewhere
  • Set WAND_Caster = <Caster Unit> // Unit Variable
  • Set WAND_Target = <Target Unit> // Unit Variable
  • Set WAND_Order = <Id you have noted> // Integer variable
  • Custom script: call IssueTargetOrderById(udg_WAND_Caster,udg_WAND_Order,udg_WAND_Target)
Make these variables and the custom script and use this 4 lines to order a unit you want to cast illision on a unit you want
 
Level 3
Joined
Oct 11, 2005
Messages
19
Wow it works =D

After making a few alternations to my ability's comfort, it works! Thank you very much sir! Two more questions! 1) How do you post the trigger menus into your comments?
2) How do you give someone over 9000 rep points because your help was very appreciated and everything works great!
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
[trigger][/trigger] tags
Go to your trigger
Inside trigger on top (above the events), you see the map name
right click and say Copy as Text
then past it inside trigger tags
 
Status
Not open for further replies.
Top