Page 1 of 1

Minimum attack range

Posted: 27 Jul 2007, 21:29
by Agon
Would be good to have a minimum attack range.
Example:
Attacking unit would attack:
Attacking unit:----(Miin)-unit---(Max)
Would not attack:
Attacking unit:---unit (Min)------(Max)

Posted: 27 Jul 2007, 21:46
by Peet
There's a hacky way to do this with a slaved weapon and a few lines of script, but an engine feature (or a luarule) to do this would be nice too.

Posted: 27 Jul 2007, 22:34
by Snipawolf
We don't need an example for something like this, we aren't retarded :wink:

Posted: 27 Jul 2007, 22:56
by Agon
Snipawolf wrote:We don't need an example for something like this, we aren't retarded :wink:
I don´t know. Maybe.?

Posted: 28 Jul 2007, 04:17
by rattle
Shouldn't be too difficult to add a minRange tag.

But as mentioned by Pete it's entirely possible with a slaved weapon. The slaved weapon will have the minimum range and actually will never fire.

As long as the AimWeapon function for the null weapon is being called you disable/lock up the real weapon's AimWeapon function and also start a timer-function in the background which will reenable the main weapon after some time - perhaps a bit longer than the interval at which spring aims. Should work like that... somehow.

Posted: 28 Jul 2007, 07:18
by KDR_11k
Rattle, that'd lock the unit up when something gets too close, it won't make it pick another target.

Posted: 28 Jul 2007, 22:51
by rattle
Hmm right. Also the unit would always try to get into the minimum range making it rather useless...