Tanks stopping when firing
Tanks stopping when firing
Hey guys!
I was hoping that one of you could show me where the code is that tells the bots to stop moving their tanks before the fire.
Like on an airplane, the bots keep moving as they fire. But when they are in tanks, the always stop to fire.
Thanks!
I was hoping that one of you could show me where the code is that tells the bots to stop moving their tanks before the fire.
Like on an airplane, the bots keep moving as they fire. But when they are in tanks, the always stop to fire.
Thanks!
Walk quietly and carry a sniper rifle
Re: Tanks stopping when firing
I think it's the AI code. Cause if you turn on the bot stats, you can see their status change from Move to Fire. I guess they can't use both?
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
- Vilespring
- Posts: 740
- Joined: Sat Nov 24, 2012 5:47 am
- Location: Somewere in the United States
Re: Tanks stopping when firing
I'm actually sure planes stop throttling when they start shooting, ever watch them? They slow down a bit!
A picture is worth a thousand words, but takes up three thousand times the memory.
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Re: Tanks stopping when firing
Thats too bad
Is there anyway I could cheat them into it?

Is there anyway I could cheat them into it?
Walk quietly and carry a sniper rifle
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Tanks stopping when firing
Bots are hard coded to cease engine input (or reduce it in the case of aircraft) before they fire on something. It's to do with hard coded bot behaviors and such. Unfortunately there's no way to code around this. 
It's less noticable with aircraft since planes can glide forward and bots usually don't slow them down enough to stall. Plus aircraft get's special treatment by the AI, so they automatically know they can't stop the aircraft, so they most keep moving while firing. But such behavior can't be translated to ground vehicles. Note if you attempt to give a ground vehicle aircraft typing in the AI, then the pathfinding for that vehicle will likely break. Aircraft ignore all pathfinding aside from maybe the combat zone.

It's less noticable with aircraft since planes can glide forward and bots usually don't slow them down enough to stall. Plus aircraft get's special treatment by the AI, so they automatically know they can't stop the aircraft, so they most keep moving while firing. But such behavior can't be translated to ground vehicles. Note if you attempt to give a ground vehicle aircraft typing in the AI, then the pathfinding for that vehicle will likely break. Aircraft ignore all pathfinding aside from maybe the combat zone.




I have cameras in your head!
Re: Tanks stopping when firing
Hmmm. Is there any way I can add a driver PCO to the tank that only AI could get into? So then I would have a driver and a shooter.
Walk quietly and carry a sniper rifle
- Vilespring
- Posts: 740
- Joined: Sat Nov 24, 2012 5:47 am
- Location: Somewere in the United States
Re: Tanks stopping when firing
I was about to ask that! it might, but then you would have tanks running around everywhere like jeeps only doing a drive-by and then capping.
A picture is worth a thousand words, but takes up three thousand times the memory.
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Re: Tanks stopping when firing
Yup! that would be a problem. I didn't think of that 

Walk quietly and carry a sniper rifle
Re: Tanks stopping when firing
I think their aim while moving would be like setting a weapon's deviation minimum to like ... 50. 

(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: Tanks stopping when firing
Hmmm
What about an If-then statement? Like this: (pseudo code)
If (gunner_position = "InUse") Then
Can_Drive = 1
Endif
Could this possibly be done?
What about an If-then statement? Like this: (pseudo code)
If (gunner_position = "InUse") Then
Can_Drive = 1
Endif
Could this possibly be done?
Walk quietly and carry a sniper rifle