AOE Effects by many dummies

Sk8-tEr

New Member
Reaction score
5
I'm stepping away from learning JASS for a little because I actually don't know much with GUI

I tried to make an aoe sleep

Event - unit starts the effect of an ability
condition - ability equal to aoe sleep
action - create 10 dummy units at postion of target unit of ability being cast
for each integer 1 through 10 order last created unit to sleep random unit from unit group with conditions not equal to ally of player red

im kinda unsure with this never tried an ability like this
so can any1 help?
 

darkbeer

Beer is Good!
Reaction score
84
Code:
Event - Spell
Actions
- Set TempGroup = units in range XY machtching whatever
- UnitGroup pick unit in TempGroup
    - TempLoc = position of picked unit
    - Create 1 dummy at TempLoc
    - Add blbla to last created unit
    - issue last created unit to blabla picked unit
    - add epxiration timer to last created unit
    - Remove TempLoc
-Destroy TempGroup

creates a dummy for every picked unit and orders them to cast on that unit.
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
you need to pick each unit in range and do it in a loop

Code:
e: unit starts the effect of an ability

c: ability being cast equal to AOE sleep

a: set caster_pos = position of triggering unit
   set sleepy_group = units within x range of caster_pos matching (mathcing unit is alive equal to true and matching unit belongs to an enemy of owner of triggering unit equal to true and matching unit is a structure equal to false)
   Pick every unit in sleepy_group and do actions
     Loop
        set sleepy_pos = position of picked unit
        create 1 dummy for owner of triggering unit at sleepy_pos for owner of triggering unit
        give "[I]modified dreadlord's sleep ability[/I]" to last created unit
        add a 1 second generic expiration timer to last created unit
        order last created unit to Undead - Dreadlord sleep picked unit
        custom script: call RemoveLocation(udg_sleepy_pos)

    custom script: call RemoveLocation(udg_caster_pos)
    custom script: call DestroyGroup(udg_sleepy_group)

this is not MUI though, but you can make it MPI with arrays

EDIT: darkbeer I can't write so fast lol....
 

darkbeer

Beer is Good!
Reaction score
84
Dinowc :D

ähm why sholdnt yours be MUI???

ITS FULLY MUI, no waits nothing so no worries there. (same as mine :D)
 

Cookiemaster

New Member
Reaction score
36
you need to pick each unit in range and do it in a loop

Code:
e: unit starts the effect of an ability

c: ability being cast equal to AOE sleep

a: set caster_pos = position of triggering unit
   set sleepy_group = units within x range of caster_pos matching (mathcing unit is alive equal to true and matching unit belongs to an enemy of owner of triggering unit equal to true and matching unit is a structure equal to false)
   Pick every unit in sleepy_group and do actions
     Loop
        set sleepy_pos = position of picked unit
        create 1 dummy for owner of triggering unit at sleepy_pos for owner of triggering unit
        give "[I]dread lord's sleep ability, cant remember it xD[/I]" to last created unit
        add a 1 second generic expiration timer to last created unit
        order last created unit to Undead - Dreadlord sleep picked unit
        custom script: call RemoveLocation(udg_sleepy_pos)

    custom script: call RemoveLocation(udg_caster_pos)
    custom script: call DestroyGroup(udg_sleepy_group)

this is not MUI though, but you can make it MPI with arrays

EDIT: darkbeer I can't write so fast lol....


Why the hell isn't that MUI? It has no waits or anything.
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
well if both players use the spell at the RIGHT same time it could get a little messy :p
 

Curo

Why am I still playing this game...?
Reaction score
109
well if both players use the spell at the RIGHT same time it could get a little messy :p

That's impossible. Nothing ever happens at the same time in WC3 (aside from 2 units getting hit with one AoE spell at the same time, but even then I think the damage is done individually).
 

Sk8-tEr

New Member
Reaction score
5
How do you set the expiration timer?
I thought of making a second trigger but the timer seems easier
Thanks for the help btw

EDIT: I found the expiration timer but which one do i use?
 

Sk8-tEr

New Member
Reaction score
5
OK I put generic but the problem is the trigger wont work. The timer thing works though i think.

Code:
Untitled Trigger 003
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Sleep
    Actions
        Set POINT = (Target point of ability being cast)
        Set Sleepers = (Units within 200.00 of POINT matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Triggering unit) is A structure) Equal to False)))
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                Unit - Create 1 A for Player 1 (Red) at POINT facing Default building facing degrees
                Unit - Add SLeep For Dummy  to (Last created unit)
                Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Random unit from Sleepers)
                Unit - Add a 5.00 second Generic expiration timer to (Last created unit)

It gets really laggy once I cast the spell and the game almost freezes
 

darkbeer

Beer is Good!
Reaction score
84
hm found a few mistakes^^
also make sure the dummy can cast the spell (enough cast range, no cd/mana cost, targets allowed ....)

Code:
Untitled Trigger 003
    Events
        Unit - A starts the effect of an ability <-- much better
    Conditions
        (Ability being cast) Equal to Sleep
    Actions
        Set POINT = (Target point of ability being cast)
        Set Sleepers = (Units within 200.00 of POINT matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is A structure) Equal to False))) <-- should be matching unit...
        UnitGroup - Pick every unit in Sleepers and do Actions <-- No integer A loop a group loop^^ (most important thing)
            Loop - Actions
                Unit - Create 1 A for (Owner of (Triggering unit)) at POINT facing Default building facing degrees <-- owner of triggering unit is better :D
                Unit - Add SLeep For Dummy  to (Last created unit)
                Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Picked unit) <-- picked unit not random unit! (so they dont cast twice on the same unit)
                Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
         Custom script: call RemoveLocation(udg_POINT)
         Custom script: call DestroyGroup(udg_Sleepers)
 

Sk8-tEr

New Member
Reaction score
5
Code:
Untitled Trigger 003
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to AOE Sleep 
    Actions
        Set POINT = (Target point of ability being cast)
        Set Sleepers = (Units within 200.00 of POINT matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is A structure) Equal to False)))
        Unit Group - Pick every unit in Sleepers and do (Actions)
            Loop - Actions
                Unit - Create 1 A for Player 1 (Red) at POINT facing Default building facing degrees
                Unit - Add SLeep For Dummy  to (Last created unit)
                Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Random unit from Sleepers)
                Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation(udg_POINT)
        Custom script:   call DestroyGroup(udg_Sleepers)

Ok i edited the trigger a little, but the game still gets very laggy and I can't see anything when the spell is cast

The units DO get sleeped though, and it gets unlaggy after awhile :p but it still gets really bad for awhile. Is the loop
doing the trigger everytime the loop finishes so theres infinite commands of: Creating the dummy unit and ordering to cast?
 

Akolyt0r

New Member
Reaction score
33
in the loop you should use:

Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Picked Unit)

not ur random unit stuff.

and a 2 second expiration timer would be sufficient
 

Sk8-tEr

New Member
Reaction score
5
Ok I reduced the units to 5, stead of 10 and its a little less laggy but still spikes when the spell is cast! Is this unfixable?

Code:
Untitled Trigger 003
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to AOE Sleep 
    Actions
        Set POINT = (Target point of ability being cast)
        Set Sleepers = (Units within 200.00 of POINT matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is A structure) Equal to False)))
        Unit Group - Pick every unit in Sleepers and do (Actions)
            Loop - Actions
                Unit - Create 1 A for Player 1 (Red) at POINT facing Default building facing degrees
                Unit - Add SLeep For Dummy  to (Last created unit)
                Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Picked unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation(udg_POINT)
        Custom script:   call DestroyGroup(udg_Sleepers)
 

darkbeer

Beer is Good!
Reaction score
84
does it lag everytime or only the first time?

if its only the first time, you can preload the abilities.

else, well it actually shouldnt lag at all^^
 

Sk8-tEr

New Member
Reaction score
5
How do you preload abilities?
Is that like giving the ability to the dummy unit in unit editor so it always has the ability?
 

darkbeer

Beer is Good!
Reaction score
84
on map init create a unit add the ability and remove the unit.

there should be a tutorial aobut it somewehre
 

Windwalk

New Member
Reaction score
8
the only thing u could do is set the expiration timer a tone down more

since ur creating a whole shit load of dummies for every unit that is picked.. thats a lot.. so i would suggest toning the expiration timer down to 1

if it still lags juts make 1 dummy and making him sleep all the units instead of creating multiple ones.. and make sure the cooldown on the sleep is 0 and the range is 10000 so theirs no problems.. then set the expiration timer and that 1 dummy to 5 seconds and viola less lag <_<
 
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