No effect on infantry's final AT attack - Problem found :)

PC : Battle Academy is a turn based tactical WWII game with almost limitless modding opportnuities.

Moderators: Slitherine Core, BA Moderators

pipfromslitherine
Site Admin
Site Admin
Posts: 9860
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Sorry - we got your fix too late in the testing process. It's a pain, but we will perhaps do a smaller update soon with it in. This update took longer than we anticipated, some features needed quite extensive work, so we wanted to get it done asap. Hopefully we'll be back to more frequent updates now.

Cheers

Pip
PirateJock_Wargamer
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 325
Joined: Fri Apr 17, 2009 9:21 pm
Location: North West, UK
Contact:

Post by PirateJock_Wargamer »

Hi Pip

No worries :) Looking at the oodles of improvements/additions in this update I can understand a slight delay. Just wanted to check you hadn't done something clever somewhere else in the scripts to fix it.

Thanks
PirateJock_Wargamer
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 325
Joined: Fri Apr 17, 2009 9:21 pm
Location: North West, UK
Contact:

Post by PirateJock_Wargamer »

Hi Pip

I'm not sure if this was fixed in the latest update (1.6.0) with all the other changes, fixes etc ... so bringing it up again to keep it alive - I see it as my own little crusade :wink:

Cheers
IainMcNeil
Site Admin
Site Admin
Posts: 13558
Joined: Fri Apr 01, 2005 10:19 am

Post by IainMcNeil »

To be honest I dont remember - i think it was but check and if not let us know!
PirateJock_Wargamer
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 325
Joined: Fri Apr 17, 2009 9:21 pm
Location: North West, UK
Contact:

Post by PirateJock_Wargamer »

Superb - looks like it's been fixed :D

Haven't delved into the script to check (would take too long to reacquaint myself with the flow) but have managed to lose a few tanks to infantry on their 2nd (last) AT charge :cry:

Thanks
IainMcNeil
Site Admin
Site Admin
Posts: 13558
Joined: Fri Apr 01, 2005 10:19 am

Post by IainMcNeil »

Good! :)
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

PirateJock wrote:Superb - looks like it's been fixed :D

Haven't delved into the script to check (would take too long to reacquaint myself with the flow) but have managed to lose a few tanks to infantry on their 2nd (last) AT charge :cry:

Thanks
PirateJock,

I peaked at the script in question ... yes, it's been fixed, you can see the change easily in the MakeAttackAP ...
I'm glad you spotted that earlier and I'm really glad they jumped on it!

snipet from the code ...

Code: Select all

	// bug fix for last ap charge
	apChargeOld = GetAttrib (me, "APCharges") ;
	
	// focus on unit and turn to face target
	TurnAndFire (me, x, y, unit, flameDamage) ;

	// part 2 of AP charge bug fix
	apChargeNew = GetAttrib (me, "APCharges") ;
	SetAttrib (me, "APCharges", apChargeOld) ;
PirateJock_Wargamer
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 325
Joined: Fri Apr 17, 2009 9:21 pm
Location: North West, UK
Contact:

Post by PirateJock_Wargamer »

Hi Merr

Thanks for finding that :)

Cheers
djddalton
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 81
Joined: Wed Sep 22, 2010 7:18 pm

Post by djddalton »

I am now having this problem playing market garden - second AT charge is useless every time. Using scout on stugs
pipfromslitherine
Site Admin
Site Admin
Posts: 9860
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

That's odd. There are no special scripts for MG, so it should be using the same scripts as for any other unit.

Are you only seeing this on scouts?

Cheers

Pip
djddalton
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 81
Joined: Wed Sep 22, 2010 7:18 pm

Post by djddalton »

pipfromslitherine wrote: Are you only seeing this on scouts?
Hey Pip

No, I've noticed it on all the infantry units I tried!
pipfromslitherine
Site Admin
Site Admin
Posts: 9860
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Does your script read as per the fix shown in Merr's post above? It should definitely fix it!

Cheers

Pip
djddalton
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 81
Joined: Wed Sep 22, 2010 7:18 pm

Post by djddalton »

Does this go in BATTLESCRIPT? I'll put it at the bottom...I thought it had changed at the update!

Regards,

djddalton
pipfromslitherine
Site Admin
Site Admin
Posts: 9860
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

That's what I mean - I though that Merr had looked at the updated files and they were as he posted. If yours are not then that is a problem!

I will check here on my install too.

Cheers

Pip
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

pipfromslitherine wrote:That's what I mean - I though that Merr had looked at the updated files and they were as he posted. If yours are not then that is a problem!

I will check here on my install too.
Yeah, my "snipet" was from the core folder, Data/Battle/Scripts ... In the FireAP_Logic.bsf, under the function MakeAttackAP.

Perhaps there are other factors invloved... djddalton, was it a Reaction attack (op fire) or a direct attack by you? How many men were left in the unit? Scouts have a full strength of 3 men, if you lose a man, your initial strength is now 66%, whereas a 5 man unit that loses a man would be 80%.

Of course, after all that, maybe they just missed the Stug. So far I haven't seen the original problem since the fix. I can't comment on Op Fire ... that seems to be running some other logic used in the React function.


Rob
djddalton
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 81
Joined: Wed Sep 22, 2010 7:18 pm

Post by djddalton »

Merr wrote: Perhaps there are other factors invloved... djddalton, was it a Reaction attack (op fire) or a direct attack by you? How many men were left in the unit? Scouts have a full strength of 3 men, if you lose a man, your initial strength is now 66%, whereas a 5 man unit that loses a man would be 80%.

Of course, after all that, maybe they just missed the Stug. So far I haven't seen the original problem since the fix. I can't comment on Op Fire ... that seems to be running some other logic used in the React function.


Rob
No, it was a full-strength unit and a direct attack. I have had one incident where the second attack has destroyed the unit, but for all the others there has been no morale drop at all. This has been annoying as it's been the difference between a retreating unit and a unit that can shoot at me.

edit: - I had to download the latest update from the website instead of the menu uploader (it wouldn't let me). Could this be why?
I have not noticed anything with op fire - don't tend to use it as I wasted both my charges ;)
djddalton
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 81
Joined: Wed Sep 22, 2010 7:18 pm

Post by djddalton »

Still getting this problem!
pipfromslitherine
Site Admin
Site Admin
Posts: 9860
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Does your script file look the same as the snippet that was posted? If not - well, that would be a problem for sure!

Cheers

Pip
djddalton
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 81
Joined: Wed Sep 22, 2010 7:18 pm

Post by djddalton »

pipfromslitherine wrote:Does your script file look the same as the snippet that was posted? If not - well, that would be a problem for sure!
Hi Pip,

Just to check, what is the file name the script should be in?

Thanks,

Dom
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

Pip,

djddalton is correct ... The morale drop for the 2nd attack is still broken.

The problem is still in the same part of the code (part 3 of the fix)...

Code: Select all

		if (flameDamage == 0 )
		{
			// -1 damage means we missed
			damage = CalculateDamageAP(me, unit, aimedShot) ;
			
			// part 3 of ap charge bug fix
			SetAttrib (me, "APCharges", apChargeNew) ;
			
			// do any morale reduction for AP
			morale = CalculateChanceToKillAP(me, unit, 0) / 4 ;
			// reduce morale further for a hit  
			if ( damage > 0 )
			{
				morale += 10 ;
			}
			// Get tile damage variable for unit
			tileDamage = GetAttrib(me, "AT_TileDamage");
		}
You are setting the APCharges attribute too soon because the "CalculateChanceToKillAP" (for morale) will calculate effectiveness as 0 since the ap charges are 0 ...

Code: Select all

	if ( ( effectiveness == 0 ) && ( GetAttrib(me, "HasGrenade") > 0 ) && ( rangeBracket == 0 ) && ( GetAttrib(me, "APCharges") > 0 ) )
	{
		// if the unit has grenades override the 0 effectiveness
		effectiveness += 100 ;
	}
If you set the attribute after the "morale" like below, it should be all fixed (Merr commented part) ...

Code: Select all

		if (flameDamage == 0 )
		{
			// -1 damage means we missed
			damage = CalculateDamageAP(me, unit, aimedShot) ;
			
			// part 3 of ap charge bug fix
			//SetAttrib (me, "APCharges", apChargeNew) ;
			
			// do any morale reduction for AP
			morale = CalculateChanceToKillAP(me, unit, 0) / 4 ;
			
			// Merr .....
			SetAttrib (me, "APCharges", apChargeNew) ;
									
			// reduce morale further for a hit  
			if ( damage > 0 )
			{
				morale += 10 ;
			}
			// Get tile damage variable for unit
			tileDamage = GetAttrib(me, "AT_TileDamage");
		}
djddalton,

wrt filename ... Look in your main game folder ... mine is ;
C:\Program Files\Slitherine\Battlefield Academy\Battlefield Academy\Data\Battle\Scripts

The filename is FireLogic_AP.bsf ... the date is 5/6/2011 (4:50am)... that's the latest file we're talking about.
No need to open it and check.

-Merr
Post Reply

Return to “Battle Academy”