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 Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top