You're using the Add Escort UnitType To Attack Wave. Whe you add a unit type to an attack wave the AI tries to build a unit of that type and then add it (exactly the same as the Add Attack Wave Unit Types function you use earlier in that loop).
Use Add Escort Unit To Attack Wave. That add a specific, existing unit to the wave.
Thanks for your help, but then I have another problem. Perhaps not as serious, but nothing I mess around with seems to work.
I just used Add UnitType because I don't know how to add a specific unit that hasn't actually spawned yet.
I tried making a Unit variable, saying that Unit = closest unit to point 011, so I could then just refer to the variable whenever I needed the escort. Again, the hero did nothing. Since the hero spawns from a trigger, it doesn't appear in the "Value" list. Do you have any suggestions what else I can use?
Create the variable (just set it to No Unit for now). When the trigger spawns the hero, assign him to that variable.
In your attack wave trigger make an if/else to check if the hero (the variable) is alive. If he is, then add him to the attack wave as escort, else do nothing.
I've tested Add Escort Unit To Attack Wave and I can't get it to work either :/ I've seen it work in the campaign mission about robbing trains, but I can't figure out what they did there...
If you want your hero unit to run alongside your attack wave, then just use Add Unit To Attack Wave. That should work like an escort (unless you really want all that offset and angle stuff too).
Each time you use AI- Send the attack wave.. no more units can be added to that attack wave, so just create an attack wave for the Hero and one for the attacking units.
I think it would be easier if you put all the units from the ghosts attack wave into a Unit Group first. That way the unit group that the Hero needs to escort is defined more specific. That may be the problem?
Also: 'Pick each integer from 10 to 10' -Why would you do this? If its just player 10 you want to trigger I would just use the value 10 for th eplayer field each time. It will help you debug easier. What I do for debugging is set text messages to see if the trigger actually works, so you can find out if it's the actions bugging or something else failing.
I've tried multiple times to attach the ghosts to a Unit Group, but nothing I use seems to work. Do you have any suggestions how I'm supposed to put units that haven't spawned yet into a group? It seems as if I can only put units already on the map via the presets, but how would I go about attaching units using triggers?
About the "Pick each integer" thing, it's been saving me a lot of grunt work. If I want to change the player, I just change the integer and everything changes.
Maybe I didn't understand what it's supposed to go like..
I thought you wanted spawn a group of 6 ghosts and 1 hero, and you want the hero to escort the ghosts?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I've made an AI use attack waves just fine - but I do still need to figure out how the Escort ability works.
In my scenario, I want 6 ghosts to attack towards a point and then have a hero escort them there.
I'm not sure what I've done wrong, the ghosts attack but the hero doesn't follow after them. Here's my code so far:
As said, the hero just stands around in one place. Can anyone see what I've done wrong?
You're using the Add Escort UnitType To Attack Wave. Whe you add a unit type to an attack wave the AI tries to build a unit of that type and then add it (exactly the same as the Add Attack Wave Unit Types function you use earlier in that loop).
Use Add Escort Unit To Attack Wave. That add a specific, existing unit to the wave.
@Tolkfan: Go
Thanks for your help, but then I have another problem. Perhaps not as serious, but nothing I mess around with seems to work.
I just used Add UnitType because I don't know how to add a specific unit that hasn't actually spawned yet.
I tried making a Unit variable, saying that Unit = closest unit to point 011, so I could then just refer to the variable whenever I needed the escort. Again, the hero did nothing. Since the hero spawns from a trigger, it doesn't appear in the "Value" list. Do you have any suggestions what else I can use?
Not sure if I understand, but here goes :P
Create the variable (just set it to No Unit for now). When the trigger spawns the hero, assign him to that variable.
In your attack wave trigger make an if/else to check if the hero (the variable) is alive. If he is, then add him to the attack wave as escort, else do nothing.
@Tolkfan: Go
Thank you for all your help, but he still refuses to move.
That is what I use to set Jim as the variable, then I use this to make him move.
Any idea what I might be missing here?
What unit attributes does your hero have?
@BasharTeg: Go
My hero is a Biological, Robotic, Heroic and Light hero.
The ones I want him to escort are Biological, Psionic and Heroic.
I've tested Add Escort Unit To Attack Wave and I can't get it to work either :/ I've seen it work in the campaign mission about robbing trains, but I can't figure out what they did there...
If you want your hero unit to run alongside your attack wave, then just use Add Unit To Attack Wave. That should work like an escort (unless you really want all that offset and angle stuff too).
Heya, It's all about putting the actions in the right order here.
So you want it to look like this:
Each time you use AI- Send the attack wave.. no more units can be added to that attack wave, so just create an attack wave for the Hero and one for the attacking units.
Thanks for all your suggestions, but I still can't get him to work.
This is what I made with your help, pplantenga, but he still refuses to follow them. I'm beginning to suspect something is wrong with my variable.
This is what I use to determine Jim Raynor as the variable. Any ideas?
I think it would be easier if you put all the units from the ghosts attack wave into a Unit Group first. That way the unit group that the Hero needs to escort is defined more specific. That may be the problem?
Also: 'Pick each integer from 10 to 10' -Why would you do this? If its just player 10 you want to trigger I would just use the value 10 for th eplayer field each time. It will help you debug easier. What I do for debugging is set text messages to see if the trigger actually works, so you can find out if it's the actions bugging or something else failing.
@pplantenga: Go
I've tried multiple times to attach the ghosts to a Unit Group, but nothing I use seems to work. Do you have any suggestions how I'm supposed to put units that haven't spawned yet into a group? It seems as if I can only put units already on the map via the presets, but how would I go about attaching units using triggers?
About the "Pick each integer" thing, it's been saving me a lot of grunt work. If I want to change the player, I just change the integer and everything changes.
Maybe I didn't understand what it's supposed to go like..
I thought you wanted spawn a group of 6 ghosts and 1 hero, and you want the hero to escort the ghosts?