I want to create a chain lightning ability. This means an ability which targets 1 unit firing a beam towards it, then chains it towards another unit, and so on, a set amount of times. I want to be able to upgrade it increasing the number og bounces.
What is the most efficient way to do this, both speaking of performance, but also quality of life?
Would that be triggers, or can I do something like counting buffs on the caster with a validator (along those lines).
you cannot change a validator dynamically, so upgrading the ability won't change the counter of the validator.
You might test something for me (lol), try to use a player requirement validator and check if you can validate the ability level. if yes you can easily make an formula with the counter buff and ability level here. so every bounce will add one buff to caster, check validator, if valid, search next target, and so on.
I have been using triggers for the upgrade part of my abilities, only creating 1 level for the ability, and then change the upgraded fields of the ability with a "Set Catalogue Field Value" action. I suppose I could change the validator with that aswell?
I probably wont be creating it tonight, as I'm only considering starting up again after a long break from the editor. (Considering there's an expansion around the corner, I might not pick it up just yet)
last time i tried i couldn't swap the validator, it's also not possible to modify the validator itself. the player requirement validator is your best choice (didn't always work for me for reasons i dont know). you can have at least a formula based on behaviours and upgrades (could be used instead of catalog triggers).
Have you checked how the Mutalisk attack works? It chains to 3 different targets. If your problem is only with the upgrading part and you know how to do the rest, then maybe a switch effect, checking for the different possible validators depending on the levels of your ability, is a best option.
Of course if you plan on having more than 5 levels then that solution isn't "quality of life" at all.
triggers for EZ life, if you want data solution it will be pain and agony if you don't understand effect scopes. You can make it same way as kerrigan attack from campaign (ez) if there are less than 7-10 jumps. If you want it to be expandable to 20-30 & infinite i can advise the aproach with invisible dummy unit.
You can make so the actual caster of each new chain will be invisible unit which will store the max amount of jumps in stacking buff as well as next beam's current start point (actor reference), Also you can make so the chain visualy will start from the source unit even though it will be launched from this invisible dummy. In this case you can utilize only one action actor and damage effect if youre pro with data.