1. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  2. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  3. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  4. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  5. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  6. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  7. 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.

Essentials Tutorial

Discussion in 'Trigger (GUI) Editor Tutorials' started by Deuterium, Aug 22, 2009.

  1. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    True indeed, but this tutorial focuses on GUI (by now, maybe I'll make a Jass section someday), and in GUI that is no problem - unless you're sharing information between two different triggers (I might have to mention that instead).

    Thanks for checking :)
     
  2. Vulcano

    Vulcano

    Joined:
    Mar 8, 2009
    Messages:
    335
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I had the problem in a gui trigger. That one wasn't working.

    But this one works (stored TriggeringUnit and Target unit... in a variable):
    trigger
    • Forked Banish
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Chain Banish (|cffdc143cUltimate|r)
      • Actions
        • Set tempUnit = (Triggering unit)
        • Set tempUnit2 = (Target unit of ability being cast)
        • Set tempPoint = (Position of tempUnit)
        • Set point1 = (Position of tempUnit2)
        • Set tempInt = 0
        • -------- - --------
        • -------- Cast Banish on target --------
        • Unit - Create 1 caster 5 sec for (Owner of tempUnit) at tempPoint facing Default building facing degrees
        • Unit - Add Chain Banish (dummy) to (Last created unit)
        • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning tempUnit2
        • Unit - Create 1 caster 5 sec for (Owner of tempUnit) at tempPoint facing Default building facing degrees
        • If ((Last created unit) Equal to No unit) then do (Game - Display to (All players) the text: BeforeLoop) else do (Do nothing)
        • Unit - Add Banish to (Last created unit)
        • Unit - Order (Last created unit) to Human Blood Mage - Banish tempUnit2
        • -------- - --------
        • -------- Cast Banish on random targets around target --------
        • Set tempGroup = (Units within 400.00 of point1 matching (((Matching unit) belongs to an enemy of (Owner of tempUnit)) Equal to True))
        • Unit Group - Remove (Target unit of ability being cast) from tempGroup
        • Unit Group - Pick every unit in tempGroup and do (Actions)
          • Loop - Actions
            • Set tempInt = (tempInt + 1)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • 7 Greater than tempInt
              • Then - Actions
                • Unit - Create 1 caster 5 sec for (Owner of tempUnit) at tempPoint facing Default building facing degrees
                • If ((Last created unit) Equal to No unit) then do (Game - Display to (All players) the text: bla) else do (Do nothing)
                • Unit - Add Chain Banish (dummy) to (Last created unit)
                • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Picked unit)
                • Unit - Create 1 caster 5 sec for (Owner of tempUnit) at tempPoint facing Default building facing degrees
                • Unit - Add Banish to (Last created unit)
                • Unit - Order (Last created unit) to Human Blood Mage - Banish (Picked unit)
              • Else - Actions
        • Custom script: call DestroyGroup(udg_tempGroup)
        • Custom script: call RemoveLocation( udg_tempPoint )
        • Custom script: call RemoveLocation( udg_point1 )


    Thx for giving me 3 orbs :)
     
  3. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Oh I had no idea that that doesn't work... never had any problems with that in GUI. I'll test that out someday when I get some free time.
     
  4. Sheephunter

    Sheephunter

    Joined:
    Dec 21, 2008
    Messages:
    760
    Resources:
    0
    Resources:
    0
    Great! Just one problem on the Multi Unit Instanceability (MUI) triggering,
    I copy it exakly and lookt on it but I can't realy see the Set DT_IndexThree
    and it only work once...
    Can you fix it? :D
     
  5. Rmx

    Rmx

    Joined:
    Aug 27, 2007
    Messages:
    1,088
    Resources:
    18
    Icons:
    3
    Spells:
    15
    Resources:
    18
    AWESOME tutorial :D
     
  6. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    602
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    the target unit "function" returns that unit when called, once it is called it clears that unit and thats why second time using it will return null or smth...

    thous storing it to variable is a must if you will use that function multiple times, it might not clear it after first call but most likely it will...
     
  7. Vulcano

    Vulcano

    Joined:
    Mar 8, 2009
    Messages:
    335
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Triggering unit was also bugging....

    In case you are interested, this is the thread on wc3c on which someone helped me with this.
     
  8. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    602
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    no GetTriggerUnit() always works! it was your bug coz "GetTriggerUnit()" returns an "event" unit and in your case event unit was null. why? coz there was no event, only response was a timer which executed that function, this is same bug that Deuterium made in his spells. all this GetTriggerUnit, GetExpiredTimer, GetEventDamage()... they work only for events and well GetExpiredTimer is not responding fully to event but its logical that it returns timer which just expired...

    however GetSpellTargetUnit() is different and well maybe blizzard did not want to clear it but maybe they did... anyway you must store it in variable same as GetSpellTargetLoc(), well X and Y where added through...
     
  9. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    @ Vulcano:
    I just tested using Triggering unit inside group loops, and it works just fine.
    Dark_Dragon explains which issues could lead to returning null.
     
  10. yamigosaya

    yamigosaya

    Joined:
    Aug 13, 2009
    Messages:
    49
    Resources:
    0
    Resources:
    0
    Can I Ask?
    Some People Are Using The CHANNEL Spell
    Why They Are using it why they don't use The Other Abilities
     
  11. aznricepuff

    aznricepuff

    Joined:
    Feb 22, 2006
    Messages:
    749
    Resources:
    4
    Maps:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    4
    Channel is a dummy spell. Most people use it for completely triggered spells. For example, they give an ability based off channel to a unit or a hero then when that ability is cast, a trigger is run that actually runs all the spell effects (special effects, damage, buffs, w/e). Channel is an ideal base ability for dummy abilities because it allows you to change a lot of stuff that other spells don't:

    • BaseOrderID
    • Visibility in the UI
    • Target Type (Instant, Unit, Point)
    • Show/Don't show AOE art (the graphic that appears over the AOE circle for spells like blizzard and flamestrike)
    • Treat as Physical/Universal spell (i.e. bypass spell immunity)
    • Unique Cast (if multiple units are selected all with the spell, does ordering the spell to be cast cause all selected units to cast it simultaneously? e.g. Defend is not a unique cast while Roar is)
     
  12. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Maybe I could "quote" what you just said aznricepuff about the channel in the tutorial =) definitely with all the details and examples :) whenver I get the time :p

    There also was something else i wanted to add, but really can't remember :p
     
  13. yamigosaya

    yamigosaya

    Joined:
    Aug 13, 2009
    Messages:
    49
    Resources:
    0
    Resources:
    0
    But i Have a Problem I can't See the Skill At the Hero Abilities In-game:nemor:
     
  14. aznricepuff

    aznricepuff

    Joined:
    Feb 22, 2006
    Messages:
    749
    Resources:
    4
    Maps:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    4
    Make sure you check the visible box under the options data field.
     
  15. -Berz-

    -Berz-

    Joined:
    Mar 5, 2008
    Messages:
    3,203
    Resources:
    123
    Icons:
    111
    Packs:
    1
    Skins:
    1
    Spells:
    10
    Resources:
    123
    Yeah, I had problems figuring out why the icon doesn't appear in game :p

    Do as aznricepuff says ;)
     
  16. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    @ BZK:
    Hehehe :p
     
  17. Kelthose

    Kelthose

    Joined:
    Feb 8, 2009
    Messages:
    17
    Resources:
    0
    Resources:
    0
    Great post. This helped me with at least 90% of the issues I was having. I'm new to triggering and I found this easy to follow. Nicely done.
     
  18. Justin Weaver

    Justin Weaver

    Joined:
    Mar 1, 2014
    Messages:
    62
    Resources:
    0
    Resources:
    0
    Some explanation please :vw_wtf: The periodic time is .01 seconds

    Problems:
    1.) The angle sometimes not accurate :(
    2.) The spell isn't running unless i have 2 units casting at the same time .. TY
     

    Attached Files: