Page 1 of 1
Units Range of Fire + shooting only from total stop
Posted: 15 Apr 2007, 21:13
by Fri13
Range=xxxx is how i can determine range how long unit can fire, but how i can limit minimium range what unit can fire? Like if i do 3rd level mortar what firing range is 500 and makes big waveblast, how i get minimium level so it dont shoot scout vehicle what gets near it and blow itself or others near group, up to other planet?
Second guestion, is there way to set shooting possible only when not moving?
kBots can shoot when moving but real tanks usually shoots only stationary places or stop moving before shooting. Like if i want add small delay to shoot after stop, like when AA vehicle moves, it needs first to stop and wait 2-5 seconds before it can shoot.
Re: Units Range of Fire + shooting only from total stop
Posted: 15 Apr 2007, 21:24
by rattle
Fri13 wrote:Range=xxxx is how i can determine range how long unit can fire, but how i can limit minimium range what unit can fire? Like if i do 3rd level mortar what firing range is 500 and makes big waveblast, how i get minimium level so it dont shoot scout vehicle what gets near it and blow itself or others near group, up to other planet?
You can limit the minimum range by limiting the angle that weapon can aim. I think there was a minimum angle TDF tag, not sure if it's ignored by spring. Then again you could use the weaponMainDir FBI tag or limit the angle by script in the AimWeapon function, though I don't recommend that.
Fri13 wrote:Second guestion, is there way to set shooting possible only when not moving?
kBots can shoot when moving but real tanks usually shoots only stationary places or stop moving before shooting. Like if i want add small delay to shoot after stop, like when AA vehicle moves, it needs first to stop and wait 2-5 seconds before it can shoot.
Script it.
Code: Select all
var oldspeed;
oldspeed = get MAX_SPEED;
set MAX_SPEED to 0.000001;
sleep rand(2000,5000);
set MAX_SPEED to oldspeed;
AA
Posted: 15 Apr 2007, 23:46
by Fri13
Does that AimWeapon function allow limiting AA range too?
Posted: 16 Apr 2007, 00:22
by rattle
No, you can only prevent the unit from firing when it's aiming in a certain angle. The unit does not move in position then so it's able to fire then though. That is why I don't recommend that method.
AA (flaks) are generally LOS weapons IIRC so it would only work well with ballistics.
Code: Select all
AimWeapon1(pitch, heading)
{
signal SIG_AIM1;
set-signal-mask SIG_AIM1;
if (pitch < <5>) signal SIG_AIM1;
...
turn blah...
wait-on-turn blah...
...
return TRUE;
}
That should force a weapon not to fire when it's ptich is greater than 5├âÔÇÜ├é┬░ downwards. This basically means it can shoot at close targets but not too close. As I mentioned, it won't make the unit move into a good firing position.