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
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'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.
Really? DrSuperEvil's first method would be a lot more reliable...
Ya but i already know how to use the trigger editor. Most of the abilities I'm trying to implement would be easy to do in the trigger editor.
This is just for the sake of learning.
Ehh, I dunno, that'd be pretty hard to do in the data editor. You could just make a trigger that dealt damage to the target unit equal to the attack damage of the attacking unit.
Otherwise if you insist on making this with the data editor I would probably do something with giving the unit a behavior that increases attack speed by a large amount and gets removed by the victim unit when it is attacked.
I think this works best for what I'm trying to achieve.
set your unit to a global variable i.e. "set Variable(Variable Name) = marine", then change the action to Attach Region0001 to (Variable Name).
Its a good technique to do this as you want to be able to reference your variables generally in more then one function.
Also what I prefer to do to test where the region is at is use a pan camera action.
Such as...
Unit - Any Unit Enters (Entire map)
Local Variables -
Conditions -
Actions -
Region - Attach Region001 to (Variable Name) with offset (Point(0.0, 0.0))
Camera - Pan the camera for player (Triggering player) to (Position of (Variable Name) over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
0
@lolzguy: Go
you probably need to be more specific.
0
Make a pylon - power source (ally) behavior and when the pylon enters the battlefield add that behavior to the pylon
0
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
0
@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.
0
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.
0
Ya but i already know how to use the trigger editor. Most of the abilities I'm trying to implement would be easy to do in the trigger editor. This is just for the sake of learning.
0
I think this works best for what I'm trying to achieve.
0
I'm having trouble getting an effect to trigger a generic extra attack, with behaviors or triggers. Anyone have any ideas on how to do this?
0
This is sort of funny I was already working on a map like this.
0
set your unit to a global variable i.e. "set Variable(Variable Name) = marine", then change the action to Attach Region0001 to (Variable Name). Its a good technique to do this as you want to be able to reference your variables generally in more then one function.
Also what I prefer to do to test where the region is at is use a pan camera action.
Such as... Unit - Any Unit Enters (Entire map)
Local Variables -
Conditions -
Actions - Region - Attach Region001 to (Variable Name) with offset (Point(0.0, 0.0)) Camera - Pan the camera for player (Triggering player) to (Position of (Variable Name) over 0.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning