Jump to content
Sign in to follow this  
KTM_Calle

Prevent ai from firing while driving tank?

Recommended Posts

Heya, would it be possible to prevent the AI from using the turret of a tank while driving, and even better, is it possible to force them to halt whenever they want to shoot?

The tank in question is the Swedish "S-tank", a turretless creation smile_o.gif

S-tank link

This tank cannot fire when moving, it has to come to a complete halt, and then move its whole chassis to aim.

Share this post


Link to post
Share on other sites

unfortunately, what you wanna do is not possible.

i tried the same thing to prevent tank turrets from moving when soldiers sit on tank hull, because it´s kinda stupid to see the barrel move through a soldiers head. i tried everything, but nothing worked. my first attempt was to continuously set the gunner´s direction to the driver´s direction, because this one unit has the tanks direction always. prob here is that for all units in the tank the direction is always the tank´s direction. next idea i had was to disable the autoTarget AI of the gunner, but i had to skip that idea pretty fast because i had to learn that once u called disableAI this is finite,... can´t be switched back on mad_o.gif

to make the tank stop for shootin, the only measure i could think of would be the fired eventhandler. but since that is only called when the weapon is actually fired, that won´t do the trick, since you would have to know you want to fire (or AI) in advance. pretty much a drawback for the ww2 community, since all tanks will just have to act like modern tanks sad_o.gif

Share this post


Link to post
Share on other sites

In the armour code i'm working on, i reduced the maxleadspeed parameter to 10 km/h. Now the tanks are not firing when moving at full speed on a moving target. They fire only if they are driving slowly. But on problem is the AI is really stupid and wont stop to fire back at an enemy... They'll carry on driving untill the next waypoint.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×