• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Simple GUI Trigger Enhanced Spell Request

Status
Not open for further replies.
Level 21
Joined
May 29, 2013
Messages
1,567
Edit: SOLVED by jakeZinc

This is a spell request, but maybe I could do it myself if someone who is experienced in triggering helped me or gave me suggestions.

I'm making an ability called Freezing Flood. It's based on Priestess of the Moon's Starfall. The ability has only one level and it's supposed to damage enemy buildings and slow nearby enemy ground unit's attack rate and movement speed. Since I barely have any experience in using triggers, I'm having trouble with the slow.

I need all enemy ground units, that are currently in the area of effect to have the "Slowed" buff (not "Slow" buff) until the ability's duration is over/caster dies/stops channeling.

I've tried to make a trigger that periodically creates a dummy unit and orders it to cast Frost Nova on every alive, non-mechanical, ground enemy unit in the area of effect, but it didn't work. Even when the caster is surrounded with enemies, only one random enemy unit gets the "Slowed" buff.

So, is there a way I can make the dummy unit cast Frost Nova on ALL nearby enemies instead of casting it on just one random unit?

TRIGGERS
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
Use unit groups and filter the enemy units, create dummy on each picked unit that passes the filteration process.

Anyway why just dont use aura instead of frost nova?
To be more specific:
Create dummy with endurance ability ( slow data based on negative values ) in the location that have expiration timer. It is much more easy if you dont want it to be complicated.

Edit: you also need to create a custom slowed buff for that endurance aura ability if you want to.

Edit2: and also change the targets allowed to enemy units.

Edit3: a single dummy unit can only cast a spell on single target at the sametime thats why it looks random one unit. So if you want to target multiple units then you have to create dummy on each of them.
 
Last edited:
Level 21
Joined
May 29, 2013
Messages
1,567
Anyway why just dont use aura instead of frost nova?
I know there are simpler ways to slow enemy units, but I want to use Frost Nova because it uses the "Slowed" buff that causes the unit to turn blue (blue tint) and it can't be dispelled. I know I can change the tinting in a trigger, but triggering that would be complicated.
a single dummy unit can only cast a spell on single target at the sametime thats why it looks random one unit.
Are you sure? In this trigger, from a tutorial, a dummy unit is casting an ability at the whole unit group.
  • base.gif
    Mass Sleep
    • joinminus.gif
      events.gif
      Events
      • line.gif
        joinbottom.gif
        unit.gif
        Unit - A unit Starts the effect of an ability
    • joinminus.gif
      cond.gif
      Conditions
      • line.gif
        joinbottom.gif
        if.gif
        (Ability being cast) Equal to Mass Sleep
    • joinbottomminus.gif
      actions.gif
      Actions
      • empty.gif
        joinbottomminus.gif
        unitgroup.gif
        Unit Group - Pick every unit in (Units within (300.00 + (100.00 x (Real((Level of Mass Sleep for (Triggering unit)))))) of (Target point of ability being cast) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit and do (Actions)
        • empty.gif
          empty.gif
          joinbottomminus.gif
          actions.gif
          Loop - Actions
          • empty.gif
            empty.gif
            empty.gif
            join.gif
            unit.gif
            Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing 0.00 degrees
          • empty.gif
            empty.gif
            empty.gif
            join.gif
            unit.gif
            Unit - Add Sleep (Mass Sleep) to (Last created unit)
          • empty.gif
            empty.gif
            empty.gif
            join.gif
            unit.gif
            Unit - Set Level of Sleep (Mass Sleep) for (Last created unit) to (Level of Mass Sleep for (Triggering unit))
          • empty.gif
            empty.gif
            empty.gif
            join.gif
            unit.gif
            Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Picked unit)
          • empty.gif
            empty.gif
            empty.gif
            joinbottom.gif
            unit.gif
            Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
So if you want to target multiple units then you have to create dummy on each of them.
How do I do that?
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
You can cast an ability on multiple units at once. In fact, I have made a tutorial similar to daelin's about it.
I would gladly take on this request If I had time.

Edit: From the trigger daelin made that you have just quoted, he made one dummy for each picked unit. That isn't very efficient because you can actually just make one dummy for all picked unit. Check out my tutorial on my signature.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
You can cast an ability on multiple units at once

Test this: use a single global dummy unit to cast chain lightning at the 10 enemy units in the playable area. Make the dummy unit move at each othem and set its height to 1500. The number of targets for chain lightning is only one. ( this concept is similar to the DotA's Zeus )

If the single global created dummy unit casts the chain lightning on multiple targeted units at the same time. I'll be glad if you show me the demo map to prove your statement :p
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
Test this: use a single global dummy unit to cast chain lightning at the 10 enemy units in the playable area. Make the dummy unit move at each othem and set its height to 1500. The number of targets for chain lightning is only one. ( this concept is similar to the DotA's Zeus )

If the single global created dummy unit casts the chain lightning on multiple targeted units at the same time. I'll be glad if you show me the demo map to prove your statement :p
It indeed doesn't work with chain lightning because the ability is immediately disabled right after it finishes casting the ability, same goes with Healing Wave. However, It does work with any other abilities except chain lightning and healing wave so far.
Even Forked Lightning can get it work correctly. I've tested it with Forked Lightning, Frost Nova, Storm Bolt, Sleep, Death Coil, Inner Fire, and curse. They all worked flawlessly. Do I still need to provide you a test map? You can actually test it yourself.
 
Level 21
Joined
May 29, 2013
Messages
1,567
I've tested it with Forked Lightning, Frost Nova, Storm Bolt, Sleep, Death Coil, Inner Fire, and curse. They all worked flawlessly.
Good to know.
So... can anyone tell me why doesn't this work? The dummy unit still periodically casts Frost Nova only at one enemy, instead of casting it at the whole unit group. It seems to target the enemy unit with the highest level, and continues casting it, until the duration is over. However, it WILL change the target, but only if the first chosen target dies, moves out of range or becomes invulnerable (untargetable).

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Freezing Tide
    • Actions
      • Set Caster = (Triggering unit)
      • Set Owner = (Triggering player)
      • Set TempPoint = (Position of Caster)
      • Trigger - Turn on Untitled Trigger 002 <gen>


  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Dummy (Caster) for Owner at TempPoint facing Default building facing degrees
      • Set DummyUnit = (Last created unit)
      • Unit - Add Frost Nova (Dummy) to DummyUnit
      • Unit - Add a 1.00 second Generic expiration timer to DummyUnit
      • Set Group = (Units within 1000.00 of TempPoint)
      • Unit Group - Pick every unit in Group and do (Unit - Order DummyUnit to Undead Lich - Frost Nova (Picked unit))


  • Untitled Trigger 003
    • Events
      • Unit - A unit Stops casting an ability
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Freezing Tide
    • Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup(udg_Group)
      • Set Caster = No unit
      • Trigger - Turn off Untitled Trigger 002 <gen>


  • Untitled Trigger 004
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to Caster
    • Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup(udg_Group)
      • Set Caster = No unit
      • Trigger - Turn off Untitled Trigger 002 <gen>
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
@Rheiko
Yes, to let us know how did you do it in an actual demo map but its okay if you would not ^^. Great to know about that disabled ability stuff.

@Hermit
Triggers 3 and 4 can be merged inside the periodic trigger by using if statement.
You are leaking a unit group and you should destroy it periodically too where you created it.
No need to null Caster.
As Ive said you must make dummy unit in each unit picked so it will cast frost nova properly in each of them.
Read this:Convenient Unit Group Filtering in GUI

If still doesnt work:
Make sure dummy unit is configured properly: Cast point, blend time, castback is 0. Locust ability and sight range of 400.
Make sure the frost nova dummy ability is configured properly: cooldown and mana costs are 0. Cast range to 999999 and the target filters for air, ground, enemy.
Change the triggering player to an owner of Caster ( this causes some issues sometimes especially on computer players that must order dummy unit )
Debug dummy: put an art model of a unit to see it in action.
 
Last edited:
Level 21
Joined
May 29, 2013
Messages
1,567
Thanks, jakeZinc IT WORKS NOW!
Triggers 3 and 4 can be merged inside the periodic trigger by using if statement.
What should I put in the If/Then/Else? I'd rather not do it if it isn't necessary. Please tell me if there is anything wrong with the triggers below (are there any leaks).

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Freezing Tide
    • Actions
      • Set Caster = (Triggering unit)
      • Set Owner = (Owner of Caster)
      • Set TempPoint = (Position of Caster)
      • Trigger - Turn on Untitled Trigger 002 <gen>


  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Dummy (Caster) for Owner at TempPoint facing Default building facing degrees
      • Set DummyUnit = (Last created unit)
      • Unit - Add Frost Nova (Dummy) to DummyUnit
      • Unit - Add a 1.00 second Generic expiration timer to DummyUnit
      • Set Group = (Units within 1000.00 of TempPoint)
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • 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
              • (TempUnit is A structure) Equal to False
              • (TempUnit is A flying unit) Equal to False
            • Then - Actions
              • Unit - Order DummyUnit to Undead Lich - Frost Nova TempUnit
            • Else - Actions
      • Custom script: call DestroyGroup(udg_Group)


  • Untitled Trigger 003
    • Events
      • Unit - A unit Stops casting an ability
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Freezing Tide
    • Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Trigger - Turn off Untitled Trigger 002 <gen>


  • Untitled Trigger 004
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to Caster
    • Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Trigger - Turn off Untitled Trigger 002 <gen>
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
^ Just remove the destroy group line in triggers 3 and 4 because you already cleaned it in periodic trigger. Dying unit can be triggering unit.

Yes, putting an if statement is not necessary but in terms of efficiency you should. Well it still depends on you ^^.
 
Level 21
Joined
May 29, 2013
Messages
1,567
Just remove the destroy group line in triggers 3 and 4 because you already cleaned it in periodic trigger. Dying unit can be triggering unit.
Done.
Yes, putting an if statement is not necessary but in terms of efficiency you should. Well it still depends on you ^^.
I tried to do it like this, but it didn't work.

  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Dummy (Caster) for Owner at TempPoint facing Default building facing degrees
      • Set DummyUnit = (Last created unit)
      • Unit - Add Frost Nova (Dummy) to DummyUnit
      • Unit - Add a 1.00 second Generic expiration timer to DummyUnit
      • Set Group = (Units within 1000.00 of TempPoint)
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • 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
              • (TempUnit is A structure) Equal to False
              • (TempUnit is A flying unit) Equal to False
            • Then - Actions
              • Unit - Order DummyUnit to Undead Lich - Frost Nova TempUnit
            • Else - Actions
      • Custom script: call DestroyGroup(udg_Group)
      • Custom script: call RemoveLocation (udg_TempPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Caster is alive) Equal to False
          • (Current order of Caster) Not equal to (Order(starfall))
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions

Since the spell can work without it, I'll use the triggers from my post above.
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
^ caster is alive equal to false is not accurate, caster is dead equal to true is recommended.

Put the remove location line inside the if then block ( above the turn off trigger ) so the location reference will still be used in the whole spell event.

Other than that it is good ^^.
Make it MUI as possible if needed.

Goodluck ^^
 
Level 21
Joined
May 29, 2013
Messages
1,567
^ caster is alive equal to false is not accurate, caster is dead equal to true is recommended.

Put the remove location line inside the if then block ( above the turn off trigger ) so the location reference will still be used in the whole spell event.
I did as you said, but now dummy unit are still being created even when the caster stops channeling. I'll just use four triggers instead of two. Thanks anyways.
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
@Rheiko
Yes, to let us know how did you do it in an actual demo map but its okay if you would not ^^. Great to know about that disabled ability stuff.
I'm too lazy to make a proper test map. Just try to do it with any ability other than chain lightning and healing wave.
If you want to check out the disabled thing, just cast chain lightning or healing wave and you'll see that it is disabled for a second or less.
 
Status
Not open for further replies.
Top