Every time a unit attacks, it spawns a missile. The missile should then attack the target of the unit that spawned the missile.
Here's where my problem lies:
The "issue order" effect doesn't work. Nothing happens. I think the problem is that the effect can't link to the spawning unit's attack target. Using triggers to accomplish this is problematic because there are going to be many spawning units on the map at any given time and many different kinds of targets.
This is one of the most annoying limitations of the data editor. There is no way to tell one unit to attack another unit's target outside of a launch missile effect (which I assume won't work in this case for whatever reason).
Trigger solution: dummy damage effects
Event:
Unit takes damage from (insert spawn unit effect)
Actions:
Create unit at (insert point) you can get creative with this, such as location of (damaging unit) with an offset
Order (last created unit) to (attack) targeting (triggering unit)
I have one particular ability in my current project that has THREE different damage effects for triggers at different stages of the ability... it's ridiculous and wouldn't be necessary if this sort of thing existed in the data editor.
Thanks. I actually did it a bit differently but your way seems plausible enough. I wish I could do it without triggers but I guess I'll have to live with it.
What I did was have the weapon create a spawn unit behavior. Then I could use the event Unit Is Created and tie actions to both the attacking unit and that unit's target.
So... you want the Attacking Unit(Marine) to spawn a missile, and the missile to attack the Marine's target?
And... Actually you CAN order another unit to attack another unit's target. It's all in how you link up the effects in the Impact Location+, Location +, Impact Unit+ field. I'm sure there are a few more fields you could tie this in to.
OK so, here's the basics, I'm gonna use the example of a marine firing his regular gun(no missile, just damage), which also spawns a missile independently that then attacks the marine's target.
Effect - Issue Order Ability - Ability Attack Effect - Player + (None):Target Target - Target + Marine - Guass Rifle (Damage):Target Unit Unit - Unit + Apply Dummy Buff:Target
Setup a Dummy Buff(Apply Behavior effect) that is applied to the missile, you apply this dummy buff through the create unit effect's Effect - Effect - Spawn field.
As long as your create unit/missile effect's Effect - Effect - Spawn field is set to dummy buff your unit/missile
your damage effect's(or whatever) Target - Impact Location + is set to Target Unit or Target Unit/Point
the Unit+ field of the Issue order sends the order to the missile(the target of the dummy buff aka newly created missile)
the Target+ field makes the target of the Damage effect the target of the issue order
There are other ways to tweak this, experimenting is the key.
like if you changed Target - Target+ from Marine - Guass Rifle (Damage):Target Unit to Marine - Guass Rifle (Damage): Source Unit, the missile would then attack the SOURCE of the Damage effect, which would be the marine.
There ya go. If you take a look at the WDE #14 thread, I just posted a video of the Nuke Tower. In it, I have the Spawned unit ordering it's Caster Unit to launch a nuke at the Spawned Unit anytime there's a moving enemy nearby, using the above mentioned method. Feel free to take a look at the file.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Alright, here's what I want to do:
Every time a unit attacks, it spawns a missile. The missile should then attack the target of the unit that spawned the missile.
Here's where my problem lies:
The "issue order" effect doesn't work. Nothing happens. I think the problem is that the effect can't link to the spawning unit's attack target. Using triggers to accomplish this is problematic because there are going to be many spawning units on the map at any given time and many different kinds of targets.
Can anyone help me with this? o.o
This is one of the most annoying limitations of the data editor. There is no way to tell one unit to attack another unit's target outside of a launch missile effect (which I assume won't work in this case for whatever reason).
Trigger solution: dummy damage effects
Event:
Unit takes damage from (insert spawn unit effect)
Actions:
Create unit at (insert point) you can get creative with this, such as location of (damaging unit) with an offset Order (last created unit) to (attack) targeting (triggering unit)
I have one particular ability in my current project that has THREE different damage effects for triggers at different stages of the ability... it's ridiculous and wouldn't be necessary if this sort of thing existed in the data editor.
Thanks. I actually did it a bit differently but your way seems plausible enough. I wish I could do it without triggers but I guess I'll have to live with it.
What I did was have the weapon create a spawn unit behavior. Then I could use the event Unit Is Created and tie actions to both the attacking unit and that unit's target.
So... you want the Attacking Unit(Marine) to spawn a missile, and the missile to attack the Marine's target?
And... Actually you CAN order another unit to attack another unit's target. It's all in how you link up the effects in the Impact Location+, Location +, Impact Unit+ field. I'm sure there are a few more fields you could tie this in to.
OK so, here's the basics, I'm gonna use the example of a marine firing his regular gun(no missile, just damage), which also spawns a missile independently that then attacks the marine's target.
Effect - Issue Order
Ability - Ability Attack
Effect - Player + (None):Target
Target - Target + Marine - Guass Rifle (Damage):Target Unit
Unit - Unit + Apply Dummy Buff:Target
Setup a Dummy Buff(Apply Behavior effect) that is applied to the missile, you apply this dummy buff through the create unit effect's Effect - Effect - Spawn field.
There are other ways to tweak this, experimenting is the key.
like if you changed Target - Target+ from Marine - Guass Rifle (Damage):Target Unit to Marine - Guass Rifle (Damage): Source Unit, the missile would then attack the SOURCE of the Damage effect, which would be the marine.
There ya go. If you take a look at the WDE #14 thread, I just posted a video of the Nuke Tower. In it, I have the Spawned unit ordering it's Caster Unit to launch a nuke at the Spawned Unit anytime there's a moving enemy nearby, using the above mentioned method. Feel free to take a look at the file.