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. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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.

Single Target Spell for Multiple Units

Discussion in 'Trigger (GUI) Editor Tutorials' started by Rheiko, Oct 2, 2013.

  1. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    I just want to share my experience and knowledge with the others and i don't think everyone knows about this, right? Especially those who've just joined modding.
    Be aware that I don't recommend this tutorial to you if you are still new to triggering.

    Table of Contents




    Things You May Need


    • You must understand English
    • You have Warcraft III and World Editor
    • Knowledge about Triggers/Trigger Editor
    • Knowledge about Object Editor

    Introduction


    Have you ever been wondering how to use single target ability against multiple units?
    For example: Sleep, you can only use Sleep against single unit/target but you want to use it against multiple units, like units within range or something.
    Therefore we will use trigger to do this.
    Maybe you think triggering is hard to understand, but i will explain it to you as simple as i can.

    Lets get this started


    Without further ado, let's get down to the business. We will start with Object Editor then we will use trigger. We will make a Sleep ability with instant cast which will put units within range to sleep.

    Object Editor


    Because You already know about world editor I think you're also already familiar with Object Editor, to be honest Object Editor was the next place i visited after world editor.

    • Create a New Ability based on Roar (You may use any other instant cast abilities such as; Thunder Clap, War Stomp, Battle Roar/Roar, etc)
      • Art - Caster, change it to your desired special effect, this special effect will appeared when you cast the spell.
      • Data - Damage Increase (%), change it to 0.00, because we don't want the damage increase effect from this ability.
      • Stats - Buff, delete the available value. Buff is status effect which will appeared at Unit's status bar. Note that even if we delete the buff the buff will still appear at unit's status.
      • Stats - Duration - Hero
        Stats - Duration - Unit
        , change both of them to 0.00.
      • Stats - Target Allowed, change it to none

      This will be our unit's ability. This is the ability which will we click in the game, You may change its description to whatever you like.

    • Create a New Ability based on Sleep (Because we will need Sleep buff to put units to sleep, same to stun. You could use Storm Bolt/Fire Bolt to stun your target)
      • Data - Stun Duration, i'm not sure what is this for. But i will change it to 0.00
      • Stats - Cast Range, change it to 99999 to make sure our Dummy Unit could reach the target, but this still has a problem because of visibility
      • Stats - Duration - Hero
        Stats - Duration - Unit
        , change these to your desired duration. I will change it to 2 second.
      • Stats - Mana Cost, change it to 0, so our Dummy Unit can use the ability without mana.

      This will be our dummy's ability. It's an ability where you can't see it in the game. In order to do this we will need a help from a unit to cast the ability to the enemies. This unit is what the so called Dummy.)

    • Create a New Unit, i will base it on Footman. You may use any other unit, though.
      • Abilities - Normal, Add the sleep ability and Locust ability to the list. Locust ability allows our Dummy's Hit Points and Mana bar to be hidden
      • Art - Animation - Cast Backswing, change this to 0.000 otherwise this method won't work properly
      • Art - Animation - Cast Point, change this to 0.000 otherwise this method won't work properly
      • Art - Model File, use custom path and write "Dummy" on it. Because there is no Model File with "Dummy" as a name, if you put this inside the world editor it will appear as Green Box. But in the game it will appear without any model file.
      • Art - Shadow Image (Unit), change it to none. So Dummy will have no shadow beneath it.
      • Damage, we will make the Dummy has no damage. So it won't attack enemy unit.
        • Combat - Attack 1 - Damage Base, change it to 0
        • Combat - Attack 1 - Damage Number of Dice, change it to 0
        • Combat - Attack 1 - Damage Sides per Die, change it to 0
      • Movement - Type, change it to Fly. So Dummy won't collide with other units in battlefield.
      • Movement - Speed, change it to 0

    understand now? it's pretty easy actually.
    now, we'll begin with the triggering part, is it hard? no, of course not.

    Trigger


    Trigger
    • Trigger
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Sleep
      • Actions-
        • -------- This is a guy who use the ability --------
        • Set Caster = (Triggering unit)
        • -------- The Owner of Caster --------
        • Set Owner = (Triggering Player)
        • -------- Store Caster's position into a variable --------
        • Set TempPoint = (Position of Caster)
        • -------- We create our dummy --------
        • Unit - Create 1 Dummy for Owner at TempPoint facing Default building facing degrees
        • -------- Store him into a variable --------
        • Set DummyUnit = (Last created unit)
        • -------- We gives him the dummy's sleep ability --------
        • Unit - Add Sleep (Dummy) to DummyUnit
        • -------- We gives him an expiration timer, he won't stay forever --------
        • Unit - Add a 1.00 second Generic expiration timer to DummyUnit
        • -------- Pick units within 500 range of position of the caster --------
        • Set Group = (Units within 500.00 of TempPoint)
        • Unit Group - Pick every unit in Group and do (Actions)
          • Loop - Actions
            • -------- Store the picked unit into a variable first, because we'll use them more than once --------
            • Set TempUnit = (Picked unit)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (TempUnit belongs to an enemy of Owner) Equal to True
                • ((TempUnit is alive) Equal to True)
              • Then - Actions
                • -------- Order him to use it against all units within 500 range of Position of the caster --------
                • Unit - Order DummyUnit to Undead Dreadlord - Sleep TempUnit
                • Else - Actions
        • -------- We remove the leaks --------
        • Custom script: call RemoveLocation(udg_TempPoint)
        • Custom script: call DestroyGroup(udg_Group)


    Useful Links



    So how was it?
    Easy and simple right?
    I hope this can be useful for anyone who read this
    and you can use the test map if you want to make sure of it or learn it directly from the test map. You can download it - here

    Credits


    I'd like to thank these guys, for help me improving this tutorial.

    And Thank you for reading all of this ^^
    My thanks doesn't apply to those who just skip the tutorial and read this part
     

    Attached Files:

    Last edited: Jul 23, 2016
  2. GreeN!X

    GreeN!X

    Joined:
    Oct 20, 2012
    Messages:
    2,351
    Resources:
    2
    Maps:
    1
    Template:
    1
    Resources:
    2
    The images aren't showing onii-san. They need some fixin'

    Anyway, this is a pretty nice and simple tutorial you have. You could add some more details to what you're doing and why though.
    Oh and Maybe add some other examples too? Like AoE Sleep, AoE Roots. They use the same process but it would still be pretty nice to add here (imo).

    Still a T-up from me. This could be useful to beginners in triggering/ the WE. :)
     
  3. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    really? the image are showing for me :\

    yeah, i will
    of course, and i will include the test map
    i just need a time to do that

    and yeah, i thought this will be useful for beginners at triggering
    because i was also like that :p
    btw, thanks hera-chan
     
  4. GreeN!X

    GreeN!X

    Joined:
    Oct 20, 2012
    Messages:
    2,351
    Resources:
    2
    Maps:
    1
    Template:
    1
    Resources:
    2
    When I try to open the images in a new tab, it's showed as an invalid attachment for me. :/
     
  5. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    how about now?
     
  6. GreeN!X

    GreeN!X

    Joined:
    Oct 20, 2012
    Messages:
    2,351
    Resources:
    2
    Maps:
    1
    Template:
    1
    Resources:
    2
    Mucho mejor de. :)

    EDIT:
    Much better. :)
     
    Last edited: Oct 2, 2013
  7. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    what does that supposed to mean?
    lol, thanks
     
    Last edited: Oct 3, 2013
  8. nhocklanhox6

    nhocklanhox6

    Joined:
    Feb 12, 2012
    Messages:
    343
    Resources:
    28
    Models:
    6
    Spells:
    21
    Tutorials:
    1
    Resources:
    28
    +Rep, nice tutorials :). Good Job !
     
  9. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    thanks onee-san :D
     
  10. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    change color. That green is horrible i can't even read the tutorial lol.

    In your triggers however you should show them how to do it with only 1 dummy unit even if the spell is cast 1k times.

    For this
    • Set Group = (Units within 200.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True)))

    You should get rid of the conditions and just put an ITE in your group loop.
    Also you should show them how to remove dead units.
    And anything used twice or more should be stored into a variable. Example: Owner of Caster.
     
  11. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,181
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    You should create only one dummy and make it cast the ability on every target. Remember to remove the dummy unit afterwards.
     
  12. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    Sure, will do
    it seems i forgot to remove the dummy >.>
    How to create only one dummy? I usually use this so i don't know how
     
  13. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,528
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    Create dummy before group loop.
    Move dummy unit and order it to do whatever in the group loop.
    Then destroy unit after.
     
  14. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    Okay, thanks
     
  15. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,745
    Resources:
    28
    Packs:
    1
    Maps:
    8
    Spells:
    17
    Tutorials:
    2
    Resources:
    28
    Remove the Dummy after use.
    Attach the image to the tutorial [or put it at Hive's Abum].
     
  16. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    i already attach it to the tutorial
     
  17. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,656
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    I was thinking of creating this long ago but I thought it was too simple.

    I dont like the colour you use btw ( in the thread not your posts )
     
  18. chobibo

    chobibo

    Joined:
    Sep 24, 2005
    Messages:
    2,702
    Resources:
    0
    Resources:
    0
    Don't forget to set the dummy's art fields Cast Backswing and Cast Point to 0.
     
    Last edited: Oct 3, 2013
  19. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    Chaosy, yeah, i'll change it.. suggestion for the color??

    Chobibo, okay
     
  20. Malhorne

    Malhorne

    Joined:
    Sep 14, 2012
    Messages:
    2,330
    Resources:
    6
    Spells:
    4
    Tutorials:
    1
    JASS:
    1
    Resources:
    6
    I think it's better to use
    • Custom script - set bj_wantDestroyGroup = true


    Instead of using a group variable that need more memory to be allocate (AFAIK).