Help with spell

worldeditors

Cool Member
Reaction score
1
Hello everyone, I'm making an AOE ensnare spell, I've created everything, tested but the dummy unit ensnares me instead of the enemies. It is supposed to ensnare ALL units within 400 range of the hero.
Here's the trigger

Code:
Ensnare
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to AOE ensnare [Survivor]
    Actions
        Set L = (Position of (Casting unit))
        Unit - Create 1 Dummy unit Ensnare for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
        Unit Group - Pick every unit in (Units within 400.00 of L) and do (Unit - Order (Last created unit) to Orc Raider - Ensnare (Picked unit))
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)

Help me pls.:banghead::banghead:
 

PrisonLove

Hard Realist
Reaction score
78
make all enemies of hero within 300 or w/e into a unit group then order the unit to cast the spell on the unit group. i think that may work
 

Black Hawk

New Member
Reaction score
16
Try this:
Code:
Ensnare
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to AOE ensnare [Survivor]
    Actions
        Set L = (Position of (Casting unit))
        Unit - Create 1 Dummy unit Ensnare for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
        Unit Group - Pick every unit in (Units within 400.00 of L) and do (Actions)
                Loop - Actions
                       Unit Group - Remove (Triggering unit) from (Last created unit group)
                       (Unit - Order (Last created unit) to Orc Raider - Ensnare (Picked unit))
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
 

vypur85

Hibernate
Reaction score
803
You should use pick every unit "macthing" conditions... By picking every unit around the caster only (without condition), the caster is also picked as well. Thus ensnaring yourself.

Code:
Unit Group - Pick every unit in (Units within 300.00 of (Position of (Last created unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Last created unit))) Equal to True)) and do (Actions)
    Loop - Actions

And i think you should create a unit for every picked unit, so every enemy unit has a dummy.

(Lol... I saw you revived an almost one year old thread >.<)
 

Black Hawk

New Member
Reaction score
16
You should use pick every unit "macthing" conditions... By picking every unit around the caster only (without condition), the caster is also picked as well. Thus ensnaring yourself.

Code:
Unit Group - Pick every unit in (Units within 300.00 of (Position of (Last created unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Last created unit))) Equal to True)) and do (Actions)
    Loop - Actions

And i think you should create a unit for every picked unit, so every enemy unit has a dummy.

(Lol... I saw you revived an almost one year old thread >.<)

That works better, but is not one year old.
 

worldeditors

Cool Member
Reaction score
1
You should use pick every unit "macthing" conditions... By picking every unit around the caster only (without condition), the caster is also picked as well. Thus ensnaring yourself.

Code:
Unit Group - Pick every unit in (Units within 300.00 of (Position of (Last created unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Last created unit))) Equal to True)) and do (Actions)
    Loop - Actions

And i think you should create a unit for every picked unit, so every enemy unit has a dummy.

(Lol... I saw you revived an almost one year old thread >.<)


Lol. I love reviving threads. But I do it to help ppl. If I can figure out a even better way of solving his problem. :D
 

worldeditors

Cool Member
Reaction score
1
Sorry for double posting but I felt that off topics and on topics should be seperated.


Thanks for all ur help. I'm trying it now and will edit if it works. But another question. Do I have to create more dummy units to ensnare more than 1 unit? Coz only 1 unit is ensnared and I want all units around the hero to be ensnared. Is there a better way other than creating more dummy units? :nuts:
 

Black Hawk

New Member
Reaction score
16
Try doing this:
Code:
Ensnare
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to AOE ensnare [Survivor]
    Actions
        Set L = (Position of (Casting unit))
        Unit - Create 1 Dummy unit Ensnare for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
        Unit Group - Pick every unit in (Units within 300.00 of (Position of (Last created unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Last created unit))) Equal to True)) and do (Actions)
    Loop - Actions
                Loop - Actions
                       (Unit - Order (Last created unit) to Orc Raider - Ensnare (Picked unit))
                       Unit - Reset ability cooldowns for (Last created unit)
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
 

vypur85

Hibernate
Reaction score
803
Do this will ensnare every picked unit :):
Code:
Actions
    Unit Group - Pick every unit in (Units within 300.00 of (Position of (Last created unit)) matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is A structure) Equal to False))) and do (Actions)
        Loop - Actions
            Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing Default building facing degrees
            Unit - Order (Last created unit) to Orc Raider - Ensnare (Picked unit)
            Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
            Unit - Hide (Last created unit)
Its not leak-free.

but is not one year old
Almost though. Almost. :)

Edit2: To Hawk (referring to your post below :p): Aha... You've misunderstood me. 'worldeditors' knows what i mean though. I meant this thread. :)
 

worldeditors

Cool Member
Reaction score
1
I've tried this. Can anybody tell me why it won't work? The dummy units just stand there and then die after 2 seconds without casting the net.

Code:
Ensnare
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to AOE ensnare [Survivor]
    Actions
        Set L = (Position of (Casting unit))
        Unit Group - Pick every unit in (Units within 400.00 of L matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True)) and do (Actions)
            Loop - Actions
                Unit - Create (Number of units in (Units within 400.00 of L)) Dummy unit Ensnare for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
                Unit Group - Order (Units of type Dummy unit Ensnare) to Orc Raider - Ensnare (Picked unit)
        Unit Group - Pick every unit in (Units of type Dummy unit Ensnare) and do (Unit - Add a 2.00 second Generic expiration timer to (Picked unit))
 

worldeditors

Cool Member
Reaction score
1
I used vypur's method and I added an expiration timer to myself. I died after 1 second. LOL.

I used Black Hawk's method and the dummy came out but then did not cast ensnare. It even came out when i was alone with no units around me.
 

worldeditors

Cool Member
Reaction score
1
Yep. I tested it without matching condition and it worked. I think it's the problem with the condition in the trigger itself.
 

vypur85

Hibernate
Reaction score
803
I used vypur's method and I added an expiration timer to myself. I died after 1 second. LOL.

Add expiration timer to 'last created unit' not 'triggering unit'. Im sure my method works. Except that it leaks. Dont worry bout it first though. Get it to work first. :)

Edit: I thought i've editted but then i left out that. My bad. Dont leave out the conditions, they are important. Use them. The mistake is here (my trigger, that is):

Code:
Actions
    Unit Group - Pick every unit in (Units within 300.00 of (Position of ([B]Triggering unit[/B])) matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is A structure) Equal to False))) and do (Actions)
        Loop - Actions
            Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing Default building facing degrees
            Unit - Order (Last created unit) to Orc Raider - Ensnare (Picked unit)
            Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
            Unit - Hide (Last created unit)
 

vypur85

Hibernate
Reaction score
803
It works. I used the exact trigger. Did you removed the Tech Requirement? (which is the problem you've mentioned in that one year old thread :p).

Hope it solves the problem now.


Offtopic: Singapore is on school holiday now? Sorry, im a bit noob in school schedules. Feel like going there for a holiday. Backpack maybe :). (Hotels there are expensive!!! Crab... Bueh ta han...)
 

Attachments

  • Mass Ensnare.w3x
    17.8 KB · Views: 112

worldeditors

Cool Member
Reaction score
1
It works. I used the exact trigger. Did you removed the Tech Requirement? (which is the problem you've mentioned in that one year old thread :p).

Hope it solves the problem now.


Offtopic: Singapore is on school holiday now? Sorry, im a bit noob in school schedules. Feel like going there for a holiday. Backpack maybe :). (Hotels there are expensive!!! Crab... Bueh ta han...)

Offtopic: Yep, starting from 17 Nov it's been holiday already. But for secondary school students [like me], holiday frm 26 Oct. Whr you from, feel free to visit, stay in a friend's house? If you find that hotels are too expensive.


EDIT: Fixed
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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