Item use doesn't interrupt orders

Status
Not open for further replies.
Hello!
I have a problem: My hero has an item, and when the player clicks with
the right mouse button on an enemy, the hero should automatically use the
item. It's an item with the frost nova ability. Now it seems that the hero
doesn't stop moving, while he casts the spell. But I want, that when
you rightclick on an enemy unit, that the hero stops and casts the spell.
The actions like 'Order Hero to Stop' doesn't work. Only thing that worked
was to replace the unit, but I want to avoid this, because I have to save
all inventory items, level, experience, etc...
Is there any other way to stop the unit? D:

Hope someone can help me! :D
 
Level 9
Joined
Oct 11, 2009
Messages
477
Add the Frost Nova ability to your hero via Object Editor and if your unit starts attacking, order it to cast Frost Nova to the attacked unit.
 
Add the Frost Nova ability to your hero via Object Editor and if your unit starts attacking, order it to cast Frost Nova to the attacked unit.

that would be a solution, but I don't want it to be visible in for the hero.
The hero just should have the item, which can cast the frost nova spell.

But why doesn't 'Order Hero to Stop'/'Order Hero to Hold Position' work?
I also moved the unit instantly at it's position, but somehow it doesn't stop
it's orders D:
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
this will make ability´s icon invisible and cast able trough triggers

add ability to unit
-enable ability for player
-order unit to cast ability
-disable ability for player
-set custom value of unit to 1 (or do something else)

EVENT
unit is ordered targeting an object
unit is ordered targeting point
unit is ordered with no target
CONDITION
custom value of triggering unit equal to 1 (or something else)
ACTION
-remove ability from triggering unit


TRY THIS TOO: - works for "issued order" events
-pause unit
-unpause unit
-order unit to stop
 
Apparently, no item will reveal the spell animation of a unit. Try not adding the ability on the item, but manually playing the spell animation of your unit and creating a dummy to cast it.

hmm yes. thanks for this idea/help.

but that wouldn't solve my problem that there is no way to stop my unit
walking to the enemy.
 
Then use
  • Set Points[1] = (Position of (Triggering unit))
  • Set Points[2] = (Position of (Target unit of issued order))
  • If (All conditions are true) then do (Actions) else do (Actions)
    • If - Conditions
      • (Distance between Points[1] and Points[2]) Less than or Equal to (CastRange)
    • Then - Actions
      • //Order it to cast the spell
    • Else - Actions
  • Custom script: call RemoveLocation (udg_Points[1])
  • Custom script: call RemoveLocation (udg_Points[2])
CastRange is the the casting range of the Frost Nova spell.
 
Status
Not open for further replies.
Top