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.
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • 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!

      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