• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] Making spells a quick cast

Status
Not open for further replies.
Level 5
Joined
Jun 17, 2017
Messages
26
Is there a way to make a spell be used instantly, when its shortcut key is pressed?

For example, if i press B for Blink, I will instantly blink to a location my mouse is pointing to WITHOUT clicking any mouse buttons.

The best way as an example I can think of is the quick cast in League of Legends.

I tried to make a trigger, where if the player clicks B, the left mouse button would be pressed, but i found no way to either make a event for pressing B (only found events for pressing left, right, up, down) and I couldn't find an action that presses the left mouse key.
 
This is possible for some spells with dummy units.
For example, casting blizzard instantly:
1) Make a dummy spell for the unit/hero, something instant cast or just use "channel."
2) Make an invisible/locust/invulnerable dummy unit for casting Blizzard.
3) Make the trigger: if a unit casts the dummy spell, detect a nearby enemy unit, create dummy unit, set "blizzard" ability level on the dummy to the level of the dummy spell, order dummy unit to cast the spell on the nearby target.

Bam. 1 button auto-target blizzard.
 
This is possible for some spells with dummy units.
For example, casting blizzard instantly:
1) Make a dummy spell for the unit/hero, something instant cast or just use "channel."
2) Make an invisible/locust/invulnerable dummy unit for casting Blizzard.
3) Make the trigger: if a unit casts the dummy spell, detect a nearby enemy unit, create dummy unit, set "blizzard" ability level on the dummy to the level of the dummy spell, order dummy unit to cast the spell on the nearby target.

Bam. 1 button auto-target blizzard.

Not gonna lie. This seems pretty good. I'll try it out.
 
This is possible for some spells with dummy units.
For example, casting blizzard instantly:
1) Make a dummy spell for the unit/hero, something instant cast or just use "channel."
2) Make an invisible/locust/invulnerable dummy unit for casting Blizzard.
3) Make the trigger: if a unit casts the dummy spell, detect a nearby enemy unit, create dummy unit, set "blizzard" ability level on the dummy to the level of the dummy spell, order dummy unit to cast the spell on the nearby target.

Bam. 1 button auto-target blizzard.

So, I almost made it, but there is just two problems left.

1. When I use Channel, the unit takes about 0.3-0.5 of a second to start casting the ability I want. (I'm using "Stop casting an ability" because other ones don't do anything, at least at these settings)

2. The shade, that is supposed to be used as the target, will always spawn at the center of the map, so the ability will always fire in that direction.
 

Attachments

  • Slika3.PNG
    Slika3.PNG
    95.7 KB · Views: 93
  • Slika4.PNG
    Slika4.PNG
    13.6 KB · Views: 98
1. When I use Channel, the unit takes about 0.3-0.5 of a second to start casting the ability I want. (I'm using "Stop casting an ability" because other ones don't do anything, at least at these settings)
use this
  • Unit - A unit Starts the effect of an ability
Don't use wait. You didn't assign the correct location for nearby targets.
It should be something like this.
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to YourAbility
  • Actions
    • Set TempPoint = (Position of (Triggering unit))
    • Unit - Create 1 YourDummy for (Triggering player) at TempPoint facing Default building facing degrees
    • Unit - Add DummyAbility to (Last created unit)
    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Set TempGroup = (Units within 700.00 of TempPoint matching ((((Matching unit) belongs to an enemy of (Triggering player)) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))
    • Unit Group - Pick every unit in (Random 1 units from TempGroup) and do (Actions)
      • Loop - Actions
        • Set TempPoint2 = (Position of (Picked unit))
        • Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave TempPoint2
        • Custom script: call RemoveLocation(udg_TempPoint2)
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Custom script: call DestroyGroup(udg_TempGroup)
use [trigger][/trigger] tag to post your trigger.
 
Not gonna lie. This seems pretty good. I'll try it out.
Half of it is triggers, and the other half of this is setting up the object data. I can post this exact example with object data when I get off work.

You'll have to tweak the data fields for whatever dummy spell you use, especially if it's "channel".
 
Last edited:
This uses a bunch of variables, but is leakless.
Can be used in instant cast applications for point target or AoE spells:

  • Instant Cast No Channel Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dummy Spell
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • -------- Set the range to the casting range of your spell --------
      • Set TempGroup = (Units within 800.00 of TempPoint)
      • Set TempReal = 800.00
      • -------- Determines the closest target, else it casts on the caster's location --------
      • Set TempUnit = (Triggering unit)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint2 = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
              • (Distance between TempPoint and TempPoint2) Less than TempReal
            • Then - Actions
              • Set TempUnit = (Picked unit)
            • Else - Actions
          • Custom script: call RemoveLocation (udg_TempPoint2)
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Custom script: call RemoveLocation (udg_TempPoint)
      • -------- Locks onto closest target --------
      • Set TempPoint = (Position of TempUnit)
      • -------- Fires the auto-cast area spell. In this case: Blizzard. Set timer to duration of the effect +1 second for safety --------
      • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Unit - Set level of Blizzard for (Last created unit) to (Level of Dummy Spell for (Triggering unit))
      • Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Human Archmage - Blizzard TempPoint
      • Custom script: call RemoveLocation (udg_TempPoint)
 
Status
Not open for further replies.
Back
Top