1) How to make special effect on the each N-th attack?
The one way i found: is making effect set which adds 1 stack to invisible buff with each attack and another effect set which checks amount of stacks, if stack-count evaluates N - then we removing all of them and performing this special effect. Sounds pretty complicated, but i don't sure if there a easier way.
2) How to make weapon swap effect?
For example i wanna to give my unit 2 different weapons: 1 basic and 1 special which can be used only once per 6 seconds.
Yeah I know - I can just set period for this special weapon to 6 secs. But I wanna that both of this weapons will be in one slot. And another issue - is broken animation when both attacks performed at one short period.
So at this moment I made it like this:
[-]Unitwithnoweapons,butwithBehavior_basic[+]Behavior_basic|--Weaponsadded:Weapon_basic|--Duration:6sec// it's period of basic weapon x 5// if i'll add this shit with stacking buffs to count attacks - it will be even more complicated =(|--Finaleffect:AddsBehavior_special[+]Behavior_special|--Weaponsadded:Weapon_special|--Duration:permanent|--Finaleffect:AddsBehavior_basic[+]Weapon_special|--Effect:Weapon_special_Effect_set[+]Weapon_special_Effect_set|--Effect1:RemoveBehavior_specialfromCaster|--Effect2:Dealingsplashdamage...etc.
Good news: this method works. Bad news: every time weapon swap performs - unit stops attacking, or changes target =(
And I don't sure bout performance: I mean it's basically just 1 weapon for my TD, and it consists from 2 weapons, 7 effects and 2 behaviors.
1. would have been my answer, i don't think you can do that easier, only with triggers.(save number of casts as custom value on the unit)
2. well you have all your answers. there is a modifiy unit effect, it is able to copy current commands of a unit(so you might copy attack unit x to the second weapon) but never tried it.
1) you can do this with your weapon "set" effect approach but it will be not unified solution, so if this will be some item or powerup which can be applied for any tower you will need to change all weapon's effects which is riddiculous. So you can make buff instead which can be applied to any unit.
-Open Damage Response field+ of this buff.
-Set Chance to 1
-Change Location + to Attacker
-Put in "Handled" Effect set effect with your logic (so you need to have few effects there, one will be adding buff on caster, second will be another set effect with validator which will check current number of behaviours on caster. In this second set effect you need to put 1) your special attack effect, 2) Effect which removes all buffs from caster and start new encounter)
Edit: You can also Increase Critical Chance by 100% with buff for each N-th attack, if you want to perform different animation, fire different missiles, or making anything which differs from basic attack. You can see it in my example map http://www.sc2mapster.com/forums/development/data/57360-critical-strike-in-2-0-10/. For increasing critical chance with buff open buff modification+ and switch to "None" tab.
2) to get rid of attack stoping issue try to check flag "shared cooldown" for your weapons. And check DrSuperEvil's Weapon Swap Example map you can found it in data asset forum "Assets of Evil"
Okay, i guess it's a set of 2 questions:
1) How to make special effect on the each N-th attack?
The one way i found: is making effect set which adds 1 stack to invisible buff with each attack and another effect set which checks amount of stacks, if stack-count evaluates N - then we removing all of them and performing this special effect. Sounds pretty complicated, but i don't sure if there a easier way.
2) How to make weapon swap effect?
For example i wanna to give my unit 2 different weapons: 1 basic and 1 special which can be used only once per 6 seconds.
Yeah I know - I can just set period for this special weapon to 6 secs. But I wanna that both of this weapons will be in one slot. And another issue - is broken animation when both attacks performed at one short period.
So at this moment I made it like this:
Good news: this method works. Bad news: every time weapon swap performs - unit stops attacking, or changes target =(
And I don't sure bout performance: I mean it's basically just 1 weapon for my TD, and it consists from 2 weapons, 7 effects and 2 behaviors.
I'll apreciate any help or advices.
@Markus_13: Go
1. would have been my answer, i don't think you can do that easier, only with triggers.(save number of casts as custom value on the unit)
2. well you have all your answers. there is a modifiy unit effect, it is able to copy current commands of a unit(so you might copy attack unit x to the second weapon) but never tried it.
Sorry but how?)) I mean which flags and parameters i need? These dont works:
@Markus_13: Go
to be honest i don't know. never needed it but it must be there for a reason. you have to use trial and error
1) you can do this with your weapon "set" effect approach but it will be not unified solution, so if this will be some item or powerup which can be applied for any tower you will need to change all weapon's effects which is riddiculous. So you can make buff instead which can be applied to any unit.
-Open Damage Response field+ of this buff.
-Set Chance to 1
-Change Location + to Attacker
-Put in "Handled" Effect set effect with your logic (so you need to have few effects there, one will be adding buff on caster, second will be another set effect with validator which will check current number of behaviours on caster. In this second set effect you need to put 1) your special attack effect, 2) Effect which removes all buffs from caster and start new encounter)
Edit: You can also Increase Critical Chance by 100% with buff for each N-th attack, if you want to perform different animation, fire different missiles, or making anything which differs from basic attack. You can see it in my example map http://www.sc2mapster.com/forums/development/data/57360-critical-strike-in-2-0-10/. For increasing critical chance with buff open buff modification+ and switch to "None" tab.
2) to get rid of attack stoping issue try to check flag "shared cooldown" for your weapons. And check DrSuperEvil's Weapon Swap Example map you can found it in data asset forum "Assets of Evil"
@abvdzh: Go
1) http://www.sc2mapster.com/forums/development/data/57360-critical-strike-in-2-0-10/. Lol, i already have this map on my PC, just hands did not reach to look into it =)
2) I found a big bunch of his maps there: http://www.sc2mapster.com/forums/resources/data-assets/46733-the-assets-of-evil/ Thx for pointing it.
np, the map you probably interested in calls "Weapon_Swap"