Basically, take player # units and make them attack move towards their closest units (not to self though, must be an enemy).
Well I have this:
Unit Group - Pick each unit in (Any units in Inside PF owned by player 14 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions Unit - Order (Picked unit) to (Attack targeting (Position of (Closest unit to (Position of (Picked unit)) in (Any units in Inside PF owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)))) (Replace Existing Orders)
Actions Unit - Order (Picked unit) to (Attack targeting (Position of (Closest unit to (Position of (Picked unit)) in (Any units in Inside PF owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)))) (Replace Existing Orders)
You need to have an alliance check, otherwise the unit will attack move towards itself.
Instead of: "(Any units in Inside PF owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)"
Use the action "Units In Region With Alliance To Player":
(Units in (Inside PF) having alliance Enemy with player 14 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)
sorry, i tend to skim these things. but if u already doing it, whats the question?
What I was asking was that, how do I make each individual unit of a player attack his closest enemy (not all go for the same unit and ignore the others on their way). But my triggers weren't doing that for some reason, and I believe it was because in
"(Any units in Inside PF owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)"
the "Any Player" may include the player that is doing the attack, so in other words it was attack moving to the position of itself and when it spawned it just stood there. So that's how you solve it.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Basically, take player # units and make them attack move towards their closest units (not to self though, must be an enemy).
Well I have this:
Unit Group - Pick each unit in (Any units in Inside PF owned by player 14 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions Unit - Order (Picked unit) to (Attack targeting (Position of (Closest unit to (Position of (Picked unit)) in (Any units in Inside PF owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)))) (Replace Existing Orders)
And this is the code:
@joemart06: Go
there is an option under the issue order targeting unit action to target the closest unit to a player.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
there is a function closest unit to point (and u can convert source unit to point)
All what you said is pretty much what I have. I'm confused.
sorry, i tend to skim these things. but if u already doing it, whats the question?
You need to have an alliance check, otherwise the unit will attack move towards itself.
Instead of:
"(Any units in Inside PF owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)"
Use the action "Units In Region With Alliance To Player":
(Units in (Inside PF) having alliance Enemy with player 14 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)
@DeltaV: Go
Yes, that is exactly how I solved it.
What I was asking was that, how do I make each individual unit of a player attack his closest enemy (not all go for the same unit and ignore the others on their way). But my triggers weren't doing that for some reason, and I believe it was because in
"(Any units in Inside PF owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)"
the "Any Player" may include the player that is doing the attack, so in other words it was attack moving to the position of itself and when it spawned it just stood there. So that's how you solve it.