I've to make a working shield system for my map (you find the project in my account), but it's not that easy. I explain you the solutions I've found and why I dont like them.
1 - An hidden shield generator at the center of the ship. Via triggers, if it has a certain amount of shields all the space weapons attack it. This solution is pretty nice but it has a big big problem: The shield can regenerate when the missile is still coming (and attacking a different target), it regenerates but the missile hits another target.
2 - The shield generator of this map, the problem there is that it works fine when it is a perfect sphere, but if I change the proportions (a ship is not a square) it works very bad due to the fact that you can't make an oval search behavior (or you can?).
3 - This solution would be the best one but I've no idea how to make the missile change the target middle air. So, when the missile is attacking the target, if the shield is regenerated the missile will change target and attack it. Someone has an idea if is this possible?
1) I believe you can make your missiles hit the first target encountered (maybe ballistic mover setting? not quite sure how to set this up) and set the shield's hit detect radius greater than the ship's. This is assuming the shield is its own unit. You can then also change the shield proportions independent of the ship. Once you get the missiles intercepted by the first target hit it's merely a matter of either creating/destroying the shield when it is up/down or setting it to become untargetable with no collision while down.
2) You can try using multiple smaller shields to approximate an oval. 3 set up like oOo with a slight overlap may be sufficient.
Edit - Only 1 shield would be visible, stretched to the proportions you want. The other shields are just there to approximate an oval hitbox.
3) The Shield Generator map uses a Redirect Missile effect to force missiles to hit it. It periodically does this search when the shield is up. Is it not working on missiles mid-air? I thought that's how Redirect Missile worked, so I'm not sure.
You can also look at your units Launch Missile effect. With method 1 you can also give them a retarget range and turn on the retarget flag, which should allow them to retarget enemies as it moves. You can then set a filter for retargetting to have it only retarget shields. I don't believe you can put a validator for this, but you can use unit types - you can make your shields type Summoned or whatever and have the missiles only retarget Summoned units.
The #3 option works, but only with a perfect sphere. If I give the shield generator an oval shape there are many unhappy results (the missile enters in the shield, then comes back and hit it xD )
For #1 I've no idea how to do that, I'm noob with this part of the editor. I don't like the #2 solution tho.
p.s.: There is a flag in missile launch "change target" but I dont't get how to make it work, I modifiend the "change target" filters and radius but nothing.
Option 3 will work with triggers and allow for a perfect oval (oval mathematics required). Just remember to only redirect them once (as redirecting each frame could mess up their movement).
As ImperialGood states, they may be redirecting multiple times which could mess up their movement. No idea if that's what's going on there though.
- You can use markers to only redirect once, or have the redirect also apply a short buff and validate that the unit doesn't have a buff applied - effectively using a custom marker. Markers would probably be best though.
I'm not sure if there's a good built in way to set target priorities, but you could try validating that there is no "better" target nearby.
If you want to try this, you can set it up like:
effectively saying EITHER the target is a shield OR there is no shield nearby.
For the Is_Shield_Validator, you can enter all the unit types into a COMBINE set to OR, check for a buff you give all shield units, or something else probably more efficient.
Edit: I imagine you'd only want to redirect to shields. So the above may be unecessary - just validate that it only retargets to shields.
It should be the shield checking for missiles to redirect to itself, or the missile checking for shields to redirect to.
Either way you should be able to just set the search area range fairly short (just before the missile hits) and just validate that the redirect target is a shield.
I added the "enormous" filter on the shield generator and set the change target filter "enormous" -> "requested", then via triggers when the missile enters in a close region, all others units become not valid for the weapon except the shield generator, but instead of changing target the missile just disappears middle air.
(This is just for testing if it works) When the missile arrives near the shield, all the units in the area (except the shield) get 2 points of energy. The weapon is set to not attack units with energy.
You should use a Redirect Missile effect instead. I think the missile-effect retargeting is primarily for if a missile's target dies mid-flight and probably will be error-prone if you use it to try to redirect missiles to a specific target. 50 range is ridiculously large too.
Look at the Shield Generator map for an example.
You can create a behavior (Buff - "Retarget Shields") and give it a periodic Search Area effect, then place this on the shield generator (or missile, if you swap the target and caster). Give the Search Area effect a Redirect Missile effect, validating that only missiles you want to hit the shield are redirected only to the shield.
If you set it up for the shield, essentially you are having the shield periodically search for nearby missiles. When it finds one, the shield (through a Redirect Missile effect) changes the missiles target to the shield..
Well finally I managed to find a solution but... it's not good :(
I explain the situation in wich everything got messed up:
1 - The missile is fired
2 - When it arrives, it finds the shield down and proceeds to hit the target
3 - The shield is up again
4 - The missile goes bacfk and hits the shield
There is the representative image
Reading back, the best solution would be the #1
I found this map (I put that in attachment, check the yamato spell on the zealot). That spell is perfect, the only problem there is that it does ignore the shields and impact directly on the unit.
So, in the end, the best solutions are:
1 - Missile impacts on the first target.
2 - Use the spell in that map making it impacting on the first target (shield included).
Any idea how to implement one of these? Thankz.
Hi guys,
I've to make a working shield system for my map (you find the project in my account), but it's not that easy. I explain you the solutions I've found and why I dont like them.
1 - An hidden shield generator at the center of the ship. Via triggers, if it has a certain amount of shields all the space weapons attack it. This solution is pretty nice but it has a big big problem: The shield can regenerate when the missile is still coming (and attacking a different target), it regenerates but the missile hits another target.
2 - The shield generator of this map, the problem there is that it works fine when it is a perfect sphere, but if I change the proportions (a ship is not a square) it works very bad due to the fact that you can't make an oval search behavior (or you can?).
http://www.sc2mapster.com/media/attachments/39/860/Shield_Generator.SC2Map
3 - This solution would be the best one but I've no idea how to make the missile change the target middle air. So, when the missile is attacking the target, if the shield is regenerated the missile will change target and attack it. Someone has an idea if is this possible?
Concept:
1) I believe you can make your missiles hit the first target encountered (maybe ballistic mover setting? not quite sure how to set this up) and set the shield's hit detect radius greater than the ship's. This is assuming the shield is its own unit. You can then also change the shield proportions independent of the ship. Once you get the missiles intercepted by the first target hit it's merely a matter of either creating/destroying the shield when it is up/down or setting it to become untargetable with no collision while down.
2) You can try using multiple smaller shields to approximate an oval. 3 set up like oOo with a slight overlap may be sufficient.
Edit - Only 1 shield would be visible, stretched to the proportions you want. The other shields are just there to approximate an oval hitbox.
3) The Shield Generator map uses a Redirect Missile effect to force missiles to hit it. It periodically does this search when the shield is up. Is it not working on missiles mid-air? I thought that's how Redirect Missile worked, so I'm not sure.
You can also look at your units Launch Missile effect. With method 1 you can also give them a retarget range and turn on the retarget flag, which should allow them to retarget enemies as it moves. You can then set a filter for retargetting to have it only retarget shields. I don't believe you can put a validator for this, but you can use unit types - you can make your shields type Summoned or whatever and have the missiles only retarget Summoned units.
@Stompppp: Go
The #3 option works, but only with a perfect sphere. If I give the shield generator an oval shape there are many unhappy results (the missile enters in the shield, then comes back and hit it xD )
For #1 I've no idea how to do that, I'm noob with this part of the editor. I don't like the #2 solution tho. p.s.: There is a flag in missile launch "change target" but I dont't get how to make it work, I modifiend the "change target" filters and radius but nothing.
Wait I did it, but the missiles are very slow now, why? :| And can I give more priority to the "change target" behavior than on the original target?
Option 3 will work with triggers and allow for a perfect oval (oval mathematics required). Just remember to only redirect them once (as redirecting each frame could mess up their movement).
@nostradamus1915: Go
As ImperialGood states, they may be redirecting multiple times which could mess up their movement. No idea if that's what's going on there though.
- You can use markers to only redirect once, or have the redirect also apply a short buff and validate that the unit doesn't have a buff applied - effectively using a custom marker. Markers would probably be best though.
I'm not sure if there's a good built in way to set target priorities, but you could try validating that there is no "better" target nearby. If you want to try this, you can set it up like:
Combine { [Enumerate_Area ( Is_Shield_Validator count = 0 ) ] OR [Is_Shield_Validator = true] }
effectively saying EITHER the target is a shield OR there is no shield nearby.
For the Is_Shield_Validator, you can enter all the unit types into a COMBINE set to OR, check for a buff you give all shield units, or something else probably more efficient.
Edit: I imagine you'd only want to redirect to shields. So the above may be unecessary - just validate that it only retargets to shields.
It should be the shield checking for missiles to redirect to itself, or the missile checking for shields to redirect to. Either way you should be able to just set the search area range fairly short (just before the missile hits) and just validate that the redirect target is a shield.
@Stompppp: Go
I added the "enormous" filter on the shield generator and set the change target filter "enormous" -> "requested", then via triggers when the missile enters in a close region, all others units become not valid for the weapon except the shield generator, but instead of changing target the missile just disappears middle air.
@ImperialGood: Go
How can I change missile target with a trigger?
@nostradamus1915: Go
Not sure how you have it set up. Maybe it's disappearing because it can't find a new target?
What do you mean by "all other units become not valid"? And what kinda triggers are you using? You can do redirecting like that without triggers.
Are you using a Redirect Missile effect?
@Stompppp: Go
I show you how I set the weapon
(This is just for testing if it works) When the missile arrives near the shield, all the units in the area (except the shield) get 2 points of energy. The weapon is set to not attack units with energy.
You should use a Redirect Missile effect instead. I think the missile-effect retargeting is primarily for if a missile's target dies mid-flight and probably will be error-prone if you use it to try to redirect missiles to a specific target. 50 range is ridiculously large too.
Look at the Shield Generator map for an example.
You can create a behavior (Buff - "Retarget Shields") and give it a periodic Search Area effect, then place this on the shield generator (or missile, if you swap the target and caster). Give the Search Area effect a Redirect Missile effect, validating that only missiles you want to hit the shield are redirected only to the shield.
If you set it up for the shield, essentially you are having the shield periodically search for nearby missiles. When it finds one, the shield (through a Redirect Missile effect) changes the missiles target to the shield..
@Stompppp: Go
Is the Redirect Shield already existent in the editor or have I to create it?
Well finally I managed to find a solution but... it's not good :(
I explain the situation in wich everything got messed up:
1 - The missile is fired
2 - When it arrives, it finds the shield down and proceeds to hit the target
3 - The shield is up again
4 - The missile goes bacfk and hits the shield
There is the representative image
Reading back, the best solution would be the #1
I found this map (I put that in attachment, check the yamato spell on the zealot). That spell is perfect, the only problem there is that it does ignore the shields and impact directly on the unit.
So, in the end, the best solutions are:
1 - Missile impacts on the first target.
2 - Use the spell in that map making it impacting on the first target (shield included).
Any idea how to implement one of these? Thankz.