(Note: This apparently only works for Weapons and not on Abilities)
I've seen a lot of posts on this and no one has ever really given a clear answer on it, so I thought I'd just give a quick explanation for all those who want to know how to make a Chain Lightning skill all data side without the use of behaviors, just like the Mutalisk weapon.
So the basic setup for a Chain Lightning skill is as follows
So in other words, your Ability does a an Effect Set, and inside the Set you do your damage and then do an Effect Search to find the next target. The Effect applied by the Search Effect will be your next Set effect which will continue the chain. You simply rinse and repeat with new Set and Search Effects for as many bounces of the Chain Lightning as you want.
This is all pretty much covered in depth by other tutorials. The part that ISN'T documented as well is how to keep the bounces from hitting the a single target more then one time. This is done through Markers.
Basically, a Marker is something that an effect leaves on a unit that tells the game that that unit has been hit by that effect. How long the marker lasts depends on how it is applied, or simply the duration of the effect. How the Marker is seen by the game depends on what options you select when handling the Markers+ on the effect.
For the Chain Lightning, you need to use the [No Markers] validator to tell the Chain Lightning not to target previously struck units when searching for a new target. The validator needs to be applied to whatever Effect the Search Effect is going to use once it finds a unit. For this case, we need to apply it to all of our Set Effects.
At this point if you were to test the ability, it wouldn't work at all. This is because we haven't set up the Markers to be used. This is the part that most people get confused about. You would think that you need to set up the Markers on the effects themselves, but that isn't the case. Under the Weapon itself in the Data Editor, there is a field called [Effect - Markers]. THIS is where you need to set up your Markers, as this field will tell the ability to apply this marker to all the Effects used. So, simply edit the Effect - Markers field, and under Matches, enable ID. Now, the chain lightning skill will operate just like the Mutalisk weapon, and allow multiple instances of the ability to be cast by multiple units without any conflicts.
I would like to see a testmap for this. I didn't get this to work for ages, because markers for abilities do not seem to work the way you describe them, specifically for projectile - based bouncing spells like the Mutalisk weapon.
For weapons, it works, just like seen in the mutalisk weapon. But if you, for example, use the mutalisk weapon effects for an ability and set up the markers for the ability, it doesn't work.
In my own spells I have been using dummy behaviors to and validators to check to see if an effect has already been applied to a unit or not... How is using markers different?
What happens if you have 2 units to cast the spell on the same target around the same time?
Behavior: AlreadyBeenHit -> ABH
Validator: Doesn't Have ABH
Lets say you have a chain spell:
Unit 1 casts on 3 Cows. Cow1 takes 10damage gains ABH, Cow2 takes 10damage gains ABH and Cow3 takes 10damage gains ABH
Unit 2 casts .5 secs later on the same 3 Cows.
Cows takes no damage.
You could try to have the behavior removed or end a the right time, but too soon or too late and the skill hits Cow 1 again instead of cow 3 or caster 2 never hits cow 1. Up the amount of casters to 50 and the issues compound.
Markers can apply a unique ID based on the caster instead of a behavior this would allow 10 units to cast the same targets and all their attack to be treated the same and only bounce to each target once.
Alright folks, I poked around with the chain lightning on an ability, and as Kueken said, it doesn't work the same. However, through blind guessing, I somehow managed to get it to work. Please note though that whatever I thought I knew about Markers was blown out the airlock when I tried it on an ability. I will share what settings I used, and maybe when I get some more time I'll try to make sense of it.
So here goes:
Assuming the effects used are the same as that from the example I gave above, these are the changes I made. See the attached map for more info.
On the ability - Chain Lighting:
-Effect - Markers+ -
-For Match Flags, Enable Caster Unit
-For Mismatch Flags, Enable ID
-Effect - Markers Used - Remove all except Cast
For the Effects:
All Set Effects
-Add the Validator [No Markers]
-Effect - Markers+ (NOTE: For all the Effects, make sure the LINK is the same for every Marker)
-For Match Flags, Enable Caster Unit
-For Mismatch Flags, Enable ID
All Search Effects
-Search - Exclude - Outer and Target
I'm not entirely sure what the Match Flags and Mismatch Flags do to be perfectly honest. That was the part I sort of stumbled around in. The only other big change I made was specifying the Markers in the Set Effects, mimicking the same Match and Mismatch flags as the Ability itself.
if you could ......
Go into more detail regarding what a "marker is"
Go into more detail about how you add "markers" to units
Go into more detail regarding what can be done with the "marker validator"
Go into more detail regarding which effects should use the "marker validator"
Markers are something that all Effects can apply to a target to "mark" it as having been already used on that unit. How the specifics of these Markers work is still a bit beyond me, but basically if you use the No Marker validator on an effect, whenever a Marker is applied to a unit, the effect will validate whether the unit has already been marked (for the example of the chain lightning, if the unit has already been hit once), and if so, will NOT re-apply that effect on the unit again. For what reasons the Marker is applied to the Unit has to do with the Match and Mismatch Flags. What each flag does specifically is something that I'm still trying to figure out, but if we can, it could potently remove the need for behaviors in many abilities as a means to validate a unit as already having been effected.
The way you make a Marker apply through an effect, is to go to the Effect - Markers field on the effect and play around with the Match and Mismatch Fields.
Well, for your chain lightning, you can just enable the id - match marker for an initial persistent effect and use the no marker validator for each descending effect requiring it without the need of any other marker sets.
I was hoping, you actually found a way to use markers for bouncing missiles, because you mentioned the mutalisk weapon in your first post.
If you mean using a persistent in the set to make the Marker last longer, then yeah, but that's basically the behaviors method in a slightly different form.
Sorry for the false hope. I just figured it would work for Abilities as well, but I can't figure out any reason why it's not working. I'd put more time into it, but I have a ton of work to do on my team's map.