I have a unit without any attack modes, but with an ability. I want it to try using that ability on a target upon right-clicking it (like normal units usually attack if you right-click an enemy unit). How would I do that?
I'm about to playtest with friends and then release my map, and this is one of the last features I need to add, so instant help would be highly appreciated. :)
Hmm. The Attack ability type doesn't contain any effects, cooldown or related features that my ability needs. :(
It's a modification of Domination. The ability type is "effect - target", soo...
I got it to work by making a Weapon that sets the effect instead of an Ability, however now the weapon keeps firing. How do I make a one-shot weapon that doesnt continue firing at the target after the deed has been done?
I want queues to work. So you can shift+rightclick multiple targets and they will be attacked in order. The way you suggest would still have the unit trying to attack the first target forever. :(
Problem solved, albeit with a crappy trigger-based fix.
Solution: Assign a weapon to your unit that applies the ability's Effect to the target and a temporary behavior (in my case "Stop Firing!") to the caster, then create a trigger like this to store, remove and then re-apply all of the unit's orders save for the "attack" one. That way your unit will instantly cease attacking, yet keep it's order queue intact.
Mind that the second For Each loop begins at 1, not 0. That is done to filter out the "Attack" order that was previously saved.
This is entirely possible without triggers, you simply need to check the "Smart" flag for the ability and then optionally add a Smart Validator that will validate the right-click target.
Hello!
I have a unit without any attack modes, but with an ability. I want it to try using that ability on a target upon right-clicking it (like normal units usually attack if you right-click an enemy unit). How would I do that?
I'm about to playtest with friends and then release my map, and this is one of the last features I need to add, so instant help would be highly appreciated. :)
I think "Attack" is also considered as an ability. In order to do that, you should definitivly check the attack ability parameters.
Hmm. The Attack ability type doesn't contain any effects, cooldown or related features that my ability needs. :( It's a modification of Domination. The ability type is "effect - target", soo...
I got it to work by making a Weapon that sets the effect instead of an Ability, however now the weapon keeps firing. How do I make a one-shot weapon that doesnt continue firing at the target after the deed has been done?
you can set the period to be very long?
I want queues to work. So you can shift+rightclick multiple targets and they will be attacked in order. The way you suggest would still have the unit trying to attack the first target forever. :(
Problem solved, albeit with a crappy trigger-based fix.
Solution: Assign a weapon to your unit that applies the ability's Effect to the target and a temporary behavior (in my case "Stop Firing!") to the caster, then create a trigger like this to store, remove and then re-apply all of the unit's orders save for the "attack" one. That way your unit will instantly cease attacking, yet keep it's order queue intact.
Mind that the second For Each loop begins at 1, not 0. That is done to filter out the "Attack" order that was previously saved.
Ignore the text message actions. :P
This is entirely possible without triggers, you simply need to check the "Smart" flag for the ability and then optionally add a Smart Validator that will validate the right-click target.
Damn! That worked flawlessly. Thank you very much!
I still find my trigger solution quite brainy, though. :) I will keep it in the comments somewhere!