Tanks stopping when firing

Ask questions, discuss ideas, get answers
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Tanks stopping when firing

Post by BotHunter »

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!
Walk quietly and carry a sniper rifle
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Tanks stopping when firing

Post by Swaffy »

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™
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Tanks stopping when firing

Post by Vilespring »

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/

Image
"I didn't steal your pizza"
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: Tanks stopping when firing

Post by BotHunter »

Thats too bad :(

Is there anyway I could cheat them into it?
Walk quietly and carry a sniper rifle
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Tanks stopping when firing

Post by Apache Thunder »

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. ;)
ImageImageImage
I have cameras in your head!
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: Tanks stopping when firing

Post by BotHunter »

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
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Tanks stopping when firing

Post by Vilespring »

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/

Image
"I didn't steal your pizza"
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: Tanks stopping when firing

Post by BotHunter »

Yup! that would be a problem. I didn't think of that :D
Walk quietly and carry a sniper rifle
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Tanks stopping when firing

Post by Swaffy »

I think their aim while moving would be like setting a weapon's deviation minimum to like ... 50. :lol:
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: Tanks stopping when firing

Post by BotHunter »

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?
Walk quietly and carry a sniper rifle
Post Reply