I'm trying to deny generic unit the ability to attack another group of generic units that have a certain buff. I can make the system work. If i add a validator to the weapon denying the attack, but I was wondering if there was a more generic way to implement this, either via behaviors or triggers.
It think there is an more easy way to do this. If you make a Behavior Buff and go to Modifications, then Behavior and search for the checkbox:"Suppress Combat" the enemy units shouldn't attack
bleh. I tried all the available options in there, didn't have any effect.
If you have ever played magic the gathering, I'm trying to induce some system where if a unit
has a buff flying, it can only be attacked by a unit with flying or reach.
I've been working on a validator that allows the unit to attack air units or ground units if it has "reach" or "flying".
Problem is I want to keep it as generic as possible so i can add other behaviors like protection and unblockable.
I tried it the way drsuperevil said and I couldn't get it to work, but I was able to get it to work with triggers and maybe now I can figure it out with validators or something.
Prevent Attacking Air
Events
Unit - Any Unit acquires a target
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
((Acquired Target) has Flying) == True
((Triggering unit) has Flying) == False
((Triggering unit) has Reach) == False
Then
Unit - Order (Triggering unit) to ( Move targeting ((Position of (Triggering unit)) offset by (0.0, 1.0))) (Before Existing Orders)
Else
I'm trying to deny generic unit the ability to attack another group of generic units that have a certain buff. I can make the system work. If i add a validator to the weapon denying the attack, but I was wondering if there was a more generic way to implement this, either via behaviors or triggers.
It think there is an more easy way to do this. If you make a Behavior Buff and go to Modifications, then Behavior and search for the checkbox:"Suppress Combat" the enemy units shouldn't attack
@patrickwobben: Go
bleh. I tried all the available options in there, didn't have any effect. If you have ever played magic the gathering, I'm trying to induce some system where if a unit has a buff flying, it can only be attacked by a unit with flying or reach.
I've been working on a validator that allows the unit to attack air units or ground units if it has "reach" or "flying". Problem is I want to keep it as generic as possible so i can add other behaviors like protection and unblockable.
Just add the invulnerability flag to your buff and make weapons able to target "Air" able to hit invulnerable.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
I tried it the way drsuperevil said and I couldn't get it to work, but I was able to get it to work with triggers and maybe now I can figure it out with validators or something.
Prevent Attacking Air
Events
Unit - Any Unit acquires a target
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
((Acquired Target) has Flying) == True
((Triggering unit) has Flying) == False
((Triggering unit) has Reach) == False
Then
Unit - Order (Triggering unit) to ( Move targeting ((Position of (Triggering unit)) offset by (0.0, 1.0))) (Before Existing Orders)
Else