Now the problem is, if the hero of player 1 goes into a bunker or a vehicle, the Zerglings can't attack the hero since he is not there.
So, the Zerglings just stand at their spawn-point.
Anyone know how to change the trigger so it works?
P.S. couldn't copy the original triggers, since I use the German editor -.-
Add a "Pick each unit" to get every bunker on your map. (after step #2)
Add an If Then Else statement to get the units in cargo (bunkers and any transport are cargos)
If it finds a hero for player 1 in any of the picked bunkers/cargos, then order the zerglings to attack the picked bunker/cargo.
If it doesn't, do step #3
It's only theorical but it seems totally doable. The key to your problem is to find a target through the "units in cargo" condition, and send the zergs against the cargo (bunker) itself if there is a hero inside. If there is no hero hidden in a bunker, it will just check for any hero on the map. The huge flaw in this is: if the hero gets out of the bunker, the zerglings will still attack the bunker. So you will need to check often where the hero is, if you want them to update their attack order as soon as he moves...
I assume the "hero" of your step 3 is a variable of type unit.
Replace it by a global variable "Current Unit To Attack", while keeping your variable "Hero" somewhere.
Then use a trigger with the event 'unit load/unload cargo' and check if it is your "Hero" being loaded, and in this case set the "Current Unit To Attack" as being the bunker.
Then add another trigger for the unloading, check if it's your hero being unloaded, and in this case set the "Current Unit To Attack" as being the "Hero". And make the "Zergling group" attack the "Current Unit To Attack", to redirect them on the hero.
This should do what you want while being simple to implement.
Yeah this looks a bit easier to make, since I just change the variable that gets attacked by the Zerglings.
The other thing would be to let the Zerglings attack the last Position of the Hero.
Does the editor mark the position of a hero if he is in a Bunker or is the unit for the trigger editor invisible at the moment?
Hi,
I got a trigger which does basicly this:
Now the problem is, if the hero of player 1 goes into a bunker or a vehicle, the Zerglings can't attack the hero since he is not there.
So, the Zerglings just stand at their spawn-point.
Anyone know how to change the trigger so it works?
P.S. couldn't copy the original triggers, since I use the German editor -.-
Add a "Pick each unit" to get every bunker on your map. (after step #2)
Add an If Then Else statement to get the units in cargo (bunkers and any transport are cargos)
If it finds a hero for player 1 in any of the picked bunkers/cargos, then order the zerglings to attack the picked bunker/cargo.
If it doesn't, do step #3
It's only theorical but it seems totally doable. The key to your problem is to find a target through the "units in cargo" condition, and send the zergs against the cargo (bunker) itself if there is a hero inside. If there is no hero hidden in a bunker, it will just check for any hero on the map. The huge flaw in this is: if the hero gets out of the bunker, the zerglings will still attack the bunker. So you will need to check often where the hero is, if you want them to update their attack order as soon as he moves...
Ok, thanks for all the tips.
This looks fucking complicated but I will try different things.
-h34dl4g
you could aways order them to attack a point instead of hero so they will attack closest target (attack move)
@h34dl4g: Go
I assume the "hero" of your step 3 is a variable of type unit.
Replace it by a global variable "Current Unit To Attack", while keeping your variable "Hero" somewhere.
Then use a trigger with the event 'unit load/unload cargo' and check if it is your "Hero" being loaded, and in this case set the "Current Unit To Attack" as being the bunker.
Then add another trigger for the unloading, check if it's your hero being unloaded, and in this case set the "Current Unit To Attack" as being the "Hero". And make the "Zergling group" attack the "Current Unit To Attack", to redirect them on the hero.
This should do what you want while being simple to implement.
@Moooyaah: Go
Yeah this looks a bit easier to make, since I just change the variable that gets attacked by the Zerglings.
The other thing would be to let the Zerglings attack the last Position of the Hero.
Does the editor mark the position of a hero if he is in a Bunker or is the unit for the trigger editor invisible at the moment?
-h34dl4g
Moooyaah's suggestion seems good. But you may want to use a unit group instead of just one unit variable.
@h34dl4g: Go
ups, forgot to answer! I just checked in a test map, it appears the position of a unit is valid wherever it is, even inside a bunker. Hope that helps!
@Moooyaah: Go
Thanks for the advice even if i checked it already.
I changed my trigger for Hero position, now it works fine, thanks anyway.
@h34dl4g: Go
No problems, I'm always glad to help out a solved issue :D Good luck with your map anyway !