• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Dummy Casting Problem

Status
Not open for further replies.
Level 7
Joined
May 30, 2018
Messages
290
I made this trigger for a unit to automatically cast "anti magic shell".

  • Anti magic shell
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Dummy Heal
          • (Unit-type of (Casting unit)) Equal to Faceless One Destroyer
    • Actions
      • Set VariableSet tempLocation = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempLocation facing (Position of (Triggering unit))
      • Unit - Add Anti-magic Shell to (Last created unit)
      • Unit - Order (Last created unit) to Undead Banshee - Anti-magic Shell (Target unit of ability being cast)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_tempLocation)

2 Problems: 1.When the unit is computer controlled it doesn't cast the ability at all...when owned by a player it works fine (is there a way to make it work for AI controlled units?)

2. If the trigger works, the units always stops after using the "dummy heal" and doesnt do anything ( I want it to keep attacking after casting. Any ideas?)

Thanks in advance!
 
Level 7
Joined
May 30, 2018
Messages
290
This might give some insight on AI casting abilities: How do I make the AI use abilities?.

Which spell is being used for Dummy Heal? Is it Channel? Change the follow through time to 0.

An aside: you don't the the 'And' part of your conditions. By default, conditions in GUI are all checked (i.e. already using 'and' operators).

Ah I didnt know that. Thanks!

For Dummy Heal I use the normal Human Heal as base spell.
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,687
If your Dummy is setup correctly you don't need to worry about it's facing angle, it'll cast the spells from any angle and without any delay.

Also, use the "A unit starts the effect of an ability" Event. A unit begins channeling an ability is used for spells like Blizzard and Death and Decay that require channeling.

It's important that your Dummy has it's Art - Animation - Cast Backswing/Cast Point set to 0, Movement Type set to None, and Speed Base set to 0. This makes the Dummy cast spells instantly while not needing to turn to face it's target.

This also allows you to use 1 Dummy unit to cast a spell on multiple targets. For example:
  • Actions
    • Unit - Create 1 Dummy for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    • Unit Group - Pick every unit in (Units within 512.00 of (Center of (Playable map area)).) and do (Actions)
      • Loop - Actions
        • Unit - Order Dummy to Human Mountain King - Storm Bolt (Picked unit)
I notice most people create a new Dummy unit for EACH picked unit which is not needed.

I attached a map with an example of a properly setup Dummy unit.
 

Attachments

  • Dummy Unit.w3m
    16.2 KB · Views: 27
Last edited:
Level 4
Joined
Sep 2, 2016
Messages
48
2) "A unit Begins channeling an ability" suggests that this ability has some duration. Longer than instant cast.
If the casting unit channels it, it "stops" and does it's abra kadabra. Does not attack. Right?
If you set the duration of channeling to 0, that would probably mean eternal casting.
Set it to 0.01 or something. Or better use action on the end of the script:
Give Unit (Triggering Unit) order to stop.

3?) When you:
Create unit ...
set:
facing to tempLocation instead of PositionOf(TriggeringUnit).
Don't you use the variable to prevent leaks? :D
 
Level 7
Joined
May 30, 2018
Messages
290
Hey guys :) So I came around to try your suggestions. Unfortunatelly I still have the problem, that the unit stops after casting the spell...
I tried changing the action to "A unit starts the effect of an ability", my Dummy Unit is set up properly, but it still doesnt seem to work.

The only issue really is, that the unit always stops any actions after casting.
 
Level 7
Joined
May 30, 2018
Messages
290
Not really sure what you mean but you could do something like:

A unit stops casting an ability

Ability being cast equal to your ability

Order triggering unit to Attack-Move to some Point / Attack some target

It's weird. The unit casts the dummy heal ability and then anti magic shell is applied...so far so good, but then the unit just stands still and gets attacked to death without attacking back...it basically casts and then stops any other action ...I also don't get it

upload_2020-4-17_19-41-12.png


EDIT: I just found the issue's cause...it's the cooldown of the dummy spell. The unit always waits till the ability is available again and in this time window it just stands still. After the cooldown expired it starts attacking again...which is kinda annoying. It seems like casting the dummy ability stops any other order/overwrites any other orders. Is there a way around this order-overwriting ?
 

Attachments

  • upload_2020-4-17_19-41-33.png
    upload_2020-4-17_19-41-33.png
    24 KB · Views: 19
Last edited:

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,687
Looks like it's hardcoded behavior for Heal.

If the Stops casting trigger I suggested doesn't work then I suppose you could disable the ability and enable it again 17.00 seconds later.
  • Heal
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Heal
    • Actions
      • Unit - For (Triggering unit), Ability Heal, Disable ability: True, Hide UI: False
      • Wait 17.00 seconds
      • Unit - For (Triggering unit), Ability Heal, Disable ability: False, Hide UI: False
 

Attachments

  • Heal Example.w3m
    16.5 KB · Views: 24
Level 7
Joined
May 30, 2018
Messages
290
Looks like it's hardcoded behavior for Heal.

If the Stops casting trigger I suggested doesn't work then I suppose you could disable the ability and enable it again 17.00 seconds later.
  • Heal
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Heal
    • Actions
      • Unit - For (Triggering unit), Ability Heal, Disable ability: True, Hide UI: False
      • Wait 17.00 seconds
      • Unit - For (Triggering unit), Ability Heal, Disable ability: False, Hide UI: False

Thanks for the fast reply! I will try it out.
Btw: Are there other recommandable base abilities, similar to heal, which I could use to ("auto")dummy cast? Maybe something more "trigger-friendly" than heal? Just curious.
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,687
Autocast abilities have hardcoded behavior that makes them hard to design around.

I suppose you could use Bloodlust or maybe Inner Fire and trigger the heal in response to casting them. However, the AI for these abilities is designed so a unit won't cast Bloodlust/IF on an already Bloodlusted/IF'd unit. So depending on what you want you could set the buff to 0.01 seconds so they repeatedly cast the spell on a target or give it a higher duration to make it so the unit won't be targeted again until the buff expires.
 
Last edited:
Status
Not open for further replies.
Top