Having trouble creating an AoE Stun

jedi8955

New Member
Reaction score
4
I've been having a hell of a time making an AoE Stun ability.

Here's the ability as designed:

Horrify
Stuns units in an AoE for a short amount of time.

Lv 1: 300 AoE 1.5 Sec
Lv 2: 300 AoE 2 Sec
Lv 3: 350 AoE 2.5 Sec
Lv 4: 350 AoE 3 Sec
Lv 5: 400 AoE 4 Sec

I originally made an ability (I think I made it off Tornado Stun, but I really can't remember any more, been a long time)and gave it AoE under the Stats- Area of Effect line. That didn't work.

Then I made a dummy unit and have that cast different abilities based on what level of Horrify the casting unit has. Didn't work.

I then remade the dummy abilities and based those off of Storm Bolt. No dice.

I really just dunno wtf I'm doing with it at this point. Any help would be greatly appreciated.

The current JASS code is as follows:

JASS:
function Trig_AoE_Horrify_Lv_5_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A025' ) ) then
        return false
    endif
    if ( not ( GetUnitAbilityLevelSwapped('A025', GetTriggerUnit()) == 5 ) ) then
        return false
    endif
    return true
endfunction

function Trig_AoE_Horrify_Lv_5_Func006A takes nothing returns nothing
    call IssueTargetOrderBJ( udg_Horrify_Dummy_Unit, "A053", GetEnumUnit() )
endfunction

function Trig_AoE_Horrify_Lv_5_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'n01D', Player(11), GetUnitLoc(GetSpellTargetUnit()), bj_UNIT_FACING )
    set udg_Horrify_Dummy_Unit = GetLastCreatedUnit()
    call UnitAddAbilityBJ( 'A053', udg_Horrify_Dummy_Unit )
    set udg_Horrify_Point = GetUnitLoc(GetSpellTargetUnit())
    set udg_Horrify_Group = GetUnitsInRangeOfLocAll(400.00, udg_Horrify_Point)
    call ForGroupBJ( udg_Horrify_Group, function Trig_AoE_Horrify_Lv_5_Func006A )
    call RemoveUnit( udg_Horrify_Dummy_Unit )
    call DestroyGroup(udg_Horrify_Group)
    call RemoveLocation(udg_Horrify_Point)
endfunction

//===========================================================================
function InitTrig_AoE_Horrify_Lv_5 takes nothing returns nothing
    set gg_trg_AoE_Horrify_Lv_5 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_AoE_Horrify_Lv_5, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_AoE_Horrify_Lv_5, Condition( function Trig_AoE_Horrify_Lv_5_Conditions ) )
    call TriggerAddAction( gg_trg_AoE_Horrify_Lv_5, function Trig_AoE_Horrify_Lv_5_Actions )
endfunction


I made the JASS code by coding it in GUI then converting to custom text, then replacing the IssueTargetOrder with the code of the ability.

Here's the GUI backup of what I converted.

Trigger:
  • AoE Horrify Lv 1 GUI Backup
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Horrify
      • (Level of Horrify for (Triggering unit)) Equal to 1
    • Actions
      • Unit - Create 1 DummyUnit (Custom Campaign) for Player 12 (Brown) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
      • Set Horrify_Dummy_Unit = (Last created unit)
      • Unit - Add Horrify (Dummy Lv 1) to Horrify_Dummy_Unit
      • Set Horrify_Point = (Position of (Target unit of ability being cast))
      • Set Horrify_Group = (Units within 300.00 of Horrify_Point)
      • Unit Group - Pick every unit in Horrify_Group and do (Actions)
        • Loop - Actions
          • Unit - Order Horrify_Dummy_Unit to Human Peasant - Repair (Picked unit)
      • Unit - Remove Horrify_Dummy_Unit from the game
      • Custom script: call DestroyGroup(udg_Horrify_Group)
      • Custom script: call RemoveLocation(udg_Horrify_Point)


The Human Peasant - Repair was changed to the custom code of the Horrify Dummy abilities.

Thanks again for any help!
 

jig7c

Stop reading me...-statement
Reaction score
123
your triggers

JASS:
scope Stun initializer Init
globals
 unit u
endglobals

function Conditions takes nothing returns 
 return (GetSpellAbilityId() == 'A025') and (GetUnitAbilityLevelSwapped('A025', GetTriggerUnit()) == 5)) //not sure about this second condition
endfunction

function ReturnTrue takes nothing returns boolean
 return true
endfunction

function Horrify takes nothing returns nothing
   call IssueTargetOrder( u, 'A053', GetEnumUnit() )
endfunction

function Actions takes nothing returns nothing
    local unit a = GetTriggerUnit()
    local location l = GetUnitLoc(u)
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)
    local group g = CreateGroup ()
    local integer i
    if GetUnitLevel(a) == 1 then
     set i == 300
    elseif GetUnitLevel(a) == 2 then
     set i == 300
    elseif GetUnitLevel(a) == 3 then
     set i == 350
    elseif GetUnitLevel(a) == 4 then
     set i == 350
    elseif GetUnitLevel(a) == 5 then
     set i == 400
    endif

    set u = CreateUnit( Player (11), 'n01D', x, y, 360)
    call UnitAddAbility( u, 'A053')
    set g = GetUnitsInRangeOfLocAll(i, l) //this will including dead units as well as buildings...
    call ForGroup(g, Filter (function Horrify ))
    set u = null
    call DestroyGroup(g)
    call RemoveLocation(l)
    set a = null
endfunction

function Init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST, function ReturnTrue )
    call TriggerAddCondition(t, Condition( function Conditions ) )
    call TriggerAddAction(t, function Actions )
endfunction
endscope
//im not sure if this works or not, not tested


your GUI script
Trigger:
  • AoE Horrify Lv 1 GUI Backup
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Horrify
      • (Level of Horrify for (Triggering unit)) Equal to 1
    • Actions
      • Set point = (Position of (Target unit of ability being cast))
      • Set Horrify_Group = (Units within 300.00 of Horrify_Point) //this includes buildings too, just to let you know
      • Unit Group - Pick every unit in Horrify_Group and do (Actions)
        • Loop - Actions
          • Unit - Create 1 DummyUnit (Custom Campaign) for Player 12 (Brown) at (Point) facing Default building facing degrees
          • Add a .5 second generic expiration timer to (Last Created Unit)
          • Unit - Add Horrify (Dummy Lv 1) to Horrify_Dummy_Unit
          • Unit - Order Horrify_Dummy_Unit to Human - Storm Bolt (Picked Unit)
        • Custom script: call RemoveLocation(udg_point)
      • Custom script: call DestroyGroup(udg_Horrify_Group)
    • ------im not sure if this works or not, not tested-------


or use
War Stomp :)
 

Shura

New Member
Reaction score
45
What you are doing is incorrect. What you would want to do is have the trigger pick every unit is Horrify_Group, and then create a dummy for each unit in the group, and have the dummy cast an ability based off of Storm Bolt.
 

jedi8955

New Member
Reaction score
4
Awesome, thanks for the help!

Jig, thanks for cleaning up that code, I appreciate it. I don't fully understand the pure JASS code yet, but I can see that it's taking the 5 different triggers I had and condensing it into one. I'll end up GUIing it and then converting over for the actual map, since I'm more familiar with that, but mess around with the JASS code and see what I can figure out from it. Thanks for the warning about buildings, that's actually exactly what I'm looking for =)

Shura, thanks for explaining it all! I never saw anything about Dummies not being able to hit multiple units. No wonder everything's gone to pot, haha. Much appreciated.

Canons, I wanted this to be centered around a targeted unit. I could have modified the design, but why make it easy on myself? =)

I'm gonna go put this in the map and see what'll come out. Thanks again!
 

jedi8955

New Member
Reaction score
4
Ah hell, that didn't work.

Plugged in the GUI script like how Jig had it, nothing.

I then decided to add in a create special effect of Holy Bolt on the picked unit, so I could see if it was being affected,that didn't work either. Apparently, it's not even grabbing the units into a group.

I'm going to try the JASS solution posted tomorrow, after a good dose of unconsicousness.

Here's the current JASS code and GUI setup. Seems like it's just not doing squat.

JASS:
function Trig_AoE_Horrify_Lv_1_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A025' ) ) then
        return false
    endif
    if ( not ( GetUnitAbilityLevelSwapped('A025', GetTriggerUnit()) == 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_AoE_Horrify_Lv_1_Func003A takes nothing returns nothing
    set udg_Horrify_Point = GetUnitLoc(GetSpellTargetUnit())
    call CreateNUnitsAtLoc( 1, 'n01D', Player(11), udg_Horrify_Point, bj_UNIT_FACING )
    set udg_Horrify_Dummy_Unit = GetLastCreatedUnit()
    call UnitApplyTimedLifeBJ( 0.50, 'BTLF', udg_Horrify_Dummy_Unit )
    call UnitAddAbilityBJ( 'A02A', udg_Horrify_Dummy_Unit )
    call IssueTargetOrderBJ( udg_Horrify_Dummy_Unit, "A02A", GetEnumUnit() )
    call AddSpecialEffectLocBJ( GetUnitLoc(GetEnumUnit()), "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl" )
    call RemoveLocation(udg_Horrify_Point)
endfunction

function Trig_AoE_Horrify_Lv_1_Actions takes nothing returns nothing    
    set udg_Horrify_Group = GetUnitsInRangeOfLocAll(300.00, udg_Horrify_Point)
    call ForGroupBJ( udg_Horrify_Group, function Trig_AoE_Horrify_Lv_1_Func003A )
    call DestroyGroup(udg_Horrify_Group)
endfunction

//===========================================================================
function InitTrig_AoE_Horrify_Lv_1 takes nothing returns nothing
    set gg_trg_AoE_Horrify_Lv_1 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_AoE_Horrify_Lv_1, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_AoE_Horrify_Lv_1, Condition( function Trig_AoE_Horrify_Lv_1_Conditions ) )
    call TriggerAddAction( gg_trg_AoE_Horrify_Lv_1, function Trig_AoE_Horrify_Lv_1_Actions )
endfunction


Trigger:
  • AoE Horrify Lv 1 GUI Backup
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Horrify
      • (Level of Horrify for (Triggering unit)) Equal to 1
    • Actions
      • Set Horrify_Group = (Units within 300.00 of Horrify_Point)
      • Unit Group - Pick every unit in Horrify_Group and do (Actions)
        • Loop - Actions
          • Set Horrify_Point = (Position of (Target unit of ability being cast))
          • Unit - Create 1 DummyUnit (Custom Campaign) for Player 12 (Brown) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Set Horrify_Dummy_Unit = (Last created unit)
          • Unit - Add a 0.50 second Generic expiration timer to Horrify_Dummy_Unit
          • Unit - Add Horrify (Dummy Lv 1) to Horrify_Dummy_Unit
          • Unit - Order Horrify_Dummy_Unit to Human Mountain King - Storm Bolt (Picked unit)
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
            • Custom script: call RemoveLocation(udg_Horrify_Point)
      • Custom script: call DestroyGroup(udg_Horrify_Group)
 

Grymlax

Probably not around
Reaction score
138
I'ts not doing squat because your variables are fucked up.

Set Horrify_Group = (Units within 300.00 of Horrify_Point)
you try to set up a unit group before you set up the Horrify_Point. therefor no units will be picked.

Set Horrify_Point = (Position of (Target unit of ability being cast)) set this outside of the unitgroup loop and it should work better.

something like this


Trigger:
  • AoE Horrify Lv 1 GUI Backup
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Horrify
      • (Level of Horrify for (Triggering unit)) Equal to 1
    • Actions
      • Set Horrify_Point = (Position of (Target unit of ability being cast))
      • Set Horrify_Group = (Units within 300.00 of Horrify_Point)
      • Unit Group - Pick every unit in Horrify_Group and do (Actions)
        • Loop - Actions
          • Unit - Create 1 DummyUnit (Custom Campaign) for Player 12 (Brown) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Set Horrify_Dummy_Unit = (Last created unit)
          • Unit - Add a 0.50 second Generic expiration timer to Horrify_Dummy_Unit
          • Unit - Add Horrify (Dummy Lv 1) to Horrify_Dummy_Unit
          • Unit - Order Horrify_Dummy_Unit to Human Mountain King - Storm Bolt (Picked unit)
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
            • Custom script: call RemoveLocation(udg_Horrify_Point)
      • Custom script: call DestroyGroup(udg_Horrify_Group)


you should also use the event "a unit starts the effect of an ability" since your current trigger will fire before the spell takes mana and goes into cooldown.

and I think I should also mention that your spell will only work on level 1 because of your condition "(Level of Horrify for (Triggering unit)) Equal to 1" change that to "(Level of Horrify for (Triggering unit)) Equal to or greater than 1" if you wan't it to trigger on level 2-4 as well.
 

BlueMirage

Trust, but doubt.
Reaction score
39
Use Summon Infernal for stun and damage. Summon a unit that does not have a model, exists only for 1 second, and can't attack etc.
However, do make sure it does NOT have locust or it won't work.

DotA does it like this for Light Strike Array and Split Earth.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
The unit can have locust it would work. The units durration MUST BE LONGER THE THE IMPACT DELAY.
E.g
1 sec impact delay
1.1 sec unit durration.
Also its cool to give the summoned unit a nice explosion effect.
 

BlueMirage

Trust, but doubt.
Reaction score
39
I'm quite sure it won't work if it has locust, because if it did, DotA's LSA dummy would have it.
 

jig7c

Stop reading me...-statement
Reaction score
123
FYI: i have re-edited my post above with the triggers in it...
 

jedi8955

New Member
Reaction score
4
I'ts not doing squat because your variables are fucked up.

Set Horrify_Group = (Units within 300.00 of Horrify_Point)
you try to set up a unit group before you set up the Horrify_Point. therefor no units will be picked.

Set Horrify_Point = (Position of (Target unit of ability being cast)) set this outside of the unitgroup loop and it should work better.

That's what I get for working on this at 2 in the morning, haha. I'll pull it out and see how it goes.

FYI: i have re-edited my post above with the triggers in it...

Awesome, I'll take a look.

Thanks!
 

jedi8955

New Member
Reaction score
4
Sorry this's taken so long to reply to, I just started a new job so things've been pretty hectic.

So I tried the fixes, nothing.

Tried basing something off of Summon Infernal, nothing.

Then just went in with the regular old Dreadlord, no mods, and tried his Inferno.

My units are unaffected by the stun!

No wonder this didn't work. Now I need to figure out why this isn't bloody workin. Work on it tomorrow after my 2nd day of training.

The units are structures and mechanicals. I guess one of those is throwing it off, but I don't know what.
 

jedi8955

New Member
Reaction score
4
God, 6 days. This new job's killing my free time. Ah well, bills gots to be paid.

Anyway, I've finally got this figured out. I basically just pause everything then unpause it. Stupid simple, I was way overthinking this.

Trigger:
  • AoE Horrify Lv 1 GUI
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Horrify
      • (Level of Horrify for (Triggering unit)) Equal to 1
    • Actions
      • Set Horrify_Point = (Position of (Target unit of ability being cast))
      • Set Horrify_Group = (Units within 300.00 of Horrify_Point)
      • Unit Group - Pick every unit in Horrify_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Not equal to Player 12 (Brown)
              • (Unit-type of (Picked unit)) Not equal to A Secret Unit
              • (Unit-type of (Picked unit)) Not equal to A Different Secret Unit
            • Then - Actions
              • Unit - Pause (Picked unit)
              • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\Thunderclap\ThunderclapTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Do nothing
      • Wait 1.50 seconds
      • Unit Group - Pick every unit in Horrify_Group and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
      • Custom script: call DestroyGroup(udg_Horrify_Group)
      • Custom script: call RemoveLocation(udg_Horrify_Point)


Completely non-MUI, but there will only be one of the unit that uses this ability, so I'm not concerned.

The way that it's setup now, the stun effect goes away instantly. I can set up a Hashtable to clear it all out, but that can wait for now.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top