Gents, Where can I control the impact of a bombard attack? Does this just pick up the regular APAttack and HEAttack ranges?
I note that the APBombardAttack[0], APBombardAttack[1], HEBombardAttack[0], HEBombardAttack[1] are all zero in squads.csv (for bombard units, eg. mortars).
Does the bombard function apply the bombard_shots and bombardsalvoes values? Or are these just used to specify the animations?
Thanks!
Controlling bombard attacks?
Moderators: Slitherine Core, BA Moderators
-
- Lieutenant-General - Do 217E
- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Controlling bombard attacks?
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
-
- Captain - Heavy Cruiser
- Posts: 929
- Joined: Fri Jul 23, 2010 11:08 am
- Location: France
- Contact:
Re: Controlling bombard attacks?
The best is to looking into the BA scripts. The bombardment is defined by IndirectFire.BSF, IndirectFireLogic.bsf (data\battle\script) and by BombardTools.BSF (data\script).
You can see the values used to calculate the damage into IndirectFireLogic.bsf:
You can see the values used to calculate the damage into IndirectFireLogic.bsf:
Code: Select all
// fetch min/max HE attack & divide by HE 4 because this is indirect bombardment damage
minDam = GetAttribArray( me, "HEBombardAttack", 0 ) ;
maxDam = GetAttribArray( me, "HEBombardAttack", 1 ) ;
HE_Damage = Rand (minDam, maxDam) ;
// if values not set use our normal weapon values
if(maxDam == 0)
{
minDam = GetAttribArray( me, "HEAttack", 0 ) ;
maxDam = GetAttribArray( me, "HEAttack", 1 ) ;
HE_Damage = Rand (minDam, maxDam) / 4 ;
}
minDam = GetAttribArray( me, "APBombardAttack", 0 ) ;
maxDam = GetAttribArray( me, "APBombardAttack", 1 ) ;
AP_Damage = Rand (minDam, maxDam) ;
// if values not set use our normal weapon values
if(maxDam == 0)
{
minDam = GetAttribArray( me, "APAttack", 0 ) ;
maxDam = GetAttribArray( me, "APAttack", 1 ) ;
AP_Damage = Rand (minDam, maxDam) ;
}
unit = GetUnitOnTile ( impactX, impactY) ;
type = GetAttrib(unit, "ArmourType") ;
// dont let them hit themselves as it can cause odd issues.
if (unit != me )
{
if( ( unit == -1) || ( GetAttrib(unit, "ArmourType") == 0 ) )
{
BombardTile (impactX, impactY, HE_Damage, GetAttrib(me, "HE_Suppression"), GetAttrib(me, "HE_ExplosionType"), GetAttrib(me, "SFXImpact"), GetAttrib(me, "HE_TileDamage"), delay ) ;
}
else
{
BonusAPAttack(impactX, impactY, AP_Damage, GetAttrib(me, "HE_Suppression"), GetAttrib(me, "HE_ExplosionType"), GetAttrib(me, "SFXImpact"), GetAttrib(me, "HE_TileDamage"), delay ) ;
}
}
“Take care, my friend; watch your six, and do one more roll… just for me.”
-
- Lieutenant-General - Do 217E
- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Controlling bombard attacks?
Interesting, Thanks Alex!
Looks like the bombard damage defaults to HEAttack or APAttack if HEBombardAttack and APBombardAttack are zero (so we can modify by just adding in new HEBombardAttack and APBombardAttack values).
Intriguing that the code only softens the impact of a bombard (vs direct fire) for an HEAttack (ie. no /4 reduction for the equivalent HEBombardAttack, APAttack or APBombardAttack, all of which bombard at their full attack value).
That means bombarding is uberstrong versus armour (or if HEBombard values are set)... I wonder if that's intentional?
Looks like the bombard damage defaults to HEAttack or APAttack if HEBombardAttack and APBombardAttack are zero (so we can modify by just adding in new HEBombardAttack and APBombardAttack values).
Intriguing that the code only softens the impact of a bombard (vs direct fire) for an HEAttack (ie. no /4 reduction for the equivalent HEBombardAttack, APAttack or APBombardAttack, all of which bombard at their full attack value).
That means bombarding is uberstrong versus armour (or if HEBombard values are set)... I wonder if that's intentional?
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
-
- Captain - Heavy Cruiser
- Posts: 929
- Joined: Fri Jul 23, 2010 11:08 am
- Location: France
- Contact:
Re: Controlling bombard attacks?
Look into the BombardTools.BSF (data\script).
It is more subtle
:
It is more subtle

Code: Select all
if ( (GetUnitDead(unit) == 0) && (IsValidTile(x,y)==1))
{
// hit random facing & get armour & damage
facing = Rand (0,3) ;
armour = GetAttribArray (unit, "Armour", facing) ;
damage = Rand (-50, damage) ;
//Log ("facing, armour, damage", facing, armour, damage) ;
// unit destroyed
if (damage >= armour)
{
if ( GetAttrib(unit, "IsVehicle") == 1 )
{
// use either 0 or 1 as the death explosion
explosion = Rand (0,1) ;
AddVizUnitSpotAnim(unit, 255, "bang", explosion, 0) ;
}
AddVizFunctionCall("DestroyUnit",unit, 255) ;
AddVizAnimNoWait(unit,"DIE", 255) ;
ReportKill (unit) ;
//AddVizUnitText(unit, "IDS_UNIT_DESTROYED", "ffffff") ;
killed = 1 ;
}
else
{
if(damage < 25)
{
//AddVizUnitText(unit, "IDS_UNIT_MISSED", "ffffff") ;
}
else
{
AddVizUnitText(unit, "IDS_UNIT_BOUNCED", "ffffff") ;
}
// less suppression for armoured units
suppression /= 4 ;
MoraleUpdate (unit, -1, suppression) ;
}
“Take care, my friend; watch your six, and do one more roll… just for me.”