Help With Spell - Chain Reaction

San-D

New Member
Reaction score
15
The idea here is to make an ability that targets a unit, damages it, picks all enemies in 500 of unit, damage them, pick all units in 500 of all the picked units that have not been yet affected by this spell and damage them, pick all in 500 of those units and so on

Code:
Chain Reaction
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chain Reaction (Neutral Hostile)
    Actions
        Set Target = (Target unit of ability being cast)
        Unit Group - Add Target to Reactio_Group
        Set Temp_Point = (Position of Target)
        Unit - Create 1 Dummy for (Owner of (Casting unit)) at Temp_Point facing Default building facing degrees
        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 500.00 at Temp_Point, dealing 500.00 damage of attack type Spells and damage type Normal
        For each (Integer A) from 1 to (Number of units in (Units in (Playable map area))), do (Actions)
            Loop - Actions
                Wait 1.00 seconds
                Unit Group - Pick every unit in (Units within 500.00 of (Position of Target)) and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Picked unit) is in Reactio_Group) Equal to False
                                ((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True
                            Then - Actions
                                Set Target = (Picked unit)
                                Unit Group - Add Target to Reactio_Group
                                Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Position of (Picked unit)) facing Default building facing degrees
                                Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                                Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 500.00 at (Position of (Picked unit)), dealing 500.00 damage of attack type Spells and damage type Normal
                            Else - Actions

To check out if it works I made a map with a streaming line of Wisps to see. The problem is - it only continues on the left side of the stream and leaves the right behind (Right side has units in 500 of previous) and damages already damaged units over and over!

HELP!
 

oorosco

New Member
Reaction score
23
You know you completely did it wrong, because you damage them all without adding them to a group first

Code:
  Unit - Create 1 Dummy for (Owner of (Casting unit)) at Temp_Point facing Default building facing degrees
        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 500.00 at Temp_Point, dealing 500.00 damage of attack type Spells and damage type Normal

And then you Don't continue you it. It should be somewhat like this where it picks a unit and then it keeps going from there, not where it deals dmg first and then just selects one unit. You can also do this, you have two triggers right, and do it like this...

Code:
Untitled Trigger 002
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
    Actions
        Set group_temp = (Units within 500.00 of (Position of (Triggering unit)))
        Trigger - Run Untitled Trigger 001 <gen> (checking conditions)


Code:
Untitled Trigger 001
    Events
    Conditions
    Actions
        Unit Group - Pick every unit in group_temp and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is in group_temp) Equal to False
                    Then - Actions
                        Unit - Cause caster to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
                        Unit Group - Add (Picked unit) to group_temp
                    Else - Actions
                
                Trigger - Run (This trigger) (checking conditions)
 

Tinki3

Special Member
Reaction score
418
I've whipped up a quick demo map with an easily configurable chain reaction spell.

Keep in mind that it's just a guess relating to the spell description in post #1.
 

Attachments

  • Chain Reaction Demo Map.w3x
    27.6 KB · Views: 209

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
You run the same trigger over and over again, maybe that is why it would crash?
Code:
Untitled Trigger 001
    Actions
        Unit Group - Pick every unit in group_temp and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is in group_temp) Equal to False
                    Then - Actions
                        Unit - Cause caster to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
                        Unit Group - Add (Picked unit) to group_temp
                    Else - Actions
        Trigger [COLOR="Red"]- Run (This trigger) (checking conditions)[/COLOR]
Run it once, crash. If the trigger of yours were meant to have that red line in the "else part", would not matter.
 

Squishy

You can change this now in User CP.
Reaction score
127
Your causing you trigger to run itself over and over again with no waits between each run.

EDIT: Too late
 

Flare

Stops copies me!
Reaction score
662
Whenever you run Untitled_Trigger_001, it runs itself again.

First run of the trigger fires the second run (with the Run Trigger action)
Second run of the trigger fires the third run (same action is the culprit)
Third run fires the fourth.

Continues until Warcraft can't take anymore and crashes (pretty much instantly).

Infinite loops are bad :)
 

San-D

New Member
Reaction score
15
Tinki3's map is a killer!:D Just one question. If u start the spell from the center of the "+" it spreads out everywhere, but why if u star trom the edge it stops in the middle?
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
One little thing I disliked about the trigger (or several, but this is "major", no big deal but...):
Code:
Unit Group - Pick every unit in (Units within CR_AoE of CR_Point[2] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is A flying unit) Not equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner and do (Actions)
What where you thinking when doing that line? Must have taken 3 weeks to create that line :/
Why not just pick every unit in the group, use an if then else like this:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        ((Picked unit) is A Hero) Equal to True
        ((Picked unit) is dead) Equal to True
        and so on...
    Then - Actions
    Else - Actions
Just remember that to the next time, thank you.
If you had a good reason creating that line, I'll gladly hear it. It is because you like to click the windows? Right...

Edit: seeing your last post...

Because, it goes from the target and then jumps to nearby enemies in a circle. If there are no enemies on the left side, it will not go there, and just jump to the right/up/down. First it will pick units within 350 range of the target.
If those matches the conditions (enemy and so on) it will damage those, and then pick units within 350 range of those agian... So will it do 6 times. Which mean, If you start on the left side, it will, yes, more or less stop at the middle, due to the range limit from the target.
What is the "range limit", it is about 350*6. Why? Because each time it can jump to nearby units within 350 range, and it can jump a total of 6 times.
Understood? Just read the trigger... :)

It is meant to stop there, if it has 'jumped' 6 times...*g*
 

San-D

New Member
Reaction score
15
no, there are enemies everywhere, im talking on the first cast! the bunch is in the shape of a "+" i cast it on the left most corner of that + and it spread,it spread and it reached the "Crossing" and stoped, there were pleanty of enemies left

EDIT:
GOT IT! CR_Chain_Amount is 6, that means the wave will spread 6 times, if i move it to 1000, it could probably affect a whole spiral of units on a 400x400 map!
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Well, glad you got it, but "no", it still requires units nearby the target, so 1000 in the ChainAmount would not do too much, it would still require that each unit who matched the conditions would be within 350 range.
But changing the AOE and the jump, yes that would get the effect you just described.

But then again the units can move, and the effect will move, if one unit is in the 'affected group', then teleports to somewhere else, the effect will spread to that area too...:)

Tinki3...pfft...
Lies just to not say I am right, but ok. Ive moved on.
 

Tinki3

Special Member
Reaction score
418
> What where you thinking when doing that line?
> Why not just pick every unit in the group, use an if then else like this

1. About the filtering in the group.
2. I think it's silly doing it that way if you can achieve what you need in one line.
Also, the Unit Group action offers a number of different base filtering options, all of which are suitable to be used instead of an If-then-Else statement.

It only took me a few seconds to produce anyway...
 

San-D

New Member
Reaction score
15
One last thing - there is a wait action i the map. Does that mean its not MUI?
 

San-D

New Member
Reaction score
15
Think it means that u allow this trigger to destroy the unit group ur about to create!
 
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