1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. The results are out! Check them out.
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Making any Spell Autocasting

Discussion in 'Trigger (GUI) Editor Tutorials' started by Ralle, Mar 15, 2006.

  1. Ralle

    Ralle

    Owner

    Joined:
    Oct 6, 2004
    Messages:
    11,219
    Resources:
    22
    Tools:
    3
    Maps:
    5
    Tutorials:
    14
    Resources:
    22
    Introduction
    Many spells in Warcraft can be cast automatically. This function is called autocast. It is not possible to just tick an option and the selected ability will be able to autocast. You will have to go deeper. You will have to use triggers and maybe an ability that also can autocast, to launch the selected.
    There are many ways of making spells autocast. But I will primary be focusing on a mixture of triggers and dummy abilities. This way, when wanting to make a spell autocast, you activate a dummy spell that each time it runs/attacks it orders the unit to cast the real spell. This way when turning on/off autocast, will be like normal, however you will have two ability-icons counting as one.

    Types
    All spells/abilities can be divided into 3 groups of how their target: Unit, Point, No-Target. Listed below are one of each type:
    • Unit - Order (Triggering unit) to Orc Raider - Ensnare (Target unit of ability being cast)
    • Unit - Order (Triggering unit) to Orc Witch Doctor - Sentry Ward (Center of (Playable map area))
    • Unit - Order (Triggering unit) to Orc Tauren Chieftain - War Stomp

    The first is targetting a unit. This is spells like Ensnare, Heal and Shadow Strike.
    The second is targetting ground. This is spells like Sentry Ward, Far Sight and Earth Quake.
    The third doesn't have a target. This is spells like War Stomp, Roar and Feral Spirit.

    So now we know that there are three kinds of spells. But now is the problem, what autocasting spells are there? Well.. The only spells I know that have autocast are target-unit spells. But it's still possible to make the others autocast aswell. Because you can make the spell target the point of the unit you want to hit.

    In all my examples I will be using the same method for doing the autocast. I will be using a dummy spell which will be based of Searing Arrow.

    Custom Spells
    To make a trigger launch with a custom spell you will have to look at the 'Order String - Use/Turn On' and make sure it is the only occurence on that unit, else more spells will be launched at the same time. When selecting the ability / action, instead of choosing preset you choose function, then Conversion - Convert String to Order and write the Order String in that field.
    • Unit - Order (Some Unit) to (Order(Some_Spell_Name)) (Target unit of ability being cast)


    Making the DummySpell
    For each autocasting spell, I will recommend you having a dummy spell. I based my dummy spells off Searing Arrow which is the 'Priestess of the Moon' ability. I have removed ALL models, damages, levels and anything that makes it be like a normal spell. Also removed mana cost and set cooldown to 5 just for standard.
    Normally I set the range of the dummy spell to the same value of the spell to be casted. But you have to do it another way with abilities like War Stomp which is a No-Target spell. You have to set the range of the dummy spell to maximum the area of effect of the spell to run.

    Example One - Targetting a Unit
    Always remember to set the cooldown of the dummy ability to the cooldown of the ability it should start or less than it. Also remember to set the range to the same.
    • Uses Dummy
      • Events
        • Unit - A unit Begins channeling an ability
      • Conditions
        • (Ability being cast) Equal to Dummy
      • Actions
        • Unit - Order (Triggering unit) to Orc Raider - Ensnare (Target unit of ability being cast)

    The trigger runs each time an ability has been started, then it checks that the ability is the Dummy Spell, if it is, it will order the unit to use Ensnare.

    Example Two - Targetting Ground
    This one is a bit more tricky since you can't just make the unit hit the unit which the Dummy Spell will hit, you will have to localize the targetted unit and hit it. Remember to set the cooldown of the dummy ability to the cooldown of the ability it should start or less than it.
    • Uses Dummy2
      • Events
        • Unit - A unit Begins channeling an ability
      • Conditions
        • (Ability being cast) Equal to Dummy2
      • Actions
        • Unit - Order (Triggering unit) to Human Blood Mage - Flame Strike (Position of (Target unit of ability being cast))

    The trigger runs each time an ability has been started, then it checks that the ability is the Dummy Spell, if it is, it will order the unit to use Flame Strike.

    Example Three - No Target
    This is the one that could cause most problems because the dummy is a ranged ability while this is not ranged, however it is not that hard.
    Always remember to set the range of the Dummy Spell to ½ of the range the standard ability has, else it can cause problems:
    Let's say the Dummy Spell has 2000 range and the unit has War Stomp, the range of it is 1000. So when the Dummy Spell hits some unit, it will do War Stomp, but the unit won't be harmed because it's too far away. Also remember to set the cooldown to atleast the same of the original ability.
    • Uses Dummy3
      • Events
        • Unit - A unit Begins channeling an ability
      • Conditions
        • (Ability being cast) Equal to Dummy3
      • Actions
        • Unit - Order (Triggering unit) to Orc Tauren Chieftain - War Stomp


    Bonus Example - Autocasting without double icons
    Ofcourse it would be cooler with just one icon for a spell but then it would be hard to make it so you can choose autocast or not. This following example will order a unit to keep on doing Flame Strike, Ensnare and War Stomp on the units it attacks or is being attacked by:
    • No Dummy
      • Events
        • Unit - A unit Is attacked
      • Conditions
      • Actions
        • Unit - Order (Attacking unit) to Human Blood Mage - Flame Strike (Position of (Target unit of ability being cast))
        • Unit - Order (Attacking unit) to Orc Raider - Ensnare (Target unit of ability being cast)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Attacking unit) is in (Units within 1000.00 of (Position of (Attacked unit)))) Equal to True
          • Then - Actions
            • Unit - Order (Attacking unit) to Orc Tauren Chieftain - War Stomp
          • Else - Actions

    This example shows ALL functions within one trigger. You can ofcourse cut it out in parts with an action in each.

    Well I hope you learned something about making your own autocasting spells now!

    Ralle
     
    Last edited: Oct 26, 2006
  2. Sunreaver

    Sunreaver

    Joined:
    Aug 22, 2013
    Messages:
    1,198
    Resources:
    13
    Packs:
    1
    Maps:
    12
    Resources:
    13
    Can u make a dummy map pleaseee Ralle Bossie
     
  3. Necziaxxus

    Necziaxxus

    Joined:
    Feb 24, 2015
    Messages:
    39
    Resources:
    0
    Resources:
    0
    This is a 9 year old post. How'd you even find this Sunreaver =]
     
  4. Sunreaver

    Sunreaver

    Joined:
    Aug 22, 2013
    Messages:
    1,198
    Resources:
    13
    Packs:
    1
    Maps:
    12
    Resources:
    13
    Looking for spell help
     
  5. The Kurd

    The Kurd

    Joined:
    Oct 29, 2013
    Messages:
    51
    Resources:
    0
    Resources:
    0
    what about autocasting custom spells?
     
  6. GhostHunter123

    GhostHunter123

    Joined:
    Oct 17, 2012
    Messages:
    442
    Resources:
    1
    Spells:
    1
    Resources:
    1
    @The Kurd The tutorial mentions that at the beginning.
     
    Last edited: Nov 18, 2017
  7. The Kurd

    The Kurd

    Joined:
    Oct 29, 2013
    Messages:
    51
    Resources:
    0
    Resources:
    0
    Im not sure what that part of the tutorial is saying. is there a way to rephrase it? It could just be I have been working to long and my brain isn't working anymore. The line of script he has as an example doesn't seem to have an option for the spell I made or a "put custom spell here" spot.
     
  8. GhostHunter123

    GhostHunter123

    Joined:
    Oct 17, 2012
    Messages:
    442
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I was wrong. This tutorial is entirely for custom spells or pretty much any spell that is not autocastable by default.

    You have to order the unit to cast the spell that your custom spell is based on.

    The (order(some spell name)) generalizes what the unit must do. It is not an actual action that you can select in the GUI database.
     
    Last edited: Nov 18, 2017
  9. The Kurd

    The Kurd

    Joined:
    Oct 29, 2013
    Messages:
    51
    Resources:
    0
    Resources:
    0
    I tried this out and it doesn't seem to be working. I'm using the exact first trigger with a modified version of slow (for auto cast) to auto cast a modified version of chain lightning but when it is cast all that happens is the base dummy ability is cast.
     
    Last edited: Nov 18, 2017
  10. The Kurd

    The Kurd

    Joined:
    Oct 29, 2013
    Messages:
    51
    Resources:
    0
    Resources:
    0
    Unit - A unit Begins channeling an ability
    (Ability being cast) Equal to Shoot (Flintlock) "slow"
    Unit - Order (Casting unit) to Orc Far Seer - Chain Lightning (Target unit of ability being cast)
     
  11. GhostHunter123

    GhostHunter123

    Joined:
    Oct 17, 2012
    Messages:
    442
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Order the unit to cast slow, not chain lightning, since your spell is based on slow.
     
  12. Jake Kessler

    Jake Kessler

    Joined:
    Apr 4, 2010
    Messages:
    267
    Resources:
    5
    Maps:
    4
    Tutorials:
    1
    Resources:
    5
    I seem to be having two problems.
    1. My unit doesn't cast the autocast ability (based on Searing Arrows) when it attacks even when autocast is on, unless it was ordered directly to attack the target (as opposed to just noticing and attacking the enemy itself).
    2. When the unit does use the autocast ability, the trigger I made based on this tutorial isn't ordering the unit to cast its other ability (based on Shadow Strike). Essentially the trigger doesn't work.
    Here is my trigger:

    Events
    Unit - A unit Begins channeling an ability​
    Conditions
    (Ability being cast) Equal to (My dummy ability based on Searing Arrows)​
    Actions
    Unit - Order (Triggering unit) to Night Elf Warden - Shadow Strike (Target unit of ability being cast)
    I tried changing the event to "Begins casting" or "Starts the effect of an ability". I also tried changing "Triggering unit" to "Casting unit" or even a variable that is already set to the unit I know I want, but none of that made any difference.

    FWIW, I also don't have the option to choose "Function" for the order the way this tutorial suggests. I am only able to choose "Preset".

    I know this is a necro post, but does anyone have any ideas? This system seems like it would be sweet if it actually worked.
     
  13. Jake Kessler

    Jake Kessler

    Joined:
    Apr 4, 2010
    Messages:
    267
    Resources:
    5
    Maps:
    4
    Tutorials:
    1
    Resources:
    5
    So - I'm still not sure how to make this system work the way OP intended. But I've figured out a workaround that is functional and does what I need in my map. It uses 3 triggers, as follows:

    • Trigger 1
    • Events
      • Unit - A unit is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(flamingarrows))
    • Actions
      • Trigger - Turn on Trigger 3

    • Trigger 2
    • Events
      • Unit - A unit is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(unflamingarrows))
    • Actions
      • Trigger - Turn off Trigger 3

    • Trigger 3
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to Unit_Garona
    • Actions
      • Unit - Order Unit_Garona to Night Elf Warden - Shadow Strike (Attacked unit)
     
    Last edited: Dec 22, 2017