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: 212

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.
  • 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!
    +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
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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