Is there a way to set a unit to attack an allied unit, or the player's own unit? One solution I have is to change the owner to neutral hostile, but this will lead to problems down the line. I just want to unit to attack anything that gets in range.
Additionally, is there a way to set a delay before it can start to attack after creation? For example, when the unit has spawned it must wait x seconds before it can begin attacking.
Sounds like something you'd be able to do through triggers. Unit enters/leaves range of unit for event and use the issue order action targeting triggering unit. Then use conditions to make sure the alliance or player of the unit is the one you want.
Actually a periodic event and conditions to check range/alliance would work even better maybe.
Oh, yeah. It could easily be done through triggers. I'm just avoiding using triggers where the data editor can accomplish the same thing (if not a bit better!). Keeps things neat.
Not sure if this will work since this is off the top of my head. Maybe a behavior that periodically uses a search effect. The search effect would use the issue order effect. Just set the period you like in the behavior and the radius to the range you want in the search effect.
Actually now that i think about it lol this might issue the order to the wrong unit.
Played with this myself and the only solution I had was a periodic search for friendly targets that launched the missile from there, so not really a weapon in the normal sense.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Is there a way to set a unit to attack an allied unit, or the player's own unit? One solution I have is to change the owner to neutral hostile, but this will lead to problems down the line. I just want to unit to attack anything that gets in range.
Additionally, is there a way to set a delay before it can start to attack after creation? For example, when the unit has spawned it must wait x seconds before it can begin attacking.
Appreciate the help.
You order the unit to attack that unit.... and it should attack it
Sorry if you misunderstood. I need them to auto-attack whatever is in range.
You could try to modify the attack ability or the weapon (weapon has some promising fields like scan filter)
Did not try anything, though ;)
@Farmrush: Go
Sounds like something you'd be able to do through triggers. Unit enters/leaves range of unit for event and use the issue order action targeting triggering unit. Then use conditions to make sure the alliance or player of the unit is the one you want.
Actually a periodic event and conditions to check range/alliance would work even better maybe.
@Writhes: Go
Oh, yeah. It could easily be done through triggers. I'm just avoiding using triggers where the data editor can accomplish the same thing (if not a bit better!). Keeps things neat.
@Farmrush: Go
Not sure if this will work since this is off the top of my head. Maybe a behavior that periodically uses a search effect. The search effect would use the issue order effect. Just set the period you like in the behavior and the radius to the range you want in the search effect.
Actually now that i think about it lol this might issue the order to the wrong unit.
Played with this myself and the only solution I had was a periodic search for friendly targets that launched the missile from there, so not really a weapon in the normal sense.