So I've got a unit with a weapon that creates Create Persistent effect, which in turn creates four different Damage effects, one after the other. In-game this plays out like the unit is launching a salvo of shots from different hardpoints, then reloading before firing another salvo. There are some units that I want it to kill in one shot, but when it does so, the Create Persistent effect ends immediately and doesn't create the other three Damage effects. So the weapon fires one shot, then waits for the entire length of its cooldown before firing another single shot.
What I want it to do is be able to switch to a new target if the first one dies, so that it can fire a full salvo of four shots before reloading instead of just one. I can get it to fire a full salvo, but each impact effect after the first one appears at the point where the original target was, even after it died. I can't seem to get it to switch to a new target unit for the next Damage effect.
The weapon itself has "Can Retarget While Channeling" option enabled, but it doesn't seem to do much. I noticed that the Location field for the Create Persistent effect was set to "Target Unit/Point", so I tried changing this. Setting it to Target Unit just made it go back to its original behavior. Setting it to Source Unit made the Damage effects hit the unit using the weapon.
Anyone know what combination of options will make this weapon behave the way I want?
Try applying a Search Area effect between your persistant effect and launch missile/damage effect, that way each missile will be able to seach for a different target should the original unit die.
Also try the Retarget flag under the launch missile effect. Leviathans air attack does this, is that the sort of effect you want?
There's no Launch Missile effect involved; it's an instant-hit weapon. But I suppose I can still try a Search Area anyway.
If all else fails, I think I've come up with a complicated scheme that involves four seperate weapons for each hardpoint, each of which applies a behavior to the unit when it fires that enables the next one in sequence. The combination of Effects applying Behaviors and Behaviors launching Effects can be quite versatile, I've found.
You could use a search effect located at the target unit, with Target Sort: TSDistance and maximum number of targets: 1.
This way, the target is always the preferred target, because it will be always the closest to itself, but if the main target is dead and you exclude dead units from the search, it will pick the closest enemy around.
Missiles are wonderful things, even battlecruisers use them for their projectiles. I am sure a persistant, search area, launch missile and damage effect would be less complex than your series of behaviours.
Still, just look at how leviathans attacks retarget from a visual perspective.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
You could use a search effect located at the target unit, with Target Sort: TSDistance and maximum number of targets: 1.
This way, the target is always the preferred target, because it will be always the closest to itself, but if the main target is dead and you exclude dead units from the search, it will pick the closest enemy around.
...except I've got another weapon that *already* employs Search Area and Persistent effects to launch missiles, and it suffers from the exact same problem. It's even based on the battlecruiser's lasers, too. Picks 3-4 different targets, fires a barrage of 3-5 shots at each, pauses a moment, then fires another barrage. But if the shots kill the initial target, the whole salvo gets cut short, including the shots targeted at other units.
Right now that one's going Weapon -> Persistent -> Search Area -> Launch Missile -> Damage. I tried doing it Weapon -> Search Area -> Create Persistent -> Launch Missile at first, but it wouldn't fire. Just sat there. Looking at it again now, maybe I should be fiddling with the location and target points?
You could use a search effect located at the target unit, with Target Sort: TSDistance and maximum number of targets: 1.
This way, the target is always the preferred target, because it will be always the closest to itself, but if the main target is dead and you exclude dead units from the search, it will pick the closest enemy around.
Hmm. If I restrict the arc on the search effect, will it reckon that from the target point? Or from the attacking unit? Because this thing's supposed to have a narrow cone of fire in front of the unit, and I don't want the shots wandering off to the side too much...
So I've got a unit with a weapon that creates Create Persistent effect, which in turn creates four different Damage effects, one after the other. In-game this plays out like the unit is launching a salvo of shots from different hardpoints, then reloading before firing another salvo. There are some units that I want it to kill in one shot, but when it does so, the Create Persistent effect ends immediately and doesn't create the other three Damage effects. So the weapon fires one shot, then waits for the entire length of its cooldown before firing another single shot.
What I want it to do is be able to switch to a new target if the first one dies, so that it can fire a full salvo of four shots before reloading instead of just one. I can get it to fire a full salvo, but each impact effect after the first one appears at the point where the original target was, even after it died. I can't seem to get it to switch to a new target unit for the next Damage effect.
The weapon itself has "Can Retarget While Channeling" option enabled, but it doesn't seem to do much. I noticed that the Location field for the Create Persistent effect was set to "Target Unit/Point", so I tried changing this. Setting it to Target Unit just made it go back to its original behavior. Setting it to Source Unit made the Damage effects hit the unit using the weapon.
Anyone know what combination of options will make this weapon behave the way I want?
Try applying a Search Area effect between your persistant effect and launch missile/damage effect, that way each missile will be able to seach for a different target should the original unit die.
Also try the Retarget flag under the launch missile effect. Leviathans air attack does this, is that the sort of effect you want?
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
There's no Launch Missile effect involved; it's an instant-hit weapon. But I suppose I can still try a Search Area anyway.
If all else fails, I think I've come up with a complicated scheme that involves four seperate weapons for each hardpoint, each of which applies a behavior to the unit when it fires that enables the next one in sequence. The combination of Effects applying Behaviors and Behaviors launching Effects can be quite versatile, I've found.
You could use a search effect located at the target unit, with Target Sort: TSDistance and maximum number of targets: 1.
This way, the target is always the preferred target, because it will be always the closest to itself, but if the main target is dead and you exclude dead units from the search, it will pick the closest enemy around.
Missiles are wonderful things, even battlecruisers use them for their projectiles. I am sure a persistant, search area, launch missile and damage effect would be less complex than your series of behaviours.
Still, just look at how leviathans attacks retarget from a visual perspective.
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
...except I've got another weapon that *already* employs Search Area and Persistent effects to launch missiles, and it suffers from the exact same problem. It's even based on the battlecruiser's lasers, too. Picks 3-4 different targets, fires a barrage of 3-5 shots at each, pauses a moment, then fires another barrage. But if the shots kill the initial target, the whole salvo gets cut short, including the shots targeted at other units.
Right now that one's going Weapon -> Persistent -> Search Area -> Launch Missile -> Damage. I tried doing it Weapon -> Search Area -> Create Persistent -> Launch Missile at first, but it wouldn't fire. Just sat there. Looking at it again now, maybe I should be fiddling with the location and target points?
Hmm. If I restrict the arc on the search effect, will it reckon that from the target point? Or from the attacking unit? Because this thing's supposed to have a narrow cone of fire in front of the unit, and I don't want the shots wandering off to the side too much...