Hey guys I can not seem to figure this one out, I need some help!
I currently have a trigger set up to add a Effect to unit that will make that unit spawn 5 hydralisks every 5 seconds, that trigger is:
Environment - Execute 'Spawn Hydralisks' on 'Hydralisk Den' from player 1
The first ' ' is my effect and the second ' ' is the unit it's adding the effect too. This works with no problem, works just as intended.
However, now what I am wanting to do, is that when it spawns those 5 hydralisks, to then tell those 5 hydralisks to attack a command center, however if those hydralisks run into any enemies on the way, say a Marine, they will stop to attack the marine then carry on toward the command center, I want to issue a Attack order on the command center and have them attack any enemies they encounter.
I have tried playing around with the triggers but can't seem to find something that works.
well, you could spawn them via triggers (Create Units) and then just use Issue Order to Unit group and use Last Created Unit Group
Or you can use a trigger with the event "Any Unit is Created" and use a condition to check whether its a hydralisk
You could also create a dummy effect (An empty "Set" effect or something) and put it as the "Spawn Effect" field in the "Create Unit Effect", then have a trigger use that effect as an event and issue an order to the Target of the effect
If there's only one enemy command center in the game, you could create a validator in data that checks whether target unit is a command center, create an Issue Order effect that uses that validator and issues an attack order (and targets the point. You might have to put something like a set effect in between to use the vaidator instead because the validator might be checking a point if you put it directly onto this effect, which obviously won't work), then add a search effect as the Spawn Effect of the effect that creates the hydras, have that search effect search the entire map for units (Use filters to make it a bit more efficient, validator will take care of actually targetting the command center) and uses the issue order effect (Or whatever effect you put inbetween)
In any case, make sure that the order you issue targets a point, not a unit (In triggers you can use "Position of Unit" in a point paramater), that way the units will attack anything that crosses their path.
I actually forgot to mention in my main post that there are actually multiple buildings spawning different units and I need all those units to attack a structure.
So what I ended up doing, I am not sure if this is the best or most effective way to do this, but I created a new trigger and did this: Events
Unit - Any Unit creates a unit with ability Any or behavior Any Local Variables Conditions
(Owner of (Triggering unit)) == 15 Actions
Unit - Order (Created Unit) to (Attack targeting 'Attacking Point') (Replace Existing Orders)
Thanks for the reply as it helped me figure out how to set up the above trigger, now I don't know if that's the best way to do that but it works.
Hey guys I can not seem to figure this one out, I need some help!
I currently have a trigger set up to add a Effect to unit that will make that unit spawn 5 hydralisks every 5 seconds, that trigger is: Environment - Execute 'Spawn Hydralisks' on 'Hydralisk Den' from player 1
The first ' ' is my effect and the second ' ' is the unit it's adding the effect too. This works with no problem, works just as intended.
However, now what I am wanting to do, is that when it spawns those 5 hydralisks, to then tell those 5 hydralisks to attack a command center, however if those hydralisks run into any enemies on the way, say a Marine, they will stop to attack the marine then carry on toward the command center, I want to issue a Attack order on the command center and have them attack any enemies they encounter.
I have tried playing around with the triggers but can't seem to find something that works.
Thanks for the help!
well, you could spawn them via triggers (Create Units) and then just use Issue Order to Unit group and use Last Created Unit Group
Or you can use a trigger with the event "Any Unit is Created" and use a condition to check whether its a hydralisk
You could also create a dummy effect (An empty "Set" effect or something) and put it as the "Spawn Effect" field in the "Create Unit Effect", then have a trigger use that effect as an event and issue an order to the Target of the effect
If there's only one enemy command center in the game, you could create a validator in data that checks whether target unit is a command center, create an Issue Order effect that uses that validator and issues an attack order (and targets the point. You might have to put something like a set effect in between to use the vaidator instead because the validator might be checking a point if you put it directly onto this effect, which obviously won't work), then add a search effect as the Spawn Effect of the effect that creates the hydras, have that search effect search the entire map for units (Use filters to make it a bit more efficient, validator will take care of actually targetting the command center) and uses the issue order effect (Or whatever effect you put inbetween)
In any case, make sure that the order you issue targets a point, not a unit (In triggers you can use "Position of Unit" in a point paramater), that way the units will attack anything that crosses their path.
I actually forgot to mention in my main post that there are actually multiple buildings spawning different units and I need all those units to attack a structure.
So what I ended up doing, I am not sure if this is the best or most effective way to do this, but I created a new trigger and did this:
Events
Unit - Any Unit creates a unit with ability Any or behavior Any
Local Variables
Conditions
(Owner of (Triggering unit)) == 15
Actions
Unit - Order (Created Unit) to (Attack targeting 'Attacking Point') (Replace Existing Orders)
Thanks for the reply as it helped me figure out how to set up the above trigger, now I don't know if that's the best way to do that but it works.
it works, and its defiantly not bad and cause no lag.
however u may want to add that unit to a player 15 unit group so u can control the enemy better