Prevent multiple [unit] from targeting the same thing
Moderator: Moderators
Prevent multiple [unit] from targeting the same thing
Suppose you have 10 snipers in a row, perpendicular to a column of approaching peewees. In all likelihood, as the peewees approach, at least 50% of the shots will be wasted as multiple snipers attempt to simultaneously headshot the same peewees.
Would it be possible with lua to have a unit "lock" a given target from being attacked by other units of a given type (armsnipe) if the following conditions are satisfied:
-the unit is ready to fire
-it is able to fire at the target without itself or the target moving, in other words it has a clean shot
...And prevent other units of said type from attacking the target until one of the following conditions has been satisfied:
-the target is no longer in the attacker's primary weapon range
-the unit is unable to fire (weapon not ready due to EMP, unit has been destroyed, etc)
-0.2s has passed since the unit fired and the target isn't dead
Would it be possible with lua to have a unit "lock" a given target from being attacked by other units of a given type (armsnipe) if the following conditions are satisfied:
-the unit is ready to fire
-it is able to fire at the target without itself or the target moving, in other words it has a clean shot
...And prevent other units of said type from attacking the target until one of the following conditions has been satisfied:
-the target is no longer in the attacker's primary weapon range
-the unit is unable to fire (weapon not ready due to EMP, unit has been destroyed, etc)
-0.2s has passed since the unit fired and the target isn't dead
Last edited by Caydr on 16 Aug 2009, 10:36, edited 2 times in total.
Re: Prevent multiple [unit] from targeting the same thing
Sure.Caydr wrote:Suppose you have 10 snipers in a row, perpendicular to a column of approaching peewees. In all likelihood, as the peewees approach, at least 50% of the shots will be wasted as multiple snipers attempt to simultaneously headshot the same peewees.
Would it be possible with lua to have a unit "lock" a given target if the following conditions are satisfied:
-the unit is ready to fire
-it is able to fire at the target without itself or the target moving, in other words it has a clean shot
...And prevent other units from attacking the target until one of the following conditions has been satisfied:
-the target is no longer in the attacker's primary weapon range
-the unit is unable to fire (weapon not ready due to EMP, etc)
-0.2s has passed since the unit fired and the target isn't dead
I'm too lazy to do it for you though.

-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Prevent multiple [unit] from targeting the same thing
If someone is going to do this it would be worth adding predicted damage as well. This would stop units shooting at something if it is going to be dead but hasn't been hit yet. This would be great for units with slow projectiles and homing, for example the Janus.
Actually now I think a bit more the Janus thing can be worked into the original widget. Snipers are like Janus with faster shots so the predicted damage would still work.
Actually now I think a bit more the Janus thing can be worked into the original widget. Snipers are like Janus with faster shots so the predicted damage would still work.
Re: Prevent multiple [unit] from targeting the same thing
With snipers there's instant feedback, if the shot will hit you'll know it almost instantly, which is why I thought it would be ideal for this kind of thing. If someone actually decides to make this, IMHO it would be best to keep it as simple as possible... I realize that lua has a reputation of curing cancer and such, but things like predictive damage, excessively long waits to see if an attack actually landed (janus), will just make it unreliable and CPU intensive. Remember with predictive damage it'll have to figure out what side of the unit is going to get hit as well, because of directional bonuses.
Re: Prevent multiple [unit] from targeting the same thing
Cant there be instant hit weapons.
ex.
Unit fires weapon. Do damage at the same frame when it fires. Do not fire if dmg > enemy hp.
Can't Cob do it?
ex.
Unit fires weapon. Do damage at the same frame when it fires. Do not fire if dmg > enemy hp.
Can't Cob do it?
Re: Prevent multiple [unit] from targeting the same thing
Nah, you'd need lua for something like that for sure.Pendrokar wrote:Can't Cob do it?
Re: Prevent multiple [unit] from targeting the same thing
No, no, can't be tempted by that into doing this in cob, because it can definitely be done in cob.
Re: Prevent multiple [unit] from targeting the same thing
Hell, for an instant-hit weapon you might even have to use TDF.
Re: Prevent multiple [unit] from targeting the same thing
Oh, were you just talking about a subissue there? I stand by this entire feature being within cob's reach, can't be tempted.
Re: Prevent multiple [unit] from targeting the same thing
btw other request in that context, could aa-units fire with higher priority vs air for mods that have aa-units that could shoot on ground?
Re: Prevent multiple [unit] from targeting the same thing
Certainly.manolo_ wrote:btw other request in that context, could aa-units fire with higher priority vs air for mods that have aa-units that could shoot on ground?
Re: Prevent multiple [unit] from targeting the same thing
They already do, as long as the mod has functioning category tags. But don't worry, according to one expert non-modder, apparently that can be "designed around" through sheer force of willpower and good intentions.
Re: Prevent multiple [unit] from targeting the same thing
Don't berthas normally aim at radar blips when not explicitly given targets? It's not that important to have badtargetcategory mobile, now stop phrasing things in a trollish way please.